Switching to rothalpy equation for compressible MRF

This commit is contained in:
Hrvoje Jasak 2014-08-14 19:18:48 +01:00
parent ffb866bb9a
commit fcc4b2b305
25 changed files with 220 additions and 6495 deletions

View file

@ -56,3 +56,40 @@
// Create MRF zones // Create MRF zones
MRFZones mrfZones(mesh); MRFZones mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U); mrfZones.correctBoundaryVelocity(U);
// Create relative velocity
volVectorField Urel
(
IOobject
(
"Urel",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
U
);
mrfZones.relativeVelocity(Urel);
// Create rotational velocity (= omega x r)
volVectorField Urot
(
"Urot",
U - Urel
);
// Create rothalpy, in two steps to preserve boundary conditions
volScalarField i
(
IOobject
(
"i",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
h
);
i -= 0.5*magSqr(Urot);

View file

@ -65,7 +65,9 @@ int main(int argc, char *argv[])
# include "initConvergenceCheck.H" # include "initConvergenceCheck.H"
# include "UEqn.H" # include "UEqn.H"
# include "hEqn.H" // # include "hEqn.H"
// Solving for rothalpy
# include "iEqn.H"
# include "pEqn.H" # include "pEqn.H"
# include "rhoFromP.H" # include "rhoFromP.H"

View file

@ -22,24 +22,19 @@ boundaryField
{ {
inlet inlet
{ {
type fixedValue; type totalTemperature;
phi phi;
rho none;
psi psi;
U U;
gamma 1.4;
T0 uniform 300;
value $internalField; value $internalField;
} }
outlet outlet
{ {
// type zeroGradient; type zeroGradient;
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U U;
gamma 1.4;
inletOutlet true;
correctSupercritical false;
lInf 0.0;
fieldInf 300;
value $internalField; value $internalField;
} }

View file

@ -16,34 +16,21 @@ FoamFile
dimensions [0 1 -1 0 0 0 0]; dimensions [0 1 -1 0 0 0 0];
internalField uniform (234 0 0); internalField uniform (100 0 0);
boundaryField boundaryField
{ {
inlet inlet
{ {
type fixedValue; type pressureInletVelocity;
value uniform (234 0 0); value uniform (100 0 0);
} }
outlet outlet
{ {
// type zeroGradient;
type inletOutlet; type inletOutlet;
inletValue uniform (0 0 0); inletValue uniform (0 0 0);
value $internalField;
// type waveTransmissive;
// phi phi;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet true;
// correctSupercritical false;
// lInf 0;
// fieldInf (0 0 0);
// value $internalField;
} }
bladeRotor bladeRotor

View file

@ -70,7 +70,6 @@ boundaryField
frontAndBack frontAndBack
{ {
type cyclic; type cyclic;
value uniform 0;
} }
} }

View file

@ -82,7 +82,6 @@ boundaryField
frontAndBack frontAndBack
{ {
type cyclic; type cyclic;
value uniform 0;
} }
} }

View file

@ -22,36 +22,20 @@ boundaryField
{ {
inlet inlet
{ {
type zeroGradient; type totalPressure;
phi phi;
// type waveTransmissiveInlet; rho none;
// phi phi; psi psi;
// rho rho; U U;
// psi psi; gamma 1.4;
// U U; p0 uniform 1.4e5;
// gamma 1.4; value $internalField;
// inletOutlet false;
// correctSupercritical false;
// lInf 0.0;
// fieldInf 101325;
// value uniform 101325;
} }
outlet outlet
{ {
// type fixedValue; type fixedValue;
value $internalField;
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U U;
gamma 1.4;
inletOutlet false;
correctSupercritical true;
lInf 0.1;
fieldInf 101325;
value uniform 101325;
} }
bladeRotor bladeRotor

View file

@ -22,9 +22,10 @@ FoamFile
nonRotatingPatches (); nonRotatingPatches ();
origin origin [0 1 0 0 0 0 0] (0 0 0); origin origin [0 1 0 0 0 0 0] (0 0 0);
axis axis [0 0 0 0 0 0 0] (-1 0 0); axis axis [0 0 0 0 0 0 0] (1 0 0);
// omega omega [0 0 -1 0 0 0 0] 5231.25; // omega omega [0 0 -1 0 0 0 0] 5231.25; // 50k rpm, Utip = 261 m/s
omega omega [0 0 -1 0 0 0 0] 1000; omega omega [0 0 -1 0 0 0 0] 2094.395; // 20k rpm, Utip = 100 m/s
// omega omega [0 0 -1 0 0 0 0] 523.125; // 5k rpm, utip = 25.1 m/s
} }
) )

View file

@ -20,16 +20,4 @@ turbulence on;
printCoeffs on; printCoeffs on;
laminarCoeffs
{}
kEpsilonCoeffs
{}
wallFunctionCoeffs
{
kappa 0.4187;
E 9;
}
// ************************************************************************* // // ************************************************************************* //

View file

@ -20,7 +20,7 @@ startTime 0;
stopAt endTime; stopAt endTime;
endTime 2000; endTime 5000;
deltaT 1; deltaT 1;

View file

@ -0,0 +1,27 @@
/*--------------------------------*- C++-*-----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 1.7;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
distributed no;
roots
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -19,7 +19,7 @@ ddtSchemes
default none; default none;
ddt(rho,U) steadyState; ddt(rho,U) steadyState;
ddt(rho,h) steadyInertial phi rho 0.25; ddt(rho,i) steadyState;
ddt(psi,p) steadyInertial phi rho 0.25; ddt(psi,p) steadyInertial phi rho 0.25;
ddt(rho,k) steadyState; ddt(rho,k) steadyState;
@ -39,7 +39,7 @@ divSchemes
{ {
default none; default none;
div(phi,U) Gauss upwind; div(phi,U) Gauss upwind;
div(phi,h) Gauss upwind; div(phi,i) Gauss upwind;
div(phid,p) Gauss upwind; div(phid,p) Gauss upwind;
// div(phi,U) Gauss vanLeerDC; // div(phi,U) Gauss vanLeerDC;

View file

@ -35,8 +35,8 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.01;
}; }
h i
{ {
solver BiCGStab; solver BiCGStab;
preconditioner DILU; preconditioner DILU;
@ -45,7 +45,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.01;
}; }
k k
{ {
solver BiCGStab; solver BiCGStab;
@ -55,7 +55,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.0; relTol 0.0;
}; }
epsilon epsilon
{ {
solver BiCGStab; solver BiCGStab;
@ -65,7 +65,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.0; relTol 0.0;
}; }
} }
PIMPLE PIMPLE
@ -79,9 +79,10 @@ relaxationFactors
{ {
// Note: under-relaxation factors used in wave-transmissive schemes // Note: under-relaxation factors used in wave-transmissive schemes
U 0.5; U 0.5;
p 1; p 0.2;
i 0.1;
h 0.5; h 0.5;
rho 0.5; rho 0.25;
k 0.2; k 0.2;
epsilon 0.2; epsilon 0.2;
@ -95,9 +96,9 @@ fieldBounds
// U 1e6; // U 1e6;
// With bounding // With bounding
p 50 1e6; p 2e4 1e6;
T 20 3000; T 200 500;
U 1000; U 500;
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -22,24 +22,19 @@ boundaryField
{ {
inlet inlet
{ {
type fixedValue; type totalTemperature;
phi phi;
rho none;
psi psi;
U U;
gamma 1.4;
T0 uniform 300;
value $internalField; value $internalField;
} }
outlet outlet
{ {
// type zeroGradient; type zeroGradient;
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U U;
gamma 1.4;
inletOutlet true;
correctSupercritical false;
lInf 0.0;
fieldInf 300;
value $internalField; value $internalField;
} }

View file

@ -16,32 +16,21 @@ FoamFile
dimensions [0 1 -1 0 0 0 0]; dimensions [0 1 -1 0 0 0 0];
internalField uniform (234 0 0); internalField uniform (100 0 0);
boundaryField boundaryField
{ {
inlet inlet
{ {
type fixedValue; type pressureInletVelocity;
value uniform (234 0 0); value uniform (100 0 0);
} }
outlet outlet
{ {
type inletOutlet; type inletOutlet;
inletValue uniform (0 0 0); inletValue uniform (0 0 0);
value $internalField;
// type waveTransmissive;
// phi phi;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet true;
// correctSupercritical false;
// lInf 0;
// fieldInf (0 0 0);
// value $internalField;
} }
bladeRotor bladeRotor

View file

@ -17,47 +17,67 @@ FoamFile
dimensions [1 -1 -1 0 0 0 0]; dimensions [1 -1 -1 0 0 0 0];
internalField uniform 1; internalField uniform 0;
boundaryField boundaryField
{ {
inlet inlet
{ {
type calculated; type calculated;
value uniform 0;
} }
outlet outlet
{ {
type calculated; type calculated;
value uniform 0;
} }
bladeRotor bladeRotor
{ {
type mutWallFunction; type mutWallFunction;
value uniform 1; Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
} }
shaftRotor shaftRotor
{ {
type mutWallFunction; type mutWallFunction;
value uniform 1; Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
} }
shroudRotor shroudRotor
{ {
type mutWallFunction; type mutWallFunction;
value uniform 1; Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
} }
bladeStator bladeStator
{ {
type mutWallFunction; type mutWallFunction;
value uniform 1; Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
} }
shaftStator shaftStator
{ {
type mutWallFunction; type mutWallFunction;
value uniform 1; Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
} }
shroudStator shroudStator
{ {
type mutWallFunction; type mutWallFunction;
value uniform 1; Cmu 0.09;
kappa 0.41;
E 9.8;
value uniform 0;
} }
frontAndBack frontAndBack
{ {

View file

@ -22,35 +22,19 @@ boundaryField
{ {
inlet inlet
{ {
type zeroGradient; type totalPressure;
phi phi;
// type waveTransmissiveInlet; rho none;
// phi phi; psi psi;
// rho rho; U U;
// psi psi; gamma 1.4;
// U U; p0 uniform 1.4e5;
// gamma 1.4; value $internalField;
// inletOutlet false;
// correctSupercritical false;
// lInf 0.0;
// fieldInf 101325;
// value $internalField;
} }
outlet outlet
{ {
// type fixedValue; type fixedValue;
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U U;
gamma 1.4;
inletOutlet false;
correctSupercritical true;
lInf 0.1;
fieldInf 101325;
value $internalField; value $internalField;
} }

View file

@ -23,7 +23,9 @@ FoamFile
origin origin [0 1 0 0 0 0 0] (0 0 0); origin origin [0 1 0 0 0 0 0] (0 0 0);
axis axis [0 0 0 0 0 0 0] (1 0 0); axis axis [0 0 0 0 0 0 0] (1 0 0);
omega omega [0 0 -1 0 0 0 0] 5231.25; // omega omega [0 0 -1 0 0 0 0] 5231.25; // 50k rpm, Utip = 261 m/s
omega omega [0 0 -1 0 0 0 0] 2094.395; // 20k rpm, Utip = 100 m/s
// omega omega [0 0 -1 0 0 0 0] 523.125; // 5k rpm, utip = 25.1 m/s
} }
) )

View file

@ -14,13 +14,14 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
startFrom startTime; startFrom latestTime;
// startFrom startTime;
startTime 0; startTime 0;
stopAt endTime; stopAt endTime;
endTime 2000; endTime 5000;
deltaT 1; deltaT 1;

View file

@ -0,0 +1,27 @@
/*--------------------------------*- C++-*-----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 1.7;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method scotch;
distributed no;
roots
(
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -19,7 +19,7 @@ ddtSchemes
default none; default none;
ddt(rho,U) steadyState; ddt(rho,U) steadyState;
ddt(rho,h) steadyInertial phi rho 0.25; ddt(rho,i) steadyState;
ddt(psi,p) steadyInertial phi rho 0.25; ddt(psi,p) steadyInertial phi rho 0.25;
ddt(rho,k) steadyState; ddt(rho,k) steadyState;
@ -39,7 +39,7 @@ divSchemes
{ {
default none; default none;
div(phi,U) Gauss upwind; div(phi,U) Gauss upwind;
div(phi,h) Gauss upwind; div(phi,i) Gauss upwind;
div(phid,p) Gauss upwind; div(phid,p) Gauss upwind;
// div(phi,U) Gauss vanLeerDC; // div(phi,U) Gauss vanLeerDC;

View file

@ -35,8 +35,8 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.01;
}; }
h i
{ {
solver BiCGStab; solver BiCGStab;
preconditioner DILU; preconditioner DILU;
@ -45,7 +45,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.01;
}; }
k k
{ {
solver BiCGStab; solver BiCGStab;
@ -55,7 +55,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.0; relTol 0.0;
}; }
epsilon epsilon
{ {
solver BiCGStab; solver BiCGStab;
@ -65,7 +65,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.0; relTol 0.0;
}; }
} }
PIMPLE PIMPLE
@ -79,9 +79,10 @@ relaxationFactors
{ {
// Note: under-relaxation factors used in wave-transmissive schemes // Note: under-relaxation factors used in wave-transmissive schemes
U 0.5; U 0.5;
p 1; p 0.2;
i 0.1;
h 0.5; h 0.5;
rho 0.5; rho 0.25;
k 0.2; k 0.2;
epsilon 0.2; epsilon 0.2;
@ -95,9 +96,9 @@ fieldBounds
// U 1e6; // U 1e6;
// With bounding // With bounding
p 50 1e6; p 2e4 1e6;
T 20 3000; T 200 500;
U 1000; U 500;
} }
// ************************************************************************* // // ************************************************************************* //