Accelerating CFD simulations

Patient Tools

Read, save, and share this guide

Use these quick tools to make this medical article easier to read, print, save, or share with a family member.

Patient Mode

Understand this article easily

Switch between simple English and easy Bangla patient notes. This is for education and does not replace a doctor consultation.

The advent of machine learning (ML) is transforming every industry, from healthcare to finance, and from transportation to e-commerce. A promising use of machine learning is its combination with computational fluid dynamics (CFD) and other scientific applications. Different techniques, such as data-driven machine learning and...

For severe symptoms, danger signs, pregnancy, child illness, or sudden worsening, seek urgent medical care.

বাংলা রোগী নোট এখনো যোগ করা হয়নি। পোস্ট এডিটরে “RX Bangla Patient Mode” বক্স থেকে সহজ বাংলা সারাংশ যোগ করুন।

এই তথ্য শিক্ষা ও সচেতনতার জন্য। এটি ডাক্তারি পরীক্ষা, রোগ নির্ণয় বা প্রেসক্রিপশনের বিকল্প নয়।

Article Summary

The advent of machine learning (ML) is transforming every industry, from healthcare to finance, and from transportation to e-commerce. A promising use of machine learning is its combination with computational fluid dynamics (CFD) and other scientific applications. Different techniques, such as data-driven machine learning and physics-informed neural networks (PINNs), are transforming scientific simulations by bringing them into real-world, real-time processes. This development holds great promise...

Key Takeaways

  • This article explains Accelerating CFD simulations in simple medical language.
  • This article explains ML-CFD and VR interface in simple medical language.
  • This article explains A playground for CFD, CAD, VR, and ML in simple medical language.
  • This article explains What’s next for ONNX Runtime in simple medical language.
Educational health guideWritten for patient understanding and clinical awareness.
Reviewed content workflowUse writer and reviewer profiles for stronger trust.
Emergency safety firstUrgent warning signs are highlighted below.

Seek urgent medical care if you notice

These warning signs are general safety guidance. Local emergency numbers and clinical judgment should always come first.

  • Severe symptoms, breathing difficulty, fainting, confusion, or rapidly worsening illness.
  • New weakness, severe pain, high fever, or symptoms after a serious injury.
  • Any symptom that feels urgent, unusual, or unsafe for the patient.
1

Emergency now

Use emergency care for severe, sudden, rapidly worsening, or life-threatening symptoms.

2

See a doctor

Book a professional medical evaluation if symptoms persist, worsen, recur often, affect daily activities, or occur in a high-risk patient.

3

Learn safely

Use this article to understand possible causes, tests, treatment options, prevention, and questions to ask your clinician.

Before reading

RX Patient Tools

Use these quick guides before reading the article, or return to them when you need help preparing questions for a doctor.

Start here Choose the right pathway for symptoms, reports, medicines, or urgent warning signs. Disease article roadmap Read this topic step by step: meaning, symptoms, warning signs, diagnosis, treatment, prevention, and follow-up. Treatment planner Prepare questions about treatment choices, benefits, risks, side effects, and follow-up. Family & caregiver guide Organize symptoms, reports, medicines, questions, and follow-up safely. Nutrition & diet guide Prepare food, hydration, supplement, and medicine-timing questions safely. Prevention guide Organize risk factors, protective habits, screening, and warning signs. Recovery guide Prepare a safe plan for activity, rehabilitation, warning signs, and follow-up.

The advent of machine learning (ML) is transforming every industry, from healthcare to finance, and from transportation to e-commerce. A promising use of machine learning is its combination with computational fluid dynamics (CFD) and other scientific applications. Different techniques, such as data-driven machine learning and physics-informed neural networks (PINNs), are transforming scientific simulations by bringing them into real-world, real-time processes. This development holds great promise for new discoveries, for optimizing the use of energy and materials, or for preventing potential hazards.

A step further is the generation of virtual worlds or digital twins to form the core of the industrial metaverse. The key part is to be able to interact with the virtual world seamlessly as though it were the real world. In this way, we can test many hypotheses at little to no cost and decide on an optimal solution before implementing it in reality. By thinking outside the box, we can envision creating a virtual multiverse. Within this innovative space, one can propose, evaluate, and decide on multiple hypotheses. Real-world examples of this approach include planning new product configurations, operating a plant, designing heating or cooling systems, or responding to catastrophes.

To bring CFD to virtual or augmented reality (VR/AR), there are two main challenges that need to be addressed: the need for significant computational power to perform CFD simulations in real-time or near-real time, and the need for specialized software that can integrate both CFD and VR systems. Next, we will explain how we solved this at SIMZERO.

Accelerating CFD simulations

One approach to accelerate CFD simulations is to use mathematical methods such as reduced-order models or ML algorithms to learn and approximate the results of CFD simulations. Another approach is to incorporate physical laws into the network architecture. Although there is still a long way to go in terms of developing physical models for complex processes and learning from them, there are already many applications that can benefit from this progress. In this blog entry we will not focus on the methods themselves but on the deployment of the ML-CFD pre-trained models. To ensure efficient deployment of ML-CFD, we opted to use Open Neural Network Exchange (ONNX) models, which allows for seamless interoperability between existing ML-CFD frameworks based on PyTorch, TensorFlow, Keras, and other frameworks. Another important factor in choosing ONNX was the capability for directly running inference in different programming languages thanks to ONNX Runtime. This allowed us to use ONNX Runtime to deploy the models to both backend and browser.

To streamline the process, we have created a Python module `cfdonnx` to bring together specific code to convert ML-CFD models to ONNX. The current module supports the U-Net model architecture but we plan to extend this to others in future releases. We have also created some reproducible examples with the workflows that cover CFD runs to ONNX using DeepCFD as the ML package. The example below shows how to export a PyTorch model to ONNX by passing a PyTorch model. Parameters such as network architecture, input shape, filters, and kernel sizes are read from the PyTorch model in this case, but they can be also passed as arguments for convenience.

1
python3 -m cfdonnx --input model.pt --output model.onnx

ML-CFD and VR interface

A missing part was the interface between the ML-CFD and VR components. To address this, we developed jsfluids, a high-level JavaScript module for real-time CFD inference. This module handles reduced-order models created by ITHACA-FV and generic ML models. When using ML, we relied on ONNX Runtime to handle the ML aspects and provide a seamless interface between the virtual world and on-the-fly post-processing. Specifically, ONNX Runtime inference is performed to calculate the new fields that are passed to jsfluids for creating visualization components. The visualization components are compatible with Babylon.js which is the real-time 3D engine used. Further analysis can also be performed aside from the visualization components. These tasks were achieved by porting specific parts of VTK/C++ to JavaScript.

Accelerating CFD simulations
Figure 2: High-level workflow for jsfluids

In the end, this approach enables the inference and analysis of fluid dynamics at the edge. By executing models directly on devices, we can reduce infrastructure costs, reduce latency, and improve privacy. In addition, we can bring the models to low consumption devices for connecting them with sensors and real world or to reduce power consumption on deployment.

The following pseudocode shows how to use an ONNX model for inferring a velocity field, and creating and visualizing GLTF components on Babylon.js:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const model = jsfluids.ML;
// Load the ONNX model from an URL or local data
ort.InferenceSession.create(onnxURL).then((onnx) => {
  // Load the CFD mesh (unstructured grid) from an URL or local data
  model.loadMesh(vtuURL).then(() => {
    // Create a visualization component
    // (e.g. outline surface, plane, streamlines, ...)
    var gltf = model.setComponent({ type: "surface" });
    var blob = new Blob([gltf]);
    var url = URL.createObjectURL(blob);
    BABYLON.SceneLoader.ImportMesh("", url, "", scene, (meshes) => {
      // Manipulate meshes (materials, positions, ...)
      // Create the feeds input for your ONNX model
      // var feeds = …
      onnx.run(feeds).then((results) => {
        // Manipulate results to get the fields if needed
        // var U = …
        // Set operations (if any) to be performed on the new field
        // (e.g. vorticity or gradients)
        model.setOperations({ operations: ["vorticity"] });
        // Assign the field to the model and update
        model.update({ field: "U", data: U });
        // Render the component and assign the new field colors
        var render = model.render({
          field: "U",
          // range: [0, 0.1]
        });
        meshes[1].setVerticesData(
          BABYLON.VertexBuffer.ColorKind,
          render.colors,
          true
        );
        // Other jsfluids features as probing or integrating a field
        var point = [0, 0, 0];
        var probe = model.probe({ field: "U", point: point });
        var integrate = model.integrate({
          field: "vorticity",
          target: "grid"
        });
      });
    }, null, null, ".gltf");

A playground for CFD, CAD, VR, and ML

Getting started with these packages can be complicated, especially as the scope extends to several different domains. For this reason, we have created a live editor playground powered by ChatGPT at SIMZERO Play for experimenting, building, and testing. The playground includes other libraries such as babyplots and JSCAD for data visualization and CAD modeling, respectively. JSCAD provides a programmer’s approach to designing 3D models. Although Babylon.js also allows for different geometry operations such as Constructive Solid Geometry (CSG), a user can choose to use JSCAD for convenience or for using models already developed by the community.

At SIMZERO Play you can find different examples and templates for starting building models and worlds while choosing the combination of tools that best suits your needs. For instance, one can just use Babylon.js together with ONNX Runtime for building virtual worlds with artificial intelligence, and add the CFD and CAD features if required. Additional features will be added so users could easily build and use their models and applications outside the playground in both development and production.

What’s next for ONNX Runtime

With the deployment of pre-trained ML-CFD models using ONNX Runtime, we can infer fluid dynamics and seamlessly integrate them with virtual and augmented reality systems using open-source tools. Together with our newly developed JavaScript library jsfluids and the playground, you can easily access this technology to create better worlds.

Doctor visit helper

Prepare before seeing a doctor

A simple rural-patient checklist to help you explain symptoms clearly, ask better questions, and avoid unsafe self-treatment.

Safety note: This is not a prescription or diagnosis. For severe symptoms, pregnancy danger signs, children with serious illness, chest pain, breathing difficulty, stroke-like weakness, or major injury, seek urgent care.

Which doctor may help?

Start with a registered doctor or the nearest qualified health center.

What to tell the doctor

  • Write when the problem started and how it changed.
  • Bring old prescriptions, investigation reports, and current medicines.
  • Write allergies, pregnancy status, diabetes, kidney/liver disease, and major past illnesses.
  • Bring one family member if the patient is weak, elderly, confused, or a child.

Questions to ask

  • What is the most likely cause of my symptoms?
  • Which danger signs mean I should go to hospital quickly?
  • Which tests are necessary now, and which can wait?
  • How should I take medicines safely and what side effects should I watch for?
  • When should I come for follow-up?

Tests to discuss

  • Vital signs: temperature, pulse, blood pressure, oxygen saturation
  • Basic physical examination by a clinician
  • CBC, urine test, blood sugar, or imaging only when clinically needed

Avoid these mistakes

  • Do not use antibiotics, steroid tablets/injections, or strong painkillers without proper medical advice.
  • Do not hide pregnancy, kidney disease, ulcer, allergy, or blood thinner use.
  • Do not delay emergency care when danger signs are present.

Medicine safety and first-aid guide

This section is for patient education only. It does not replace a doctor, pharmacist, or emergency care.

Safe first steps

  • Avoid heavy lifting, sudden bending, and prolonged bed rest.
  • Use comfortable posture and gentle movement as tolerated.
  • Discuss physiotherapy, X-ray, or MRI only when clinically needed.

OTC medicine safety

  • For mild back pain, pain-relief medicine may be discussed with a doctor or pharmacist.
  • Avoid repeated painkiller use if you have kidney disease, stomach ulcer, uncontrolled blood pressure, or are taking blood thinners.

Avoid these mistakes

  • Do not start antibiotics without a proper medical decision.
  • Do not use steroid tablets or injections casually for quick relief.
  • Do not delay emergency care because of home remedies.

Get urgent help if

  • Back pain with leg weakness, numbness around private area, loss of urine/stool control, fever, cancer history, or major injury needs urgent care.
Medicine names, dose, and timing must be decided by a qualified clinician or pharmacist after checking age, pregnancy, allergy, other diseases, and current medicines.

For rural patients and family caregivers

Patient health record and symptom diary

Write your symptoms, medicines already taken, test results, and questions before visiting a doctor. This note stays on your device unless you print or copy it.

Doctor to discuss: Doctor / qualified healthcare provider
Tests to discuss with doctor
  • Basic vital signs: temperature, pulse, blood pressure, oxygen level if needed
  • Relevant blood, urine, imaging, or specialist tests only after clinical assessment
Questions to ask
  • What is the most likely cause of my symptoms?
  • Which warning signs mean I should go to emergency care?
  • Which tests are really needed now?
  • Which medicines are safe for my age, pregnancy status, allergy, kidney/liver/stomach condition, and current medicines?

Emergency warning signs such as chest pain, severe breathing difficulty, sudden weakness, confusion, severe dehydration, major injury, or loss of bladder/bowel control need urgent medical care. Do not wait for online information.

Safe pathway to proper treatment

Care roadmap for: Accelerating CFD simulations

Use this simple roadmap to understand the next safe steps. It is educational and does not replace examination by a doctor.

Go to emergency care if you notice:
  • Severe or rapidly worsening symptoms
  • Breathing difficulty, chest pain, fainting, confusion, severe weakness, major injury, or severe dehydration
Doctor / service to discuss: Qualified healthcare provider; specialist depends on symptoms and examination.
  1. Step 1

    Check danger signs first

    If danger signs are present, seek emergency care and do not wait for online information.

  2. Step 2

    Record the symptom story

    Write when symptoms started, severity, medicines already taken, allergies, pregnancy status, and test results.

  3. Step 3

    Visit a qualified clinician

    A doctor, nurse, or qualified healthcare provider can examine you and decide which tests or treatment are needed.

  4. Step 4

    Do only useful tests

    Do tests after clinical assessment. Avoid unnecessary tests, random antibiotics, or repeated medicines without diagnosis.

  5. Step 5

    Follow up and return early if worse

    If symptoms worsen, new warning signs appear, or treatment is not helping, return for review quickly.

Rural patient practical tips
  • Take a written symptom diary and all previous prescriptions/test reports.
  • Do not hide medicines already taken, even herbal or over-the-counter medicines.
  • Ask which warning signs mean urgent referral to hospital.

This roadmap is for education. A real diagnosis and treatment plan requires history, examination, and clinical judgment.

RX Patient Help

Ask a health question safely

Write your symptom story. A health professional or site editor can review it before any answer is prepared. This box is not for emergency care.

Emergency first: Severe chest pain, breathing trouble, unconsciousness, stroke signs, severe injury, heavy bleeding, or rapidly worsening symptoms need urgent local medical care now.

Frequently Asked Questions

Is this article a replacement for a doctor?

No. It is educational content only. Patients should consult a qualified clinician for diagnosis and treatment.

When should I seek urgent care?

Seek urgent care for severe symptoms, rapidly worsening condition, breathing difficulty, severe pain, neurological changes, or any emergency warning sign.

References

Add references, clinical guidelines, textbooks, journal articles, or trusted medical sources here. You can edit this area from the RX Article Professional Blocks panel.