# Navier-Stokes Solver
# 📝 Navier-Stokes Solver Configuration
The Navier-Stokes solver controls the compressible flow equations in Flow360. It determines how the simulation solves for fluid velocity, pressure, and density throughout the domain. Proper configuration of these parameters is essential for achieving accurate and converged solutions.
# 📋 Available Parameters
Parameter | Description | Unit |
---|---|---|
Absolute Tolerance | Convergence criteria for NS residual | |
Relative Tolerance | Relative residual reduction for unsteady cases | |
Order of Accuracy | Spatial discretization order (1st or 2nd) | |
CFL Multiplier | Factor applied to CFL specified in Time Stepping | |
Kappa MUSCL | Parameter controlling upwind vs. central scheme | |
Limit Velocity | Whether to apply limiters to velocity | |
Limit Pressure Density | Whether to apply limiters to pressure/density | |
Low Mach Preconditioner | Acceleration technique for low Mach flows | |
Low Mach Preconditioner Threshold | Minimum Mach number for preconditioner scaling | |
Update Jacobian Frequency | How often to update the Jacobian matrix | steps |
Numerical Dissipation Factor | Controls dissipation for unsteady simulations |
# 🔍 Detailed Descriptions
# Absolute Tolerance
The primary convergence metric for how far to reduce the Navier-Stokes residuals.
- Default:
1.0e-10
- Example:
1.0e-8
- Notes:
- For steady cases, at least 5 orders of magnitude reduction is recommended
- Controls when the solver determines the solution has converged
- Smaller values result in more accurate solutions but may require more iterations
# Relative Tolerance
Defined as the ratio of the current pseudoStep's residual to the maximum residual present in the first 10 pseudoSteps within the current physicalStep.
- Default:
0.0
(disabled for steady simulations) - Example:
0.001
(for unsteady simulations) - Notes:
- Ignored for steady simulations
- For unsteady cases, typically set to 1e-2 or 1e-3
- Once residuals drop by 2-3 orders of magnitude, solver proceeds to next physical step
# Order of Accuracy
Determines whether the solver uses 1st or 2nd order spatial discretization.
- Default:
2
(second order) - Example:
1
(first order for initialization) - Notes:
- 1st order: More stable but more dissipative, less accurate
- 2nd order: More accurate but less stable
- For initial flow field development in unsteady cases with rotating components, running 1st order for 1-2 revolutions can help establish the flow before switching to 2nd order
- Should match the turbulence model's order of accuracy
# CFL Multiplier
Scaling factor applied to the CFL number defined in Time Stepping.
- Default:
1.0
- Example:
0.5
(for better stability) - Notes:
- Reducing this value can help stability for challenging cases
- Effective CFL = Time Stepping CFL × CFL Multiplier
# Kappa MUSCL
Controls the blending between upwind and central schemes in the spatial discretization.
- Default:
-1
(second-order upwind scheme) - Example:
0.33
(blended scheme for low dissipation) - Notes:
- Range: [-1, 1] (values above 0.33 not recommended)
- -1: Pure second-order upwind (most stable)
- 0.33: Blended upwind/central scheme (less dissipative, good for low subsonic flows)
- 1.0: Unstable central scheme (avoid)
# Limit Velocity
Applies limiters to velocity to enhance stability in transonic/supersonic flows.
- Default:
False
- Example:
True
(for transonic flows) - Notes:
- Enable for transonic or supersonic cases
- Can help prevent divergence in regions with strong shocks
# Limit Pressure Density
Applies limiters to pressure and density to enhance stability in transonic/supersonic flows.
- Default:
False
- Example:
True
(for transonic flows) - Notes:
- Enable for transonic or supersonic cases
- Can help prevent negative pressures or densities near shocks
# Low Mach Preconditioner
Improves solver convergence for low Mach number flows by addressing the stiffness in the equation system.
- Default:
False
- Example:
True
(for flows with M < 0.3) - Notes:
- Recommended for simulations with Mach number below 0.3
- Particularly beneficial for nearly incompressible flows
- Can significantly accelerate convergence for low-speed aerodynamics
# Low Mach Preconditioner Threshold
Minimum Mach number used in the preconditioner scaling.
- Default: Freestream Mach number (if not specified)
- Example:
0.1
- Notes:
- For flow regions with Mach numbers smaller than this threshold, the threshold value is used
- Only relevant when Low Mach Preconditioner is enabled
# Update Jacobian Frequency
Controls how often the Jacobian matrix is updated during the solution process.
- Default:
4
(every 4 pseudo-steps) - Example:
1
(every pseudo-step for challenging cases) - Notes:
- Smaller values improve robustness but increase computational cost
- Reducing to 1 may help convergence for difficult cases
- May slow the solver by up to approximately 30% when set to 1
# Numerical Dissipation Factor
Factor that controls the reduction in numerical flux dissipation for the low-dissipation Roe scheme.
- Default:
1.0
(standard scheme) - Example:
0.2
(low dissipation for unsteady simulations) - Notes:
- Range: [0.01, 1.0]
- Only compatible with unsteady simulations
- Recommended value: 0.2 for low-dissipation
- For better convergence, a value of 0.5 can be used
- Most effective for low Mach and low Reynolds number flows
💡 Tips
For steady-state simulations:
- Focus on absolute tolerance for convergence criteria
- Consider using low Mach preconditioner for low-speed flows
- Use 2nd order accuracy for final results
For unsteady simulations:
- Use relative tolerance (typically 1e-2 or 1e-3)
- For cases with rotating components, consider starting with 1st order for initialization
- Use AdaptiveCFL instead of ramp CFL strategy to automatically balance stability and convergence speed
For low-dissipation schemes:
- Start from a converged steady or unsteady solution
- Aim for at least a two-order-of-magnitude reduction in nonlinear residuals
- Consider halving the time step size
- Use Kappa MUSCL = 1/3 for optimal accuracy
- Set Update Jacobian Frequency = 1 for better stability
For transonic or supersonic flows:
- Enable limiters for velocity and pressure/density
- Use a more dissipative scheme (Kappa MUSCL = -1)
❓ Frequently Asked Questions
When should I use 1st order vs. 2nd order accuracy?
Use 1st order for initial flow field development or for very challenging cases with strong discontinuities. Use 2nd order for final production runs to achieve accurate results. For unsteady simulations with rotating components, consider starting with 1st order for 1-2 revolutions before switching to 2nd order.
How do I know if my simulation has converged properly?
For steady simulations, look for at least 5 orders of magnitude reduction in residuals and stable force coefficients. For unsteady simulations, ensure residuals drop by 2-3 orders of magnitude within each physical time step.
What can I do if my simulation is diverging?
Try the following: (1) Use AdaptiveCFL instead of manual CFL settings to automatically adjust for stability, (2) Reduce the convergence limiting factor for complex cases with strong gradients or discontinuities, (3) Reduce the CFL number if using ramp CFL settings, (4) Switch to 1st order accuracy temporarily, (5) Enable limiters for transonic/supersonic flows, (6) Update the Jacobian more frequently (set update_jacobian_frequency = 1), (7) Check the mesh quality, particularly in high-gradient regions.
When should I use the low-dissipation scheme?
Use it for unsteady simulations where capturing fine flow structures is important, especially for aeroacoustics, turbulent flows, and vortex-dominated flows. It works best for low Mach number flows and should be started from a well-developed solution.
How does the Kappa MUSCL parameter affect my solution?
Kappa_MUSCL = -1 (default) gives a stable upwind scheme with higher numerical dissipation. Kappa MUSCL = 0.33 gives a less dissipative scheme that preserves flow features better but may be less stable. For low-speed flows without strong shocks, Kappa MUSCL = 0.33 often provides better results.
What's the difference between absolute and relative tolerance?
absolute_tolerance is used for both steady and unsteady simulations and represents the absolute value of the residual. relative_tolerance is only used for unsteady simulations and represents how much the residual must be reduced within each physical time step relative to the initial residual of that step.
🐍 Python Example Usage
Below is a Python code example showing how to configure the Navier-Stokes solver:
import flow360 as fl
# Basic configuration for the Navier-Stokes solver
ns_solver = fl.NavierStokesSolver(
absolute_tolerance=1e-10,
order_of_accuracy=2
)
# Configuration for a low-speed simulation
ns_solver_low_mach = fl.NavierStokesSolver(
absolute_tolerance=1e-10,
low_mach_preconditioner=True,
low_mach_preconditioner_threshold=0.1,
kappa_MUSCL=0.33
)
# Configuration for an unsteady simulation with low dissipation
ns_solver_unsteady = fl.NavierStokesSolver(
absolute_tolerance=1e-10,
relative_tolerance=1e-3,
numerical_dissipation_factor=0.2,
update_jacobian_frequency=1,
linear_solver=fl.LinearSolver(max_iterations=50)
)
# Configuration for a transonic/supersonic flow
ns_solver_transonic = fl.NavierStokesSolver(
absolute_tolerance=1e-10,
limit_velocity=True,
limit_pressure_density=True,
CFL_multiplier=0.5
)