iper88 |
November 25, 2015 07:12 |
cannot converge a pimpleFoam simulation
Hi,
I'm trying to simulate a 2D Ahmed body at Re=100 with water. Ux=0.0004m/s
First,the simpleFoam simulation have converged.
Now, I'm trying to simulate with pimpleFoam solver, but has not converged in any of both cases as initial conditions:
- inlet velocity of 0.0004m/s on X direction
-last steady-state fields from last time converged simpleFoam simulation
But in every case it doesn't converge.
I'm new in OF. I tried to implement different fvSchemes and fvSolution options, but with no results.
Can anybody help?
Thanks a lot, in advance.
Ivan
Blockmesh Code
Code:
/* Cambiar Geometría
-Ahmed body (lon,L
-grosor de capa límite (CapL)
-ángulo del chaflan (alpha)
-profundidad de celda (zp y nzp)
-Distancia ente el suelo y el Ahmed (Dd)
*/
lon 1044; //longitud
L 288; //altura (distancia característica)
D 88; //altura morro plano
R 100; //radio de curvatura
C 222; //longitud del chaflan
alpha 35.0; //ángulo de caida
CapL 50; //grosor de capa límite
Dd 100; //Distancia ente el suelo y el Ahmed
nzp -50; //grosor negativo de celda en el plano Z
zp 50; //grosor positivo de celda en el plano Z
A 100; //no afecta
//***Cambiar numero de Celdas de cada Cara y Grading
//1*******************************************[52.600 cells]
/**/
BL_CellsY 20; BL_Grading 0.1; //normal a la capa límite
BL_CornerCells 20; //esquinas capa límite
BL_UpperCells 100; //
BL_LowerCells 200;
BL_FrontCells 20;
BL_LowWakeCells 50;
BL_UpWakeCells 70;
frontCellsX 50; frontGradingX 0.03; //
wakeCellsX 150; wakeGradingX 20;
upperCellsY 40; upperGradingY 50;
floorCellsY 20; floorGradingY 10;
Pi 3.141592654;
DgToRad #calc "$Pi/180";
//******declaración de distancias dependientes******************
B #calc "$lon-$R-$C*cos($alpha*$DgToRad)";
Fd #calc "10*$L";
Bd #calc "20*$L";
Ud #calc "8*$L";
//COTAS HORIZONTALES****************************
x13 #calc "$CapL*(1-sin($alpha*$DgToRad))";
Ax #calc "$Fd-$CapL";
Bx #calc "$Fd+$R-($R+$CapL)*0.707107";
Cx #calc "$Fd+$R-$R*0.707107";
Dx #calc "$Fd+$R";
Ex #calc "$Dx+$B";
EEx #calc "$Ex+$x13";
Fx #calc "$Fd+$lon";
Gx #calc "$Fx+$CapL";
Hx #calc "$Fx+$Bd";
//COTAS VERTICALES******************************
y20 #calc "$CapL*(1-sin($alpha*$DgToRad))";
Ay #calc "$Dd+$R-($R+$CapL)*0.707107";
By #calc "$Dd+$R";
Cy #calc "$Dd+$R+$D";
Dy #calc "$Cy+($R+$CapL)*0.707107";
Fy #calc "$Dd-$CapL";
Gy #calc "$Dd+$L";
Hy #calc "$Cy+$R*0.707107";
Iy #calc "$Gy-$C*tan($alpha*$DgToRad)";
IIy #calc "$Iy+$y20";
Jy #calc "$By-$R*0.707107";
Ky #calc "$Iy+$CapL";
Ly #calc "$Dd+$L+$CapL";
Ey #calc "$Gy+$A";
My #calc "$Gy+$Ud";
convertToMeters 0.001;
vertices
( //0 1 2 3 4 5 6 7
($Ax $Cy $nzp)
($Fd $Cy $nzp)
($Cx $Hy $nzp)
($Bx $Dy $nzp)
($Ax $Cy $zp)
($Fd $Cy $zp)
($Cx $Hy $zp)
($Bx $Dy $zp)
//8 9 10 11
($Dx $Ly $nzp)
($Dx $Gy $nzp)
($Dx $Ly $zp)
($Dx $Gy $zp)
//11 12 13 14
($Ex $Gy $nzp)
($EEx $Ly $nzp)
($Ex $Gy $zp)
($EEx $Ly $zp)
//16 17 18 19
($Fx $Iy $nzp)
($Fx $Ky $nzp)
($Fx $Iy $zp)
($Fx $Ky $zp)
//20 21 22 23
($Gx $IIy $nzp)
($Gx $Ky $nzp)
($Gx $IIy $zp)
($Gx $Ky $zp)
//24 25 26 27
($Hx $IIy $nzp)
($Hx $Ky $nzp)
($Hx $IIy $zp)
($Hx $Ky $zp)
//*************28-39 plano nzp
(0 $Cy $nzp)
(0 $Dy $nzp)
(0 $Ey $nzp)
($Bx $Ey $nzp)
($Dx $Ey $nzp)
($EEx $Ey $nzp)
($Fx $Ey $nzp)
($Fx $Ly $nzp)
($Gx $Ly $nzp)
($Gx $Ey $nzp)
($Hx $Ly $nzp)
($Hx $Ey $nzp)
//*********** 40-51 plano zp
(0 $Cy $zp)
(0 $Dy $zp)
(0 $Ey $zp)
($Bx $Ey $zp)
($Dx $Ey $zp)
($EEx $Ey $zp)
($Fx $Ey $zp)
($Fx $Ly $zp)
($Gx $Ly $zp)
($Gx $Ey $zp)
($Hx $Ly $zp)
($Hx $Ey $zp)
//***Puntos PARTE DE INFERIOR MALLA****************************
//************Plano nzp
(0 $By $nzp)//52
($Ax $By $nzp)
($Fd $By $nzp)
($Dx $Dd $nzp)
($Ex $Dd $nzp)
($Fx $Dd $nzp)
($Gx $Dd $nzp)
($Hx $Dd $nzp)
(0 $Ay $nzp)
($Bx $Ay $nzp)
($Dx $Fy $nzp)
($Ex $Fy $nzp)
($Fx $Fy $nzp)
($Gx $Fy $nzp)
($Hx $Fy $nzp)
(0 0 $nzp)
($Bx 0 $nzp)
($Dx 0 $nzp)
($Ex 0 $nzp)
($Fx 0 $nzp)
($Gx 0 $nzp)
($Hx 0 $nzp)
//*****************Plano zp
(0 $By $zp)
($Ax $By $zp)
($Fd $By $zp)
($Dx $Dd $zp)
($Ex $Dd $zp)
($Fx $Dd $zp)
($Gx $Dd $zp)
($Hx $Dd $zp)
(0 $Ay $zp)
($Bx $Ay $zp)
($Dx $Fy $zp)
($Ex $Fy $zp)
($Fx $Fy $zp)
($Gx $Fy $zp)
($Hx $Fy $zp)
(0 0 $zp)
($Bx 0 $zp)
($Dx 0 $zp)
($Ex 0 $zp)
($Fx 0 $zp)
($Gx 0 $zp)
($Hx 0 $zp)
($Cx $Jy $nzp)
($Cx $Jy $zp)
//***modificaciones**************************************************
//puntos de celdas superiores*************
//************plano nzp
(0 $My $nzp)//98
($Bx $My $nzp)
($EEx $My $nzp)
($Gx $My $nzp)
($Hx $My $nzp)
(0 $My $zp)
($Bx $My $zp)
($EEx $My $zp)
($Gx $My $zp)
($Hx $My $zp)
//****************
($Dx $My $nzp)//108
($Dx $My $zp)
);
blocks
(
//*******PARTE SUPERIOR**********************************************
//*****capa limite superior del Ahmed y cola
hex (0 1 2 3 4 5 6 7) ($BL_CellsY $BL_CornerCells 1) simpleGrading ($BL_Grading 1 1) //0
hex (3 2 9 8 7 6 11 10) ($BL_CellsY $BL_CornerCells 1) simpleGrading ($BL_Grading 1 1) //1
hex (8 9 12 13 10 11 14 15) ($BL_CellsY $BL_UpperCells 1) simpleGrading ($BL_Grading 1 1) //2
hex (13 12 16 20 15 14 18 22) ($BL_CellsY $BL_UpWakeCells 1) simpleGrading ($BL_Grading 1 1) //3
//*****bloques desde el techo a la capa límite
hex (28 0 3 29 40 4 7 41) ($frontCellsX $BL_CornerCells 1) simpleGrading ($frontGradingX 1 1) //6
hex (13 20 24 38 15 22 26 50) ($BL_UpWakeCells $wakeCellsX 1) simpleGrading (1 $wakeGradingX 1) //15
//****bloques frontal y dorsal del centro del Ahmed*******************
hex (52 53 0 28 74 75 4 40) ($frontCellsX $BL_FrontCells 1) simpleGrading ($frontGradingX 1 1) //16
hex (53 54 1 0 75 76 5 4) ($BL_CellsY $BL_FrontCells 1) simpleGrading ($BL_Grading 1 1) //17
hex (57 65 20 16 79 87 22 18) ($BL_CellsY $BL_LowWakeCells 1) simpleGrading (#calc "1/($BL_Grading)" 1 1) //18
hex (65 66 24 20 87 88 26 22) ($wakeCellsX $BL_LowWakeCells 1) simpleGrading ($wakeGradingX 1 1) //19
//***********PARTE INFERIOR*******************************************
hex (60 61 53 52 82 83 75 74) ($frontCellsX $BL_CornerCells 1) simpleGrading ($frontGradingX 1 1) //20
hex (61 96 54 53 83 97 76 75) ($BL_CellsY $BL_CornerCells 1) simpleGrading ($BL_Grading 1 1) //21
hex (62 55 96 61 84 77 97 83) ($BL_CellsY $BL_CornerCells 1) simpleGrading ($BL_Grading 1 1) //22
hex (65 57 55 62 87 79 77 84) ($BL_CellsY $BL_LowerCells 1) simpleGrading ($BL_Grading 1 1) //24
hex (67 68 61 60 89 90 83 82) ($frontCellsX $floorCellsY 1) simpleGrading ($frontGradingX $floorGradingY 1) //27
hex (68 69 62 61 90 91 84 83) ($BL_CornerCells $floorCellsY 1) simpleGrading (1 $floorGradingY 1) //28
hex (69 72 65 62 91 94 87 84) ($BL_LowerCells $floorCellsY 1) simpleGrading (1 $floorGradingY 1) //30
hex (72 73 66 65 94 95 88 87) ($wakeCellsX $floorCellsY 1) simpleGrading ($wakeGradingX $floorGradingY 1) //32
//***********CELDAS SUPERIORES MODIFICACION*****************************
hex (29 3 99 98 41 7 104 103) ($frontCellsX $upperCellsY 1) simpleGrading ($frontGradingX $upperGradingY 1) //33
hex (8 13 100 108 10 15 105 109) ($BL_UpperCells $upperCellsY 1) simpleGrading (1 $upperGradingY 1) //34
hex (13 38 102 100 15 50 107 105) ($wakeCellsX $upperCellsY 1) simpleGrading ($wakeGradingX $upperGradingY 1) //36
hex (3 8 108 99 7 10 109 104) ($BL_CornerCells $upperCellsY 1) simpleGrading (1 $upperGradingY 1) //37
//hex (17 16 20 21 19 18 22 23) (20 20 1) simpleGrading (1 1 1) //4
//hex (21 20 24 25 23 22 26 27) (20 30 1) simpleGrading (1 1 1) //5
//hex (29 3 31 30 41 7 43 42) (30 10 1) simpleGrading (1 1 1) //7
//hex (31 3 8 32 43 7 10 44) (10 20 1) simpleGrading (1 1 1) //8
//hex (32 8 13 33 44 10 15 45) (10 20 1) simpleGrading (1 1 1) //9
//hex (33 13 20 37 45 15 22 49) (10 20 1) simpleGrading (1 1 1) //10
//hex (13 17 35 13 15 19 47 15) (20 20 1) simpleGrading (1 1 1) //11
//hex (35 17 21 36 47 19 23 48) (20 20 1) simpleGrading (1 1 1) //12
//hex (36 21 25 38 48 23 27 50) (20 30 1) simpleGrading (1 1 1) //13
//hex (34 35 36 37 46 47 48 49) (10 20 1) simpleGrading (1 1 1) //14
//hex (63 56 55 62 85 78 77 84) (20 60 1) simpleGrading (1 1 1) //23
//hex (65 58 57 64 87 80 79 86) (20 20 1) simpleGrading (1 1 1) //25
//hex (66 59 58 65 88 81 80 87) (20 30 1) simpleGrading (1 1 1) //26
//hex (69 70 63 62 91 92 85 84) (60 80 1) simpleGrading (1 1 1) //29
//hex (71 72 65 64 93 94 87 86) (20 80 1) simpleGrading (1 1 1) //31
//hex (13 36 101 100 15 48 106 105) (20 80 1) simpleGrading (1 1 1) //35
);
edges
(
//**********Arcos Superiores del bloque 0 y 1
arc 1 2 (#calc "$Fd+$R-$R*cos(20.0*$DgToRad)" #calc "$Cy+$R*sin(20.0*$DgToRad)" $nzp)
arc 5 6 (#calc "$Fd+$R-$R*cos(20.0*$DgToRad)" #calc "$Cy+$R*sin(20.0*$DgToRad)" $zp)
arc 0 3 (#calc "$Fd+$R-($R+$CapL)*cos(20.0*$DgToRad)" #calc "$Cy+($R+$CapL)*sin(20.0*$DgToRad)" $nzp)
arc 4 7 (#calc "$Fd+$R-($R+$CapL)*cos(20.0*$DgToRad)" #calc "$Cy+($R+$CapL)*sin(20.0*$DgToRad)" $zp)
arc 2 9 (#calc "$Fd+$R-$R*sin(20.0*$DgToRad)" #calc "$Dd+$D+$R+$R*0.939693" $nzp)
arc 6 11 (#calc "$Fd+$R-$R*sin(20.0*$DgToRad)" #calc "$Dd+$D+$R+$R*cos(20.0*$DgToRad)" $zp)
arc 3 8 (#calc "$Fd+$R-($CapL+$R)*0.342020" #calc "$Dd+$D+$R+($CapL+$R)*cos(20.0*$DgToRad)" $nzp)
arc 7 10 (#calc "$Fd+$R-($CapL+$R)*0.342020" #calc "$Dd+$D+$R+($CapL+$R)*cos(20.0*$DgToRad)" $zp)
//**********Arcos Superiores del bloque 21 y 22
arc 54 96 (#calc "$Fd+$R-$R*cos(20.0*$DgToRad)" #calc "$Dd+$R-$R*sin(20.0*$DgToRad)" $nzp)
arc 76 97 (#calc "$Fd+$R-$R*cos(20.0*$DgToRad)" #calc "$Dd+$R-$R*sin(20.0*$DgToRad)" $zp)
arc 53 61 (#calc "$Fd+$R-($R+$CapL)*cos(20.0*$DgToRad)" #calc "$Dd+$R-($R+$CapL)*sin(20.0*$DgToRad)" $nzp)
arc 75 83 (#calc "$Fd+$R-($R+$CapL)*cos(20.0*$DgToRad)" #calc "$Dd+$R-($R+$CapL)*sin(20.0*$DgToRad)" $zp)
arc 55 96 (#calc "$Fd+$R-$R*sin(20.0*$DgToRad)" #calc "$Dd+$R-$R*cos(20.0*$DgToRad)" $nzp)
arc 77 97 (#calc "$Fd+$R-$R*sin(20.0*$DgToRad)" #calc "$Dd+$R-$R*cos(20.0*$DgToRad)" $zp)
arc 62 61 (#calc "$Fd+$R-($CapL+$R)*0.342020" #calc "$Dd+$R-($CapL+$R)*cos(20.0*$DgToRad)" $nzp)
arc 84 83 (#calc "$Fd+$R-($CapL+$R)*0.342020" #calc "$Dd+$R-($CapL+$R)*cos(20.0*$DgToRad)" $zp)
);
boundary
(
Ahmed
{
type wall;
faces
(
(1 2 6 5)
(2 9 11 6)
(9 12 14 11)
(12 16 18 14)
(16 57 79 18)
(57 55 77 79)
(55 96 97 77)
(96 54 76 97)
(54 1 5 76)
);
}
inlet
{
type patch;
faces
(
(98 29 41 103)
(29 28 40 41)
(28 52 74 40)
(52 60 82 74)
(60 67 89 82)
);
}
outlet
{
type patch;
faces
(
(38 102 107 50)
(24 38 50 26)
(66 24 26 88)
(73 66 88 95)
);
}
upperWall
{
type patch;
faces
(
(99 98 103 104)
(108 99 104 109)
(100 108 109 105)
(102 100 105 107)
);
}
lowerWall
{
type wall;
faces
(
(67 68 90 89)
(68 69 91 90)
(69 72 94 91)
(72 73 95 94)
);
}
frontAndBack
{
type empty;
faces
(
(98 99 3 29) (41 7 104 103)
(29 3 0 28) (40 4 7 41)
(28 0 53 52) (74 75 4 40)
(52 53 61 60) (82 83 75 74)
(60 61 68 67) (89 90 83 82)
(99 108 8 3) (7 10 109 104)
(3 8 9 2) (6 11 10 7)
(0 3 2 1) (5 6 7 4)
(0 1 54 53) (75 76 5 4)
(53 54 96 61) (83 97 76 75)
(61 96 55 62) (84 77 97 83)
(61 62 69 68) (90 91 84 83)
(108 100 13 8) (10 15 105 109)
(8 13 12 9) (11 14 15 10)
(55 57 65 62) (84 87 79 77)
(62 65 72 69) (91 94 87 84)
(100 102 38 13) (15 50 107 105)
(12 13 20 16) (18 22 15 14)
(13 38 24 20) (22 26 50 15)
(16 20 65 57) (79 87 22 18)
(20 24 66 65) (87 88 26 22)
(65 66 73 72) (94 95 88 87)
);
}
);
mergePatchPairs
(
);
fvSchemes Code
Code:
ddtSchemes
{
default steadyState;//Euler; for transient solver
//steadyState; for non transient solver
//LES: 1.backward differencing is ideal
// 2. CrankNicholson 0.9 improves stability but less acurate than backward
// 3. Eurler. but with low maximum Courant number of 0.1 for sufficient accuracy
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
// For poorer meshes, velocity gradient grad(U) may need limiting:
grad(U) cellLimited Gauss linear 1;
//grad(U) Gauss linear;
}
divSchemes
{
default none;
//on LES: div(phi,U) Gauss linear; is required
//on RANS: div(phi,U) Gauss linearUpwindV Gauss linear; where 'Gauss linear' is the gradient discretisation
//For poorer meshes,linear upwind uses velocity gradient, so that may also need limiting: div(phi,U) Gauss linearUpwindV cellLimited Gauss linear1;
div(phi,U) bounded Gauss linearUpwindV grad(U); //
div(phi,k) bounded Gauss upwind;
div(phi,omega) bounded Gauss upwind;
div((nuEff*dev(T(grad(U))))) Gauss linear;
div(div(phi,U)) Gauss upwind phi;
}
laplacianSchemes
// Accuracy demands Laplacian terms use non-orthogonal correction
//Full corrected discretisation can be used on good meshes, theta_n-o < 50º
// limited correction with coeffs Phi, 50º<theta_no < 70º
//Phi = a) 0.333 non-orthogonal corection <= 0.5*orthogonal part
// b) 0.5 non-orthogonal correction <= orthogonal part
// c) 1 corresponds to 'corrected'
//Tip: choice of laplacian can be tested with 'potentialFoam'
{
default Gauss linear corrected;//none;
//laplacian(nu,U) Gauss linear orthogonal;
//laplacian((1|A(U)),p) Gauss linear orthogonal;
}
interpolationSchemes
{
default linear;
//interpolate(HbyA) linear;
}
snGradSchemes
{
default corrected;//orthogonal;
}
fluxRequired
{
default no;
p ;
Phi;
}
fvSolution
Code:
solvers
{
//pressure equation is CRITICAL
p
{
//'PCG' reliable option solver. For parallel cases, 'preconditioner DIC' is reliable; 'relTol 0.01' or lower (steady-state)
//'preconditioner GAMG' with the same sequence of settings bellow can be more efficient:
/*if num of iterations to convergence < 20, The 'GAMG' solver may be more efficient:
-'DICGaussSeidel' or 'DIC' smoother
-Set 'nPreSweeps' = 2
-'nPostSweeps' = 2
- 'relTol' = 0.1 - 0.01 (steady-state)
- 'cacheAgglomeration' on;*/
//if its rapidly converging (2-10 iterations), the 'GaussSeidel' smoother may be EVEN BETTER, perhaps with 'nPreSweeps'=0.
solver GAMG; //GAMG,PCG
//preconditioner DIC; //GAMG,DIC
//tolerance 1e-05 - 1e-08 depending on
//-What is the desired goal and accuracy requirement?
//-What level of convergence is possible?
tolerance 1e-07;
relTol 0.1; // 0, 0.1-0.01(steady-state)
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration on;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;
}
Phi
{
$p;
}
U
{
solver smoothSolver; //PBiCG;
smoother GaussSeidel;
//preconditioner DILU;
//tolerance 1e-05 - 1e-08 depending on
//-What is the desired goal and accuracy requirement?
//-What level of convergence is possible?
tolerance 1e-08;
relTol 0.1; //0
nSweeps 1;
}
k
{
solver smoothSolver; //PBiCG;
smoother GaussSeidel;
//preconditioner DILU;
//tolerance 1e-05 - 1e-08 depending on
//-What is the desired goal and accuracy requirement?
//-What level of convergence is possible?
tolerance 1e-08;
relTol 0.1; //0
nSweeps 1;
}
omega
{
solver smoothSolver; //PBiCG;
smoother GaussSeidel;
//preconditioner DILU;
//tolerance 1e-05 - 1e-08 depending on
//-What is the desired goal and accuracy requirement?
//-What level of convergence is possible?
tolerance 1e-08;
relTol 0.1; //0
nSweeps 1;
}
pFinal
{
$p;
relTol 0;
}
"(U|k|omega)Final"
{
$U;
relTol 0;
}
}
SIMPLE
{
nNonOrthogonalCorrectors 0; //10
}
potentialFlow
{
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
fields
{
p 0.3;
}
equations
{
U 0.7;
k 0.7;
omega 0.7;
}
}
cache
{
grad(U);
}
PIMPLE
{
nNonOrthogonalCorrectors 0;
nCorrectors 2;
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 3; //3,10
pRefCell 0;
pRefValue 0;
}
|