Commit 04c3d535 authored by Andrew Heather's avatar Andrew Heather
Browse files

MRG: Integrated Foundation code to commit 47bd8e13

parents 68851ce4 47bd8e13
runTime.write();
Info<< "Sh = " << Sh
Info<< "Qdot = " << Qdot
<< ", T = " << thermo.T()[0]
<< ", p = " << thermo.p()[0]
<< ", " << Y[0].name() << " = " << Y[0][0]
......@@ -8,4 +8,3 @@
post<< runTime.value() << token::TAB << thermo.T()[0] << token::TAB
<< thermo.p()[0] << endl;
dtChem = chemistry.solve(runTime.deltaT().value());
scalar Sh = chemistry.Sh()()[0]/rho[0];
integratedHeat += Sh*runTime.deltaT().value();
dtChem = chemistry.solve(runTime.deltaT().value());
scalar Qdot = chemistry.Qdot()()[0]/rho[0];
integratedHeat += Qdot*runTime.deltaT().value();
......@@ -10,7 +10,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
);
{
combustion->correct();
dQ = combustion->dQ();
Qdot = combustion->Qdot();
volScalarField Yt(0.0*Y[0]);
forAll(Y, i)
......@@ -67,7 +67,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
)
- fvm::laplacian(turbulence->alphaEff(), he)
==
combustion->Sh()
Qdot
+ radiation->Sh(thermo)
+ parcels.Sh(he)
+ surfaceFilm.Sh()
......
......@@ -131,18 +131,18 @@ Switch solvePyrolysisRegion
additionalControlsDict.lookupOrDefault<bool>("solvePyrolysisRegion", true)
);
volScalarField dQ
volScalarField Qdot
(
IOobject
(
"dQ",
"Qdot",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
);
......
......@@ -17,7 +17,7 @@
)
- fvm::laplacian(turbulence->alphaEff(), he)
==
reaction->Sh()
Qdot
+ fvOptions(rho, he)
);
......
......@@ -11,7 +11,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
{
reaction->correct();
dQ = reaction->dQ();
Qdot = reaction->Qdot();
volScalarField Yt(0.0*Y[0]);
forAll(Y, i)
......
......@@ -117,18 +117,18 @@ forAll(Y, i)
}
fields.add(thermo.he());
volScalarField dQ
volScalarField Qdot
(
IOobject
(
"dQ",
"Qdot",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
);
#include "createMRF.H"
......@@ -117,18 +117,18 @@ forAll(Y, i)
}
fields.add(thermo.he());
volScalarField dQ
volScalarField Qdot
(
IOobject
(
"dQ",
"Qdot",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
);
#include "createMRF.H"
......@@ -96,18 +96,18 @@ forAll(Y, i)
}
fields.add(thermo.he());
volScalarField dQ
volScalarField Qdot
(
IOobject
(
"dQ",
"Qdot",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
);
#include "createMRF.H"
......@@ -43,13 +43,16 @@ License
// Damping coefficient (1-0)
scalar rDeltaTDampingCoeff
(
pimpleDict.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1)
pimpleDict.lookupOrDefault<scalar>("rDeltaTDampingCoeff", 1.0)
);
// Maximum change in cell temperature per iteration
// (relative to previous value)
scalar alphaTemp(pimpleDict.lookupOrDefault("alphaTemp", 0.05));
// Maximum change in cell concentration per iteration
// (relative to reference value)
scalar alphaY(pimpleDict.lookupOrDefault("alphaY", 1.0));
Info<< "Time scales min/max:" << endl;
......@@ -68,34 +71,89 @@ License
rDeltaT.max(1/maxDeltaT);
Info<< " Flow = "
<< gMin(1/rDeltaT.primitiveField()) << ", "
<< gMax(1/rDeltaT.primitiveField()) << endl;
<< 1/gMax(rDeltaT.primitiveField()) << ", "
<< 1/gMin(rDeltaT.primitiveField()) << endl;
}
// Reaction source time scale
if (alphaTemp < 1.0)
// Heat release rate time scale
if (alphaTemp < 1)
{
volScalarField::Internal rDeltaTT
(
mag(reaction->Sh())/(alphaTemp*rho*thermo.Cp()*T)
mag(Qdot)/(alphaTemp*rho*thermo.Cp()*T)
);
Info<< " Temperature = "
<< gMin(1/(rDeltaTT.field() + VSMALL)) << ", "
<< gMax(1/(rDeltaTT.field() + VSMALL)) << endl;
<< 1/(gMax(rDeltaTT.field()) + VSMALL) << ", "
<< 1/(gMin(rDeltaTT.field()) + VSMALL) << endl;
rDeltaT.ref() = max
rDeltaT.ref() = max(rDeltaT(), rDeltaTT);
}
// Reaction rate time scale
if (alphaY < 1)
{
dictionary Yref(pimpleDict.subDict("Yref"));
volScalarField::Internal rDeltaTY
(
rDeltaT(),
rDeltaTT
IOobject
(
"rDeltaTY",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("rDeltaTY", rDeltaT.dimensions(), 0)
);
bool foundY = false;
forAll(Y, i)
{
if (i != inertIndex && composition.active(i))
{
volScalarField& Yi = Y[i];
if (Yref.found(Yi.name()))
{
foundY = true;
scalar Yrefi = readScalar(Yref.lookup(Yi.name()));
rDeltaTY.field() = max
(
mag
(
reaction->R(Yi)().source()
/((Yrefi*alphaY)*(rho*mesh.V()))
),
rDeltaTY
);
}
}
}
if (foundY)
{
Info<< " Composition = "
<< 1/(gMax(rDeltaTY.field()) + VSMALL) << ", "
<< 1/(gMin(rDeltaTY.field()) + VSMALL) << endl;
rDeltaT.ref() = max(rDeltaT(), rDeltaTY);
}
else
{
IOWarningIn(args.executable().c_str(), Yref)
<< "Cannot find any active species in Yref " << Yref
<< endl;
}
}
// Update tho boundary values of the reciprocal time-step
rDeltaT.correctBoundaryConditions();
// Spatially smooth the time scale field
if (rDeltaTSmoothingCoeff < 1.0)
if (rDeltaTSmoothingCoeff < 1)
{
fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
}
......@@ -105,7 +163,7 @@ License
// - only increase at a fraction of old time scale
if
(
rDeltaTDampingCoeff < 1.0
rDeltaTDampingCoeff < 1
&& runTime.timeIndex() > runTime.startTimeIndex() + 1
)
{
......@@ -120,8 +178,8 @@ License
rDeltaT.correctBoundaryConditions();
Info<< " Overall = "
<< gMin(1/rDeltaT.primitiveField())
<< ", " << gMax(1/rDeltaT.primitiveField()) << endl;
<< 1/gMax(rDeltaT.primitiveField())
<< ", " << 1/gMin(rDeltaT.primitiveField()) << endl;
}
......
......@@ -18,7 +18,7 @@
- fvm::laplacian(turbulence->alphaEff(), he)
==
rho*(U&g)
+ combustion->Sh()
+ Qdot
+ coalParcels.Sh(he)
+ limestoneParcels.Sh(he)
+ radiation->Sh(thermo)
......
......@@ -12,7 +12,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
{
combustion->correct();
dQ = combustion->dQ();
Qdot = combustion->Qdot();
volScalarField Yt(0.0*Y[0]);
forAll(Y, i)
......
......@@ -131,18 +131,18 @@ volScalarField dpdt
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
volScalarField dQ
volScalarField Qdot
(
IOobject
(
"dQ",
"Qdot",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
);
#include "createMRF.H"
......
......@@ -80,7 +80,7 @@ License
(
(coalParcels.hsTrans() + limestoneParcels.hsTrans())
/(mesh.V()*runTime.deltaT())
+ combustion->Sh()()
+ Qdot
)
/(
alphaTemp
......
......@@ -21,7 +21,7 @@
+ parcels.Sh(he)
+ surfaceFilm.Sh()
+ radiation->Sh(thermo)
+ combustion->Sh()
+ Qdot
+ fvOptions(rho, he)
);
......
......@@ -12,7 +12,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
{
combustion->correct();
dQ = combustion->dQ();
Qdot = combustion->Qdot();
volScalarField Yt(0.0*Y[0]);
forAll(Y, i)
......
......@@ -134,18 +134,18 @@ Switch solvePrimaryRegion
additionalControlsDict.lookup("solvePrimaryRegion")
);
volScalarField dQ
volScalarField Qdot
(
IOobject
(
"dQ",
"Qdot",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
);
#include "createMRF.H"
......
......@@ -20,7 +20,7 @@
rho*(U&g)
+ parcels.Sh(he)
+ radiation->Sh(thermo)
+ combustion->Sh()
+ Qdot
+ fvOptions(rho, he)
);
......
......@@ -11,7 +11,7 @@ tmp<fv::convectionScheme<scalar>> mvConvection
{
combustion->correct();
dQ = combustion->dQ();
Qdot = combustion->Qdot();
volScalarField Yt(0.0*Y[0]);
forAll(Y, i)
......
......@@ -121,18 +121,18 @@ forAll(Y, i)
}
fields.add(thermo.he());
volScalarField dQ
volScalarField Qdot
(
IOobject
(
"dQ",
"Qdot",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
dimensionedScalar("Qdot", dimEnergy/dimVolume/dimTime, 0.0)
);
#include "createMRF.H"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment