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
MRFZones mrfZones(mesh);
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

@ -13,7 +13,7 @@
// Note: potential issue with reconstructed relative velocity.
// HJ, 12/Dec/2009
// fvc::div(faceU, p, "div(U,p)")
fvc::div(faceU + mrfZones.fluxCorrection(), p,"div(U,p)")
fvc::div(faceU + mrfZones.fluxCorrection(), p, "div(U,p)")
- p*fvc::div(faceU)
// Viscous heating: note sign (devRhoReff has a minus in it)
- (turbulence->devRhoReff() && fvc::grad(U))

View file

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

View file

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

View file

@ -16,34 +16,21 @@ FoamFile
dimensions [0 1 -1 0 0 0 0];
internalField uniform (234 0 0);
internalField uniform (100 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (234 0 0);
type pressureInletVelocity;
value uniform (100 0 0);
}
outlet
{
// type zeroGradient;
type inletOutlet;
inletValue uniform (0 0 0);
// 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;
value $internalField;
}
bladeRotor

View file

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

View file

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

View file

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

View file

@ -22,9 +22,10 @@ FoamFile
nonRotatingPatches ();
origin origin [0 1 0 0 0 0 0] (0 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] 1000;
axis axis [0 0 0 0 0 0 0] (1 0 0);
// 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

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

View file

@ -20,7 +20,7 @@ startTime 0;
stopAt endTime;
endTime 2000;
endTime 5000;
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;
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(rho,k) steadyState;
@ -39,7 +39,7 @@ divSchemes
{
default none;
div(phi,U) Gauss upwind;
div(phi,h) Gauss upwind;
div(phi,i) Gauss upwind;
div(phid,p) Gauss upwind;
// div(phi,U) Gauss vanLeerDC;

View file

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

View file

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

View file

@ -16,32 +16,21 @@ FoamFile
dimensions [0 1 -1 0 0 0 0];
internalField uniform (234 0 0);
internalField uniform (100 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (234 0 0);
type pressureInletVelocity;
value uniform (100 0 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
// 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;
value $internalField;
}
bladeRotor

View file

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

View file

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

View file

@ -23,7 +23,9 @@ FoamFile
origin origin [0 1 0 0 0 0 0] (0 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;
stopAt endTime;
endTime 2000;
endTime 5000;
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;
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(rho,k) steadyState;
@ -39,7 +39,7 @@ divSchemes
{
default none;
div(phi,U) Gauss upwind;
div(phi,h) Gauss upwind;
div(phi,i) Gauss upwind;
div(phid,p) Gauss upwind;
// div(phi,U) Gauss vanLeerDC;

View file

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