Skip to content

Commit

Permalink
ENH: chtMultiRegionFoam solvers - added option to calculate using fro…
Browse files Browse the repository at this point in the history
…zen flow
  • Loading branch information
andy committed Oct 16, 2014
1 parent f722953 commit ccc9593
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
PtrList<radiation::radiationModel> radiation(fluidRegions.size());

List<scalar> initialMassFluid(fluidRegions.size());
List<label> pRefCellFluid(fluidRegions.size(),0);
List<scalar> pRefValueFluid(fluidRegions.size(),0.0);
List<label> pRefCellFluid(fluidRegions.size(), 0);
List<scalar> pRefValueFluid(fluidRegions.size(), 0.0);
List<bool> frozenFlowFluid(fluidRegions.size(), false);

PtrList<dimensionedScalar> rhoMax(fluidRegions.size());
PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
Expand Down Expand Up @@ -160,38 +161,22 @@

initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();

const dictionary& simpleDict =
fluidRegions[i].solutionDict().subDict("SIMPLE");

setRefCell
(
thermoFluid[i].p(),
p_rghFluid[i],
fluidRegions[i].solutionDict().subDict("SIMPLE"),
simpleDict,
pRefCellFluid[i],
pRefValueFluid[i]
);

rhoMax.set
(
i,
new dimensionedScalar
(
fluidRegions[i].solutionDict().subDict("SIMPLE").lookup
(
"rhoMax"
)
)
);
simpleDict.readIfPresent("frozenFlow", frozenFlowFluid[i]);

rhoMin.set
(
i,
new dimensionedScalar
(
fluidRegions[i].solutionDict().subDict("SIMPLE").lookup
(
"rhoMin"
)
)
);
rhoMax.set(i, new dimensionedScalar(simpleDict.lookup("rhoMax")));
rhoMin.set(i, new dimensionedScalar(simpleDict.lookup("rhoMin")));

Info<< " Adding fvOptions\n" << endl;
fluidFvOptions.set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

const label pRefCell = pRefCellFluid[i];
const scalar pRefValue = pRefValueFluid[i];
const bool frozenFlow = frozenFlowFluid[i];

volScalarField& p_rgh = p_rghFluid[i];
const volScalarField& gh = ghFluid[i];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
// Pressure-velocity SIMPLE corrector

p_rgh.storePrevIter();
rho.storePrevIter();
{
#include "UEqn.H"
#include "EEqn.H"
#include "pEqn.H"
}
if (frozenFlow)
{
#include "EEqn.H"
}
else
{
p_rgh.storePrevIter();
rho.storePrevIter();

#include "UEqn.H"
#include "EEqn.H"
#include "pEqn.H"

turb.correct();
turb.correct();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
PtrList<volScalarField> dpdtFluid(fluidRegions.size());

List<scalar> initialMassFluid(fluidRegions.size());
List<bool> frozenFlowFluid(fluidRegions.size(), false);

PtrList<fv::IOoptionList> fluidFvOptions(fluidRegions.size());

Expand Down Expand Up @@ -102,7 +103,7 @@
)
);

Info<< " Adding turbulence \n" << endl;
Info<< " Adding to turbulence\n" << endl;
turbulence.set
(
i,
Expand Down Expand Up @@ -190,6 +191,10 @@
)
);

const dictionary& pimpleDict =
fluidRegions[i].solutionDict().subDict("PIMPLE");
pimpleDict.readIfPresent("frozenFlow", frozenFlowFluid[i]);

Info<< " Adding fvOptions\n" << endl;
fluidFvOptions.set
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@
dimMass,
initialMassFluid[i]
);

const bool frozenFlow = frozenFlowFluid[i];
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,30 @@ if (finalIter)
mesh.data::add("finalIteration", true);
}

if (oCorr == 0)
if (frozenFlow)
{
#include "rhoEqn.H"
#include "EEqn.H"
}
else
{
if (oCorr == 0)
{
#include "rhoEqn.H"
}

#include "UEqn.H"
#include "EEqn.H"
#include "UEqn.H"
#include "EEqn.H"

// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H"
}
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H"
}

turb.correct();
turb.correct();

rho = thermo.rho();
rho = thermo.rho();
}

if (finalIter)
{
Expand Down

0 comments on commit ccc9593

Please sign in to comment.