mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
TUT: nonOrthogonalChannel/skewnessCavity: migrate under verificationAndValidation
TUT: nonOrthogonalChannel: refactor productionRate computation (fixes #2285)
This commit is contained in:
committed by
Andrew Heather
parent
4c2728a45c
commit
beea7ba62f
@ -0,0 +1,138 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application simpleFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 50000;
|
||||
|
||||
deltaT 1;
|
||||
|
||||
writeControl timeStep;
|
||||
|
||||
writeInterval 50000;
|
||||
|
||||
purgeWrite 1;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 16;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 8;
|
||||
|
||||
runTimeModifiable false;
|
||||
|
||||
functions
|
||||
{
|
||||
fieldMinMax1
|
||||
{
|
||||
type fieldMinMax;
|
||||
libs (fieldFunctionObjects);
|
||||
writeToFile no;
|
||||
log yes;
|
||||
location yes;
|
||||
mode magnitude;
|
||||
fields ( p U );
|
||||
}
|
||||
|
||||
wallShearStress1
|
||||
{
|
||||
type wallShearStress;
|
||||
libs (fieldFunctionObjects);
|
||||
patches ( bottom );
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
}
|
||||
|
||||
yPlus1
|
||||
{
|
||||
type yPlus;
|
||||
libs (fieldFunctionObjects);
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
}
|
||||
|
||||
writeCellCentres1
|
||||
{
|
||||
type writeCellCentres;
|
||||
libs (fieldFunctionObjects);
|
||||
executeControl onEnd;
|
||||
writeControl onEnd;
|
||||
}
|
||||
|
||||
turbulenceFields1
|
||||
{
|
||||
type turbulenceFields;
|
||||
libs (fieldFunctionObjects);
|
||||
fields ( k epsilon R );
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
}
|
||||
|
||||
productionRate1
|
||||
{
|
||||
type coded;
|
||||
libs (utilityFunctionObjects);
|
||||
name productionRate;
|
||||
writeControl writeTime;
|
||||
|
||||
codeExecute
|
||||
#{
|
||||
auto* prodPtr =
|
||||
mesh().getObjectPtr<volScalarField>("productionRate");
|
||||
|
||||
if (!prodPtr)
|
||||
{
|
||||
Info<< "Create production rate field" << nl;
|
||||
prodPtr = new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"productionRate",
|
||||
mesh().time().timeName(),
|
||||
mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh(),
|
||||
sqr(dimLength)/pow3(dimTime)
|
||||
);
|
||||
|
||||
regIOobject::store(prodPtr);
|
||||
}
|
||||
auto& prod = *prodPtr;
|
||||
|
||||
Info<< "Computing production rate field\n" << endl;
|
||||
|
||||
const auto& nut = mesh().lookupObject<volScalarField>("nut");
|
||||
const auto& U = mesh().lookupObject<volVectorField>("U");
|
||||
|
||||
prod = 2*nut*(symm(fvc::grad(U)) && symm(fvc::grad(U)));
|
||||
#};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,22 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object decomposeParDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 2;
|
||||
|
||||
method scotch;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,75 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
default steadyState;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
grad(U) cellLimited Gauss linear 1;
|
||||
grad(k) cellLimited Gauss linear 1;
|
||||
grad(omega) cellLimited Gauss linear 1;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) bounded Gauss linearUpwind grad(U);
|
||||
|
||||
turbulence bounded Gauss limitedLinear 1;
|
||||
|
||||
div(phi,k) $turbulence;
|
||||
div(phi,omega) $turbulence;
|
||||
div(phi,nuTilda) $turbulence;
|
||||
div(phi,epsilon) $turbulence;
|
||||
div(phi,phit) $turbulence;
|
||||
div(phi,f) $turbulence;
|
||||
|
||||
div((nuEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default Gauss linear limited corrected 0.33;
|
||||
laplacian((1|((1|(1|A(U)))-H(1))),p) Gauss linear limited relaxed 0.33;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default limited corrected 0.33;
|
||||
}
|
||||
|
||||
wallDist
|
||||
{
|
||||
method meshWave;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,90 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
p
|
||||
{
|
||||
solver GAMG;
|
||||
tolerance 1e-09;
|
||||
relTol 0.01;
|
||||
smoother DICGaussSeidel;
|
||||
nPreSweeps 0;
|
||||
nPostSweeps 2;
|
||||
cacheAgglomeration on;
|
||||
agglomerator faceAreaPair;
|
||||
nCellsInCoarsestLevel 10;
|
||||
mergeLevels 1;
|
||||
}
|
||||
|
||||
U
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother symGaussSeidel;
|
||||
tolerance 1e-12;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"(k|omega|nuTilda)"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother symGaussSeidel;
|
||||
tolerance 1e-09;
|
||||
relTol 0.01;
|
||||
}
|
||||
|
||||
"(epsilon|phit)"
|
||||
{
|
||||
solver PBiCGStab;
|
||||
preconditioner DILU;
|
||||
tolerance 1e-8;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
f
|
||||
{
|
||||
solver PBiCGStab;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-8;
|
||||
relTol 0;
|
||||
}
|
||||
}
|
||||
|
||||
SIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
consistent true;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
fields
|
||||
{
|
||||
"snGrad(p)" 0.5;
|
||||
}
|
||||
equations
|
||||
{
|
||||
U 0.9;
|
||||
k 0.7;
|
||||
omega 0.7;
|
||||
nuTilda 0.7;
|
||||
epsilon 0.7;
|
||||
"(phit|f)" 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,49 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object sample;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
type sets;
|
||||
libs (sampling);
|
||||
interpolationScheme cellPoint;
|
||||
setFormat raw;
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
fields
|
||||
(
|
||||
U
|
||||
turbulenceProperties:k
|
||||
turbulenceProperties:R
|
||||
);
|
||||
|
||||
sets
|
||||
(
|
||||
ref_point
|
||||
{
|
||||
type cloud;
|
||||
axis y;
|
||||
points ((0.5 1 0.5));
|
||||
}
|
||||
|
||||
y
|
||||
{
|
||||
type midPoint;
|
||||
axis y;
|
||||
start (0.5 0 0.5);
|
||||
end (0.5 1 0.5);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,40 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object sample;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
type sets;
|
||||
libs (sampling);
|
||||
interpolationScheme cellPoint;
|
||||
setFormat raw;
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
fields
|
||||
(
|
||||
turbulenceProperties:epsilon
|
||||
);
|
||||
|
||||
sets
|
||||
(
|
||||
y
|
||||
{
|
||||
type midPoint;
|
||||
axis y;
|
||||
start (0.5 0 0.5);
|
||||
end (0.5 1 0.5);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,40 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v2012 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object sample;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
type sets;
|
||||
libs (sampling);
|
||||
interpolationScheme cellPoint;
|
||||
setFormat raw;
|
||||
executeControl writeTime;
|
||||
writeControl writeTime;
|
||||
fields
|
||||
(
|
||||
productionRate
|
||||
);
|
||||
|
||||
sets
|
||||
(
|
||||
y
|
||||
{
|
||||
type midPoint;
|
||||
axis y;
|
||||
start (0.5 0 0.5);
|
||||
end (0.5 1 0.5);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user