updates + added porous zones

This commit is contained in:
andy
2009-05-26 12:01:39 +01:00
parent 48d003675a
commit 85e5abd344
4 changed files with 127 additions and 90 deletions

View File

@ -10,6 +10,37 @@
UEqn.relax(); UEqn.relax();
tmp<volScalarField> trAU;
tmp<volTensorField> trTU;
if (pressureImplicitPorosity)
{
tmp<volTensorField> tTU = tensor(I)*UEqn.A();
pZones.addResistance(UEqn, tTU());
trTU = inv(tTU());
trTU().rename("rAU");
volVectorField gradp = fvc::grad(p);
for (int UCorr=0; UCorr<nUCorr; UCorr++)
{
U = trTU() & (UEqn.H() - gradp);
}
U.correctBoundaryConditions();
}
else
{
pZones.addResistance(UEqn);
solve
(
UEqn == -fvc::grad(p)
);
trAU = 1.0/UEqn.A();
trAU().rename("rAU");
}
if (momentumPredictor) if (momentumPredictor)
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));

View File

@ -1,4 +1,4 @@
Info<< "Reading thermophysical properties\n" << endl; Info<< "Reading thermophysical properties" << nl << endl;
autoPtr<hCombustionThermo> thermo autoPtr<hCombustionThermo> thermo
( (
@ -28,52 +28,7 @@
thermo->rho() thermo->rho()
); );
// lagrangian coal density field Info<< "Reading field U" << nl << endl;
/* volScalarField rholc
(
IOobject
(
"rholc",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0, 0, 0), 0.0)
);
// lagrangian limestone density field
volScalarField rhols
(
IOobject
(
"rhols",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0, 0, 0), 0.0)
);
// lagrangian total density field
volScalarField rhol
(
IOobject
(
"rhol",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1, -3, 0, 0, 0, 0, 0), 0.0)
);*/
Info<< "\nReading field U\n" << endl;
volVectorField U volVectorField U
( (
IOobject IOobject
@ -103,7 +58,7 @@
dimensionedScalar("zero", dimless, 0.0) dimensionedScalar("zero", dimless, 0.0)
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model" << nl << endl;
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (
compressible::turbulenceModel::New compressible::turbulenceModel::New
@ -115,11 +70,11 @@
) )
); );
Info<< "Creating field DpDt\n" << endl; Info<< "Creating field DpDt" << nl << endl;
volScalarField DpDt = volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
Info << "Constructing chemical mechanism" << endl; Info << "Constructing chemical mechanism" << nl << endl;
chemistryModel chemistry chemistryModel chemistry
( (
thermo(), thermo(),
@ -134,8 +89,23 @@
} }
fields.add(h); fields.add(h);
Info<< "Creating radiation model\n" << endl; Info<< "Creating porous zones" << nl << endl;
autoPtr<radiation::radiationModel> radiation porousZones pZones(mesh);
( Switch pressureImplicitPorosity(false);
radiation::radiationModel::New(T)
); label nUCorr = 0;
if (pZones.size())
{
// nUCorrectors for pressureImplicitPorosity
if (mesh.solutionDict().subDict("PISO").found("nUCorrectors"))
{
mesh.solutionDict().subDict("PISO").lookup("nUCorrectors")
>> nUCorr;
}
if (nUCorr > 0)
{
pressureImplicitPorosity = true;
}
}

View File

@ -1,7 +1,13 @@
rho = thermo->rho(); rho = thermo->rho();
volScalarField rUA = 1.0/UEqn.A(); if (pressureImplicitPorosity)
U = rUA*UEqn.H(); {
U = trTU()&UEqn.H();
}
else
{
U = trAU()*UEqn.H();
}
if (transonic) if (transonic)
{ {
@ -11,17 +17,28 @@ if (transonic)
fvc::interpolate(thermo->psi()) fvc::interpolate(thermo->psi())
*( *(
(fvc::interpolate(U) & mesh.Sf()) (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi) // + fvc::ddtPhiCorr(rUA, rho, U, phi)
) )
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
tmp<fvScalarMatrix> lapTerm;
if (pressureImplicitPorosity)
{
lapTerm = fvm::laplacian(rho*trTU(), p);
}
else
{
lapTerm = fvm::laplacian(rho*trAU(), p);
}
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::ddt(psi, p) fvm::ddt(psi, p)
+ fvm::div(phid, p) + fvm::div(phid, p)
- fvm::laplacian(rho*rUA, p) - lapTerm()
== ==
reactingParcels.Srho() reactingParcels.Srho()
); );
@ -37,19 +54,30 @@ if (transonic)
else else
{ {
phi = phi =
fvc::interpolate(rho)* fvc::interpolate(rho)
( *(
(fvc::interpolate(U) & mesh.Sf()) (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi) + fvc::ddtPhiCorr(trAU(), rho, U, phi)
); );
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
tmp<fvScalarMatrix> lapTerm;
if (pressureImplicitPorosity)
{
lapTerm = fvm::laplacian(rho*trTU(), p);
}
else
{
lapTerm = fvm::laplacian(rho*trAU(), p);
}
fvScalarMatrix pEqn fvScalarMatrix pEqn
( (
fvm::ddt(psi, p) fvm::ddt(psi, p)
+ fvc::div(phi) + fvc::div(phi)
- fvm::laplacian(rho*rUA, p) - lapTerm()
== ==
reactingParcels.Srho() reactingParcels.Srho()
); );
@ -66,7 +94,15 @@ else
#include "rhoEqn.H" #include "rhoEqn.H"
#include "compressibleContinuityErrs.H" #include "compressibleContinuityErrs.H"
U -= rUA*fvc::grad(p); if (pressureImplicitPorosity)
{
U -= trTU()&fvc::grad(p);
}
else
{
U -= trAU()*fvc::grad(p);
}
U.correctBoundaryConditions(); U.correctBoundaryConditions();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);

View File

@ -36,6 +36,7 @@ Description
#include "chemistrySolver.H" #include "chemistrySolver.H"
#include "ReactingCloudThermoTypes.H" #include "ReactingCloudThermoTypes.H"
#include "radiationModel.H" #include "radiationModel.H"
#include "porousZones.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,6 +49,7 @@ int main(int argc, char *argv[])
#include "readChemistryProperties.H" #include "readChemistryProperties.H"
#include "readEnvironmentalProperties.H" #include "readEnvironmentalProperties.H"
#include "createFields.H" #include "createFields.H"
#include "createRadiationModel.H"
#include "createClouds.H" #include "createClouds.H"
#include "readPISOControls.H" #include "readPISOControls.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
@ -55,7 +57,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -70,8 +72,6 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
Info << "Evolving reacting cloud" << endl;
reactingParcels.evolve(); reactingParcels.evolve();
reactingParcels.info(); reactingParcels.info();