fvSchemes – OpenFOAM numerical schemes
The fvSchemes file in OpenFOAM is used to specify the numerical discretization schemes used for different variables in the simulation. It controls the accuracy and stability of the simulation results.
To open the fvSchemes file, navigate to the system folder in your OpenFOAM case directory and open the file with a text editor.
There are different types of numerical schemes available for different variables, such as time, pressure, velocity, and turbulence. The most commonly used schemes are first-order upwind and second-order central differencing.
The choice of scheme should be based on the nature of the simulation and the accuracy required. First-order upwind schemes are more stable but less accurate, while second-order central differencing schemes are more accurate but less stable.
It’s important to note that some schemes may require additional parameters to be specified in the fvSchemes file. For example, the Gauss linear scheme for pressure requires a tolerance value.
To ensure accuracy and stability, it’s recommended to perform sensitivity analyses on the numerical schemes used in the simulation.
Some common numerical schemes used in OpenFOAM include:
- First-order upwind scheme: This scheme is used for convection terms and is the simplest and most robust scheme. It is also the most dissipative and may not accurately capture fine details in the flow.
- Second-order central difference scheme: This scheme is used for diffusion terms and provides a good balance between accuracy and stability. It is less dissipative than the upwind scheme and can capture finer details in the flow.
- Third-order MUSCL scheme: This scheme is used for convection terms and provides higher accuracy than the upwind scheme while still maintaining stability. It is less dissipative than the upwind scheme and can capture finer details in the flow.
- Fourth-order accurate schemes: These schemes are used for both convection and diffusion terms and can provide even higher accuracy than the MUSCL scheme. They are also more computationally expensive.
It is important to choose the right numerical scheme for each term in the equation being solved to achieve a balance between accuracy and stability. The fvSchemes file in OpenFOAM allows for the specification of different numerical schemes for each term, which can be modified to improve the accuracy and stability of the simulation.
default cellLimited Gauss linear;
div(phi, U) Gauss upwind;
div(phi, T) Gauss upwind;
div((muEff*dev2(T(grad(U))))) Gauss linear;
default Gauss linear corrected;
For more information on OpenFOAM and its function objects, check out these links: