【OpenFOAM】学习module1-02
of9
1
case:$PTOFC/101OF/3d_damBreak
0
├── alpha.water
├── epsilon
├── k
├── nut
├── p_rgh
└── U
0/U
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
front
{
type fixedValue;
value uniform (0 0 0);
}
back
{
type fixedValue;
value uniform (0 0 0);
}
left
{
type fixedValue;
value uniform (0 0 0);
}
right
{
type fixedValue;#noSlip;
value uniform (0 0 0);
}
bottom
{
type fixedValue;
value uniform (0 0 0);
}
top
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
}
stlSurface
{
type fixedValue;
value uniform (0 0 0);
}
}
constant/momentumTransport
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object momentumTransport;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS; //laminar
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //
system/controlDict
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application interFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 8;
deltaT 0.0001;
writeControl adjustableRunTime;
writeInterval 0.02;
purgeWrite 0;#3,只存最后三个步长
writeFormat ascii;
writePrecision 8;
writeCompression uncompressed;#不压缩
timeFormat general;
timePrecision 8;
runTimeModifiable yes;
adjustTimeStep yes;
maxCo 1.0;
maxAlphaCo 0.5;
maxDeltaT 0.01;
// ************************************************************************* //
functions
{
///
/*
//OF8
minmaxdomain
{
type fieldMinMax;
functionObjectLibs ("libfieldFunctionObjects.so");
enabled true; //true or false
mode component;
writeControl timeStep;
writeInterval 1;
log true;
fields (p p_rgh U alpha.water k epsilon);
}
*/
minmaxdomain_scalar
{
type volFieldValue;
libs ("libfieldFunctionObjects.so");
enabled true; //true or false
log true; //write to screen
//writeControl writeTime;
writeControl timeStep;
writeInterval 1;
writeFields false; //write solution to field value - Not needed when only reporting value to screen
writeLocation true; //write location in the output file
//mode component;
regionType all;
operation none;
fields
(
p
p_rgh
alpha.water
k
epsilon
);
}
minmaxdomain_vector
{
type volFieldValue;
libs ("libfieldFunctionObjects.so");
enabled true; //true or false
log true; //write to screen
//writeControl writeTime;
writeControl timeStep;
writeInterval 1;
writeFields false; //write solution to field value - Not needed when only reporting value to screen
writeLocation true; //write location in the output file
//mode component;
regionType all;
operation none;
fields
(
U
);
}
mindomain_scalar
{
$minmaxdomain_scalar
operation min;
}
mindomain_vector
{
$minmaxdomain_vector
operation minMag;
}
maxdomain_scalar
{
$minmaxdomain_scalar
operation max;
}
maxdomain_vector
{
$minmaxdomain_vector
operation maxMag;
}
///
///
water_in_domain
{
type volFieldValue;
functionObjectLibs ("libfieldFunctionObjects.so");
enabled true;
log true;
//writeControl writeTime;
writeControl timeStep;
writeInterval 1;
writeFields false;
writeLocation false;
regionType all;
operation volIntegrate;
fields
(
alpha.water
);
}
///
///
probes1
{
type probes;
functionObjectLibs ("libsampling.so");
//dictionary probesDict;
probeLocations
(
(0.82450002 0 0.021)
(0.82450002 0 0.061)
(0.82450002 0 0.101)
(0.82450002 0 0.141)
(0.8035 0 0.161)
(0.7635 0 0.161)
(0.7235 0 0.161)
(0.6835 0 0.161)
);
fields
(
p p_rgh
);
writeControl timeStep;
writeInterval 1;
}
///
///
yplus
{
type yPlus;
functionObjectLibs ("libfieldFunctionObjects.so");
enabled true;
writeControl outputTime;
}
///
};
system/fvSolution
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"alpha.water.*"
{
nAlphaCorr 2;
nAlphaSubCycles 1;
cAlpha 1;
MULESCorr yes;
nLimiterIter 10;
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
"(pcorr|pcorrFinal)"
{
solver PCG;
preconditioner DIC;
tolerance 1e-8;
relTol 0;
}
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.01;
minIter 2;
}
p_rghFinal
{
$p_rgh;
//tolerance 1e-08;
relTol 0;
minIter 2;
}
"(U|UFinal)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
"(k|epsilon).*"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-08;
relTol 0;
}
}
PIMPLE
{
consistent yes;
momentumPredictor yes;
nOuterCorrectors 1;
nCorrectors 3;
nNonOrthogonalCorrectors 1;
}
relaxationFactors
{
fields
{
".*" 0.9;
}
equations
{
".*" 0.9;
}
}
// ************************************************************************* //
system/fvScheme
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 9
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(U) cellLimited Gauss linear 1;#除了U,其他使用默认 Gauss linear
}
divSchemes
{
div(rhoPhi,U) Gauss linearUpwindV grad(U);
div(phi,alpha) Gauss interfaceCompression vanLeer 1;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //