Thermodynamics: Initialized dpdt to 0 and added a switch on update

so that the effect of the term on the enthalpy equation is optional
This commit is contained in:
Henry 2012-09-13 11:25:55 +01:00
parent 5e9303103a
commit 8609c83645
39 changed files with 247 additions and 2059 deletions

View File

@ -60,7 +60,17 @@
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -70,4 +70,7 @@ U = HbyA - (invA & (betav*fvc::grad(p)));
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -61,7 +61,17 @@
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -70,4 +70,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -55,7 +55,17 @@
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -64,4 +64,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -85,7 +85,17 @@
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -52,4 +52,7 @@ p = p_rgh + rho*gh;
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -62,7 +62,17 @@ reaction->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -70,4 +70,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -64,7 +64,17 @@ reaction->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -89,5 +89,8 @@
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
}

View File

@ -55,7 +55,17 @@
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -94,4 +94,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -102,7 +102,10 @@ U = HbyA - rAtU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
// Recalculate density from the relaxed pressure
rho = thermo.rho();

View File

@ -96,4 +96,7 @@ U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -75,7 +75,17 @@
p_rgh = p - rho*gh;
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -61,7 +61,10 @@
// Second part of thermodynamic density update
thermo.rho() += psi*p_rgh;
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"

View File

@ -175,8 +175,19 @@
i,
new volScalarField
(
"dpdt",
fvc::ddt(thermoFluid[i].p())
IOobject
(
"dpdt",
runTime.timeName(),
fluidRegions[i]
),
fluidRegions[i],
dimensionedScalar
(
"dpdt",
thermoFluid[i].p().dimensions()/dimTime,
0
)
)
);
@ -194,5 +205,3 @@
new porousZones(fluidRegions[i])
);
}

View File

@ -74,8 +74,11 @@
p = p_rgh + rho*gh;
// Update pressure time derivative
dpdt = fvc::ddt(p);
// Update pressure time derivative if needed
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
// Solve continuity
#include "rhoEqn.H"

View File

@ -56,6 +56,8 @@ porousU -= rAUPorous*fvc::grad(porousP);
porousU.correctBoundaryConditions();
porousK = 0.5*magSqr(porousU);
// Update pressure time derivative
porousdpdt = fvc::ddt(porousP);
// Update pressure time derivative if needed
if (porousThermo.dpdt())
{
porousdpdt = fvc::ddt(porousP);
}

View File

@ -111,7 +111,17 @@
combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -82,4 +82,7 @@ sources.correct(U);
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -95,7 +95,17 @@
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -59,5 +59,8 @@
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
}

View File

@ -65,7 +65,17 @@
combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -49,4 +49,7 @@ p = p_rgh + rho*gh;
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -72,7 +72,17 @@
combustion->setTurbulence(turbulence());
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));

View File

@ -77,4 +77,7 @@ U.correctBoundaryConditions();
sources.correct(U);
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -77,4 +77,7 @@ U.correctBoundaryConditions();
sources.correct(U);
K = 0.5*magSqr(U);
dpdt = fvc::ddt(p);
if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}

View File

@ -374,7 +374,17 @@
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K1("K1", 0.5*magSqr(U1));

View File

@ -180,5 +180,8 @@
K1 = 0.5*magSqr(U1);
K2 = 0.5*magSqr(U2);
dpdt = fvc::ddt(p);
//***HGW if (thermo.dpdt())
{
dpdt = fvc::ddt(p);
}
}

View File

@ -89,9 +89,10 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh)
),
mesh,
dimensionSet(1, -1, -1, 0, 0)
)
{}
),
dpdt_(lookupOrDefault<Switch>("dpdt", true))
{}
Foam::basicThermo::basicThermo

View File

@ -70,6 +70,8 @@ protected:
//- Laminar thermal diffusuvity [kg/m/s]
volScalarField alpha_;
//- Should the dpdt term be included in the enthalpy equation
Switch dpdt_;
//- Construct as copy (not implemented)
basicThermo(const basicThermo&);
@ -120,6 +122,12 @@ public:
// i.e. rho = const
virtual bool isochoric() const = 0;
//- Should the dpdt term be included in the enthalpy equation
Switch dpdt() const
{
return dpdt_;
}
// Access to thermodynamic state variables

View File

@ -25,7 +25,7 @@ Class
Foam::heThermo
Description
Enthalpy/Internal energy for a mixture based on compressibility
Enthalpy/Internal energy for a mixture
SourceFiles
heThermo.C

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -25,11 +24,11 @@ boundaryField
{
type zeroGradient;
}
empty
{
type empty;
}
}
// ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
location "0";
object magU;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -32,5 +31,4 @@ boundaryField
}
}
// ************************************************************************* //

File diff suppressed because it is too large Load Diff