Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk7 min

How to Set Up a Physics-Informed Neural Network for a Navier–Stokes Inverse Problem

A practical guide to jointly inferring a flow field and unknown Navier–Stokes coefficients with a PINN, using the Re=100 cylinder-wake benchmark and its limits.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To set up a physics-informed neural network (PINN) for an inverse Navier–Stokes problem, train it to fit measured flow data and satisfy the governing equations at the same time. For a reproducible starting point, use the published two-dimensional, incompressible cylinder-wake benchmark at Reynolds number 100: infer the flow field and unknown equation coefficients from velocity observations, while using momentum residuals to constrain predictions between observations. That benchmark demonstrates a setup; it does not guarantee accuracy or parameter recovery for other geometries, noise levels, or flow regimes.

What is the inverse problem?

In a forward problem, the equations and their parameters are given, and the goal is to calculate the flow. In an inverse problem, some of that information is unknown. A PINN represents the flow with a neural network, then adjusts the network and unknown physical coefficients so its predictions agree with measurements and satisfy the equations.

As an Amazon Associate I earn from qualifying purchases.

For two-dimensional incompressible flow, write the velocity components as u(t,x,y) and v(t,x,y), and pressure as p(t,x,y). In the inverse formulation described by Raissi, Perdikaris, and Karniadakis (2019), two coefficients, λ1 and λ2, are inferred along with the flow representation. The continuity equation is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ux + vy = 0.

For a nondimensional formulation, the momentum equations can be written with residuals:

f = ut + λ1(u ux + v uy) + px − λ2(uxx + uyy)

g = vt + λ1(u vx + v vy) + py − λ2(vxx + vyy).

A solution satisfies the momentum equations when f and g are zero. In this formulation, λ1 and λ2 are equation coefficients; their interpretation depends on the chosen dimensional or nondimensional equations. For the paper’s nondimensional cylinder example, free-stream speed and cylinder diameter are each 1, and kinematic viscosity is 0.01. Do not interpret a learned coefficient as a viscosity estimate until you have checked how the equations were scaled and defined.

How do you enforce incompressibility in a PINN?

Use a stream function when continuity should hold by construction

The 2019 inverse formulation predicts a stream function ψ and pressure p, then derives velocity as:

u = ψy,   v = −ψx.

With sufficiently smooth outputs and the derivatives used in the model, this makes ux + vy = 0 by equality of mixed partial derivatives. Continuity is therefore built into the representation rather than enforced only by adding a separate continuity penalty.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Directly predict velocity when that fits the implementation

A network can instead predict u, v, and p directly. In that case, incompressibility must be imposed explicitly, commonly through a continuity residual. The choice is a trade-off: the stream-function form enforces divergence-free velocity by construction but requires differentiating the stream function to obtain velocity; direct velocity outputs are simpler to interpret as network outputs but require an additional continuity constraint. Neither representation removes the need to check that the equations, boundary conditions, and data are appropriate for the problem.

How do you build the PINN residuals?

For each training coordinate (t,x,y), evaluate the network and use automatic differentiation to calculate the derivatives in the equations. The momentum residuals above require first derivatives in time and space and second spatial derivatives. Automatic differentiation is the approach described in the original PINN framework; it computes derivatives of the network with respect to its inputs rather than approximating them with finite differences.

Keep the equations and units consistent. If you nondimensionalize, apply the same scales to coordinates, velocity, pressure, and coefficients throughout the network, residuals, and data loss. A coefficient’s numerical value is meaningful only in the context of those definitions. Record the precise equations and scaling alongside the trained model so that a later coefficient interpretation can be reproduced.

How should the data and physics losses be combined?

At observed points, penalize disagreement between predicted and measured velocity. At collocation points, penalize nonzero momentum residuals. A basic objective is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

L = wdataLdata + wmomentumLmomentum,

where Ldata measures the velocity mismatch, Lmomentum measures the residuals f and g, and the w terms set their relative influence. Add boundary or initial-condition terms when the problem supplies those conditions and the chosen formulation represents them.

There is no universal weighting prescription established by the cited examples. State how each loss is normalized, what units its underlying quantities use, and how the weights were chosen. If one term dominates numerically, a low total loss can conceal poor fit to the other term. Inspect the component losses separately as training proceeds, and validate with held-out data and residual behavior rather than treating a single objective value as proof of a sound inverse solution.

How can you reproduce the Re=100 cylinder-wake example?

Benchmark data and validation

Raissi, Perdikaris, and Karniadakis (2019) report randomly selecting 5,000 velocity observations, described as 1% of their high-resolution cylinder-wake dataset, for the inverse demonstration at Re = 100. They retain the remaining observations for validation. This is a benchmark sampling choice, not a minimum data requirement or a guarantee that 5,000 points will be enough for another flow.

For a new problem, reserve measurements that are not used to fit the network. Evaluate velocity error on those observations and inspect momentum residuals in the domain. If the true coefficients are known from a synthetic case or can be independently justified, compare recovered values against them. If they are not known, report that limitation rather than presenting fitted values as verified physical properties.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

DeepXDE example settings

DeepXDE’s inverse Navier–Stokes cylinder example provides a practical baseline. The repository script describes a Re=100 case, loads measured velocity data, defines a space-time domain, constrains observed velocity components, and treats two PDE coefficients as trainable external variables. Its example network takes (x,y,t) as input and uses a fully connected network with six hidden layers of 50 units, tanh activation, Glorot uniform initialization, and three outputs.

The script specifies 700 domain points, 200 boundary points, and 100 initial points. It trains in two Adam stages: 10,000 iterations at a learning rate of 10−3, followed by 10,000 at 10−4. These are settings from that example, not a generally optimal architecture, sampling plan, or training schedule. In particular, use point counts and losses that correspond to your own domain, boundary and initial conditions, and measurements.

  1. Define the problem: specify the domain, time interval, equations, unknown coefficients, measurement locations and any available initial or boundary conditions.
  2. Prepare the data: organize velocity observations with their coordinates and units. Separate fitting observations from held-out validation observations before training.
  3. Choose outputs and residuals: decide whether to represent velocity with a stream function or predict velocity directly, then implement the matching continuity and momentum constraints.
  4. Configure training: set collocation points, data constraints, network architecture, loss scales, optimizer settings, and trainable physical coefficients. Treat the DeepXDE values above as a baseline to reproduce, not as a prescription.
  5. Check the result: assess held-out velocity errors, residuals, and coefficient recovery where a justified reference exists. Fix or report problems with scaling, pressure reference, boundary conditions, noise, or identifiability rather than relying on training loss alone.

DeepXDE supports PINNs for forward and inverse differential-equation problems. Its versioned inverse-problem documentation lists the cylinder-flow example, while its stable documentation describes broader functionality. Because code and documentation can change, record the DeepXDE version or repository branch and confirm compatibility with the backend you intend to use. The example script lists TensorFlow, PyTorch, TensorFlow compat v1, and Paddle among supported backends; verify the support and compatibility of the specific release in your environment.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do you infer pressure, and what can the coefficients tell you?

Pressure needs a reference

In the cylinder-wake inverse example, pressure is reconstructed only up to an additive constant. The pressure gradients enter the momentum equations, so adding a constant to pressure does not change those gradients. Consequently, velocity observations and momentum residuals alone do not determine an absolute pressure level. To report pressure values, define a reference convention, such as fixing pressure at a chosen location, and state it with the results.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Coefficient recovery is not guaranteed by adding physics

Jointly fitting a flow representation and equation coefficients makes parameter inference possible, but a physics loss does not by itself make unknowns identifiable or ensure that optimization converges to the correct answer. Whether viscosity or another coefficient can be recovered depends on the equations, available observations, noise, domain, and imposed conditions. Assess that question for the particular setup, and distinguish a coefficient that minimizes the chosen loss from one independently validated as a physical value.

What should you check when results are unreliable?

  • Scaling: verify coordinate, velocity, pressure, and time scales, and confirm that coefficient definitions match the residual equations.
  • Loss balance: inspect data and residual losses individually; document normalization and weights instead of assuming raw magnitudes are comparable.
  • Data and conditions: check measurement noise, spatial and temporal coverage, and whether initial and boundary conditions are represented correctly.
  • Identifiability: determine whether the observations can distinguish the coefficients you are trying to infer. A good fit to measured velocities does not alone establish unique parameter recovery.
  • Pressure gauge: specify a pressure reference before interpreting absolute predicted pressure.
  • Generalization: evaluate observations withheld from fitting and residual behavior beyond the training points. Success on the published Re=100 cylinder case is not evidence of equivalent performance on a different flow regime or geometry.

A fluid-mechanics review of PINN work discusses a broader set of approaches, including sampling, domain decomposition, uncertainty quantification, and training pathologies. Those topics can motivate further problem-specific investigation, but they do not establish a universally superior architecture or optimizer for this inverse task. The strongest starting point is a clearly specified physical model, transparent loss construction, and validation matched to the intended application.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.