Hello everyone,
I'm trying to simulate a steady state CFD simulation in a CD nozzle using the solver rhoSimpleFoam. I'm facing some issues and I'm not able to validate my results.
I have attached all my files below.
I've created a very simple mesh in blockMesh, and have introduced mesh grading to refine the areas near the boundary. I attach my checkMesh results below
Code:
Build : v1906 OPENFOAM=1906
Arch : "LSB;label=32;scalar=64"
Exec : checkMesh
Create time
Create mesh for time = 0
Time = 0
Mesh stats
points: 121402
internal points: 0
faces: 240700
internal faces: 119300
cells: 60000
faces per cell: 6
boundary patches: 5
point zones: 0
face zones: 0
cell zones: 0
Overall number of cells of each type:
hexahedra: 60000
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0
Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).
Checking patch topology for multiply connected surfaces...
Patch Faces Points Surface topology
inlet 100 202 ok (non-closed singly connected)
outlet 100 202 ok (non-closed singly connected)
upperWall 600 1202 ok (non-closed singly connected)
lowerWall 600 1202 ok (non-closed singly connected)
frontAndBack 120000 121402 ok (non-closed singly connected)
Checking faceZone topology for multiply connected surfaces...
No faceZones found.
Checking basic cellZone addressing...
No cellZones found.
Checking geometry...
Overall domain bounding box (0 0 -0.0005) (0.007 0.00065 0.0005)
Mesh has 2 geometric (non-empty/wedge) directions (1 1 0)
Mesh has 2 solution (non-empty) directions (1 1 0)
All edges aligned with or perpendicular to non-empty directions.
Boundary openness (-9.4603783e-18 -2.5693272e-15 -9.6253206e-16) OK.
Max cell openness = 3.1682644e-16 OK.
Max aspect ratio = 4.1564656 OK.
Minimum face area = 2.6926964e-11. Maximum face area = 1.1995734e-08. Face area magnitudes OK.
Min volume = 2.6926964e-14. Max volume = 1.3989641e-13. Total volume = 4.025e-09. Cell volumes OK.
Mesh non-orthogonality Max: 2.4483775 average: 1.6573628
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 0.1068957 OK.
Coupled point location match (average 0) OK.
Mesh OK.
End
For my boundary conditions, I specify that it is a pressure driven flow, with totalPressure BC at the inlet and fixedValue at the outlet.
For velocity, I specify zeroGradient at both inlet and outlet, with noSlip at the top wall
For temperature, I specify fixedValue at the inlet and zeroGradient at the outlet.
I also use symmetryPlane BC for the lower wall.
I have attached my boundary conditions below.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 101325;
boundaryField
{
inlet
{
type totalPressure;
p0 uniform 200000;
U U;
phi phi;
rho rho;
psi none;
gamma 1.4;
}
outlet
{
type fixedValue;
value uniform 101325;
U U;
phi phi;
rho rho;
psi none;
gamma 1.4;
}
upperWall
{
type zeroGradient;
}
lowerWall
{
type symmetryPlane;
}
frontAndBack
{
type empty;
}
defaultFaces
{
type empty;
}
}
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
upperWall
{
type fixedValue;
value uniform (0 0 0);
}
lowerWall
{
type symmetryPlane;
}
frontAndBack
{
type empty;
}
}
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 298;
boundaryField
{
inlet
{
type totalTemperature;
T0 uniform 298;
gamma 1.4;
}
outlet
{
type zeroGradient;
}
upperWall
{
type zeroGradient;
}
lowerWall
{
type symmetryPlane;
}
frontAndBack
{
type empty;
}
}
I have read many posts in this forum, and people have recommended using the above boundary conditions for this case, so I'm not sure if there is a problem with this.
I'm attaching my fvSchemes, fvOptions and fvSolution files below. I'm not particularly sure as to which solver to use for this case, so I've just gone with the ones used in the tutorials.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
div(phi,e) bounded Gauss upwind;
div(phi,epsilon) bounded Gauss upwind;
div(phi,k) bounded Gauss upwind;
div(phid,p) Gauss upwind;
div(phi,Ekp) bounded Gauss upwind;
div((phi|interpolate(rho)),p) Gauss upwind;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
gradSchemes
{
default faceMDLimited Gauss linear 0.5;
}
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver GAMG;
smoother GaussSeidel;
tolerance 1e-6;
relTol 0.01;
}
"(U|k|omega|e)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-6;
relTol 0.01;
}
}
SIMPLE
{
residualControl
{
p 1e-4;
U 1e-4;
"(k|omega|e)" 1e-4;
}
nNonOrthogonalCorrectors 0;
pMinFactor 0.1;
pMaxFactor 2;
}
relaxationFactors
{
fields
{
p 0.7;
rho 0.01;
}
equations
{
U 0.3;
e 0.7;
"(k|omega)" 0.7;
}
}
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1906 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitT
{
type limitTemperature;
min 101;
max 1000;
selectionMode all;
}
I'm getting some pretty weird results, and I'm not able to validate my pressure and velocity plots with the literature.
Code:
# Solver information
# Time U_solver Ux_initial Ux_final Ux_iters Uy_initial Uy_final Uy_iters U_converged p_solver p_initial p_final p_iters p_converged
1 DILUPBiCGStab 1.00000000e+00 5.63145200e-03 1 1.00000000e+00 1.18017460e-03 1 false GAMG 1.00000000e+00 3.08416040e-03 1 true
2 DILUPBiCGStab 5.45963700e-01 1.69905430e-03 1 3.80739180e-01 1.41675240e-03 1 false GAMG 2.26367420e-01 1.35376850e-03 3 true
3 DILUPBiCGStab 4.30959060e-01 1.18852260e-03 1 2.92858160e-01 9.58617740e-04 1 false GAMG 5.43492460e-02 3.31423630e-04 5 true
4 DILUPBiCGStab 3.20779760e-01 8.65311860e-04 1 3.13826670e-01 9.23813840e-04 1 false GAMG 1.69414160e-02 1.34136910e-04 5 true
5 DILUPBiCGStab 2.56209780e-01 6.71257920e-04 1 1.71144620e-01 1.22977570e-03 1 false GAMG 1.21129840e-02 1.03227820e-04 7 true
6 DILUPBiCGStab 2.17978780e-01 6.08204110e-04 1 9.04764450e-02 7.59603610e-04 1 false GAMG 6.80493660e-03 3.89629250e-05 9 true
7 DILUPBiCGStab 1.88510680e-01 5.48296570e-04 1 5.44852170e-02 5.07802030e-04 1 false GAMG 3.11672060e-03 1.45205410e-05 8 true
8 DILUPBiCGStab 1.65910160e-01 5.03121960e-04 1 5.41494690e-02 2.58120990e-04 1 false GAMG 1.78527080e-03 1.27787290e-05 10 true
9 DILUPBiCGStab 1.48527580e-01 4.63248670e-04 1 5.09946720e-02 1.67642980e-04 1 false GAMG 1.64403040e-03 1.33992420e-05 7 true
10 DILUPBiCGStab 1.35567040e-01 4.37185820e-04 1 4.29566890e-02 1.33335920e-04 1 false GAMG 1.14007820e-03 5.09410220e-06 9 true
11 DILUPBiCGStab 1.25101200e-01 4.15358040e-04 1 3.67467390e-02 1.16270810e-04 1 false GAMG 6.55856160e-04 5.55730280e-06 10 true
12 DILUPBiCGStab 1.16331370e-01 3.94785310e-04 1 3.33904360e-02 1.14179040e-04 1 false GAMG 4.08227720e-04 2.61137050e-06 10 true
13 DILUPBiCGStab 1.08920730e-01 3.77537340e-04 1 3.04151770e-02 1.00107160e-04 1 false GAMG 3.19891450e-04 1.40731650e-06 10 true
14 DILUPBiCGStab 1.02434070e-01 3.60374460e-04 1 2.76140780e-02 8.70842780e-05 1 false GAMG 3.38320430e-04 2.80018250e-06 8 true
15 DILUPBiCGStab 9.68027690e-02 3.45042220e-04 1 2.51560640e-02 7.97026030e-05 1 false GAMG 2.95921630e-04 2.04757530e-06 10 true
16 DILUPBiCGStab 9.18175200e-02 3.30619640e-04 1 2.31945540e-02 7.53207720e-05 1 false GAMG 2.78887010e-04 2.13555550e-06 10 true
17 DILUPBiCGStab 8.73560160e-02 3.17040200e-04 1 2.14896960e-02 7.10223110e-05 1 false GAMG 2.61539370e-04 1.78062630e-06 10 true
18 DILUPBiCGStab 8.33385690e-02 3.04377940e-04 1 2.00176410e-02 6.69856460e-05 1 false GAMG 2.39387170e-04 1.52502490e-06 10 true
19 DILUPBiCGStab 7.96829250e-02 2.92397810e-04 1 1.87329790e-02 6.35358290e-05 1 false GAMG 2.24885040e-04 1.49790800e-06 10 true
20 DILUPBiCGStab 7.63413040e-02 2.81126890e-04 1 1.75887980e-02 6.02910410e-05 1 false GAMG 2.10218520e-04 1.53493880e-06 10 true
21 DILUPBiCGStab 7.32650410e-02 2.70438530e-04 1 1.65726370e-02 5.73083060e-05 1 false GAMG 1.91872990e-04 1.52267420e-06 10 true
22 DILUPBiCGStab 7.04232370e-02 2.60365690e-04 1 1.56758180e-02 5.46103790e-05 1 false GAMG 1.81844850e-04 1.50381060e-06 10 true
23 DILUPBiCGStab 6.77782630e-02 2.50757110e-04 1 1.48653250e-02 5.21972350e-05 1 false GAMG 1.72173430e-04 1.45175550e-06 10 true
24 DILUPBiCGStab 6.53140050e-02 2.41670020e-04 1 1.41437450e-02 4.99757360e-05 1 false GAMG 1.73370400e-04 1.46278090e-06 10 true
25 DILUPBiCGStab 6.30025590e-02 2.32989500e-04 1 1.34863160e-02 4.79381780e-05 1 false GAMG 1.71632110e-04 1.44063250e-06 10 true
26 DILUPBiCGStab 6.08374200e-02 2.24776930e-04 1 1.28970280e-02 4.60580520e-05 1 false GAMG 1.79620720e-04 1.48070940e-06 10 true
27 DILUPBiCGStab 5.87925880e-02 2.16906900e-04 1 1.23541050e-02 4.43544230e-05 1 false GAMG 1.78122980e-04 1.47343430e-06 10 true
28 DILUPBiCGStab 5.68701380e-02 2.09467830e-04 1 1.18693010e-02 4.27715320e-05 1 false GAMG 1.92241980e-04 1.55318520e-06 10 true
29 DILUPBiCGStab 5.50387110e-02 2.02284800e-04 1 1.14108410e-02 4.13368420e-05 1 false GAMG 1.83502800e-04 1.52036720e-06 10 true
30 DILUPBiCGStab 5.33225160e-02 1.95563590e-04 1 1.10138510e-02 3.99818580e-05 1 false GAMG 2.19881880e-04 1.69307790e-06 10 true
31 DILUPBiCGStab 5.16611490e-02 1.88944310e-04 1 1.06115980e-02 3.87271670e-05 1 false GAMG 1.94226080e-04 1.05166710e-06 9 true
32 DILUPBiCGStab 5.01307010e-02 1.82932710e-04 1 1.03014500e-02 3.75655170e-05 1 false GAMG 2.83234270e-04 2.64408350e-06 9 true
33 DILUPBiCGStab 4.85968080e-02 1.76766330e-04 1 9.92182590e-03 3.64379860e-05 1 false GAMG 2.07138410e-04 1.01193740e-06 11 true
34 DILUPBiCGStab 4.72464770e-02 1.71468870e-04 1 9.69155610e-03 3.55057620e-05 1 false GAMG 3.93283910e-04 3.05400540e-06 9 true
35 DILUPBiCGStab 4.58148180e-02 1.65662860e-04 1 9.31109310e-03 3.43954260e-05 1 false GAMG 2.28560780e-04 1.92363650e-06 11 true
36 DILUPBiCGStab 4.45977370e-02 1.60842140e-04 1 9.16470370e-03 3.39266820e-05 1 false GAMG 4.28370440e-04 3.43084120e-06 9 true
37 DILUPBiCGStab 4.32852850e-02 1.55414630e-04 1 8.82190370e-03 3.25834400e-05 1 false GAMG 2.43366240e-04 1.66772150e-06 11 true
38 DILUPBiCGStab 4.21815780e-02 1.51078060e-04 1 8.64352460e-03 3.19734930e-05 1 false GAMG 4.77693940e-04 3.41435100e-06 9 true
39 DILUPBiCGStab 4.09662000e-02 1.46093860e-04 1 8.34459010e-03 3.09677080e-05 1 false GAMG 2.72134740e-04 2.10972370e-06 11 true
40 DILUPBiCGStab 3.99430810e-02 1.42052270e-04 1 8.22838910e-03 3.06635910e-05 1 false GAMG 4.75725740e-04 3.50940940e-06 9 true
I've attached my residuals log for the first 40 iterations. I notice that U_converged is always false, all the way, while p_converged is showing true.
I don't know if it's a problem with my boundary conditions, mesh or system properties. I've been breaking my head with this for a while. Can someone please help me out? I'd really appreciate it.