Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

Conflicts:
	ReleaseNotes-dev
This commit is contained in:
mattijs
2010-10-08 14:03:07 +01:00
179 changed files with 2332 additions and 2599 deletions

View File

@ -39,13 +39,43 @@
*** DSMC
*** Dynamic Mesh
*** Numerics
*** *Updated* command line help, e.g. `snappyHexMesh -help' now gives:
Usage: snappyHexMesh [OPTIONS]
options:
-case <dir> specify alternate case directory, default is the cwd
-overwrite overwrite existing mesh/results files
-parallel run in parallel
-srcDoc display source code in browser
-doc display application documentation in browser
-help print the usage
*** *New* Surface film library
+ Creation of films by particle addition, or initial film distribution
+ Coupled with the lagrangian/intermediate cloud hierarchy library
+ Hierarchical design, consisting of
+ kinematic film: mass, momentum
+ constant thermodynamic properties
+ thermodynamic film: mass, momentum and enthalpy
+ constant, or temperature dependant thermodynamic properties
+ Sub-models:
+ detachment/dripping whereby particles (re)enter the originating cloud
+ particle sizes set according to PDF
+ other properties set to ensure mass, momentum and energy conservation
+ heat transfer to/from walls and film surface
+ film evaporation and boiling
+ Additional wall functions for primary region momentum and temperature
taking film into account
+ Parallel aware
*** *Updated* particle tracking algorithm
* Solvers
A number of new solvers have been developed for a range of engineering
applications. There has been a set of improvements to certain classes of
solver that are introduced in this release.
*** *New* Solvers
+ ...
+ =reactingParcelFilmFoam=: Lagrangian cloud and film transport in a
reacting gas phase system
*** Modifications to multiphase and buoyant solvers
+ ...
*** Modifications to solvers for sensible enthalpy
@ -58,23 +88,43 @@
* Boundary conditions
New boundary conditions have been introduced to support new applications in
OpenFOAM.
+ ...
+ *New* wall functions:
+ kappatJayatillekeWallFunction: incompressible RAS thermal wall function
* Utilities
There have been some utilities added and updated in this release.
*** *New* utilities
+ ...
+ =extrudeToRegionMesh=: Extrude faceZones into separate mesh (as a
different region)
+ used to e.g. extrude baffles (extrude internal faces) or create
liquid film regions
+ if extruding internal faces:
+ create baffles in original mesh with directMappedWall patches
+ if extruding boundary faces:
+ convert boundary faces to directMappedWall patches
+ extrude edges of faceZone as a <zone>_sidePatch
+ extrude edges inbetween different faceZones as a
(nonuniformTransform)cyclic <zoneA>_<zoneB>
+ extrudes into master direction (i.e. away from the owner cell
if flipMap is false)
*** Updated utilities
+ ...
* Post-processing
+ =foamToEnsight=: new =-nodeValues= option to generate and output nodal
field data. This is optional and saves memory (compared to letting EnSight
do the interpolation) in case of meshes with large
amounts of polyhedral cells. On typical snappyHexMesh generated meshes
we've seen differences of 0.4 v.s. 2.5Gb memory usage.
field data.
+ Function objects:
+ =residualControl=: new function object to allow users to terminate steady
state calculations when the defined residual levels are achieved
+ =abortCalculation=: watches for presence of the named file in the
$FOAM_CASE directory and aborts the calculation if it is present
+ =timeActivatedFileUpdate=: performs a file copy/replacement once a
specified time has been reached, e.g. to automagically change fvSchemes and
fvSolution during a calculation
+ =streamLine=: generate streamlines; ouputs both trajectory and field data
* New tutorials
There is a large number of new tutorials to support the new solvers in the
release.
+ ...
+ =reactingParcelFilmFoam= tutorials:
+ multipleBoxes, hotBoxes, panel, evaporationTest

View File

@ -45,14 +45,9 @@
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
dimensionedScalar rhoMax
dimensionedScalar pMin
(
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax")
);
dimensionedScalar rhoMin
(
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin")
mesh.solutionDict().subDict("SIMPLE").lookup("pMin")
);
Info<< "Creating turbulence model\n" << endl;
@ -70,16 +65,29 @@
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
thermalPorousZones pZones(mesh);
Switch pressureImplicitPorosity(false);
// nUCorrectors used for pressureImplicitPorosity
int nUCorr = 0;
const bool pressureImplicitPorosity =
if (pZones.size())
{
// nUCorrectors for pressureImplicitPorosity
if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
{
nUCorr = readInt
(
pZones.size()
&& mesh.solutionDict().subDict("SIMPLE").readIfPresent
(
"nUCorrectors",
nUCorr
)
&& (nUCorr > 0)
mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
);
}
if (nUCorr > 0)
{
pressureImplicitPorosity = true;
Info<< "Using pressure implicit porosity" << endl;
}
else
{
Info<< "Using pressure explicit porosity" << endl;
}
}

View File

@ -5,8 +5,8 @@
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)")
- (rho/psi)*fvc::div(phi/fvc::interpolate(rho))
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p, "div(U,p)"))
- p*fvc::div(phi/fvc::interpolate(rho))
);
pZones.addEnthalpySource(thermo, rho, hEqn);

View File

@ -1,8 +1,3 @@
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
if (pressureImplicitPorosity)
{
U = trTU()&UEqn().H();
@ -63,6 +58,8 @@ else
U.correctBoundaryConditions();
bound(p, pMin);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
@ -72,7 +69,5 @@ if (closedVolume)
}
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;

View File

@ -12,7 +12,7 @@
);
TEqn.relax();
TEqn.solve();
TEqn.solve(mesh.solver(T.select(finalIter)));
rhok = 1.0 - beta*(T - TRef);
}

View File

@ -18,9 +18,10 @@
fvc::reconstruct
(
(
fvc::interpolate(rhok)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
)
)
- ghf*fvc::snGrad(rhok)
- fvc::snGrad(p_rgh)
)*mesh.magSf()
),
mesh.solver(U.select(finalIter))
);
}

View File

@ -87,7 +87,7 @@ int main(int argc, char *argv[])
if (nOuterCorr != 1)
{
p.storePrevIter();
p_rgh.storePrevIter();
}
#include "UEqn.H"

View File

@ -14,12 +14,12 @@
mesh
);
Info<< "Reading field p\n" << endl;
volScalarField p
Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh
(
IOobject
(
"p",
"p_rgh",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
@ -52,6 +52,18 @@
incompressible::RASModel::New(U, phi, laminarTransport)
);
// Kinematic density for buoyancy force
volScalarField rhok
(
IOobject
(
"rhok",
runTime.timeName(),
mesh
),
1.0 - beta*(T - TRef)
);
// kinematic turbulent thermal thermal conductivity m2/s
Info<< "Reading field kappat\n" << endl;
volScalarField kappat
@ -67,25 +79,41 @@
mesh
);
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
p_rgh + rhok*gh
);
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell
(
p,
p_rgh,
mesh.solutionDict().subDict("PIMPLE"),
pRefCell,
pRefValue
);
// Kinematic density for buoyancy force
volScalarField rhok
if (p_rgh.needReference())
{
p += dimensionedScalar
(
IOobject
(
"rhok",
runTime.timeName(),
mesh
),
1.0 - beta*(T - TRef)
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}

View File

@ -7,22 +7,23 @@
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);
surfaceScalarField buoyancyPhi =
rUAf*fvc::interpolate(rhok)*(g & mesh.Sf());
phi += buoyancyPhi;
surfaceScalarField buoyancyPhi = rUAf*ghf*fvc::snGrad(rhok)*mesh.magSf();
phi -= buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
fvScalarMatrix p_rghEqn
(
fvm::laplacian(rUAf, p) == fvc::div(phi)
fvm::laplacian(rUAf, p_rgh) == fvc::div(phi)
);
pEqn.solve
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve
(
mesh.solver
(
p.select
p_rgh.select
(
(
finalIter
@ -36,17 +37,30 @@
if (nonOrth == nNonOrthCorr)
{
// Calculate the conservative fluxes
phi -= pEqn.flux();
phi -= p_rghEqn.flux();
// Explicitly relax pressure for momentum corrector
p.relax();
p_rgh.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rUAf);
U -= rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rUAf);
U.correctBoundaryConditions();
}
}
#include "continuityErrs.H"
p = p_rgh + rhok*gh;
if (p_rgh.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
p_rgh = p - rhok*gh;
}
}

View File

@ -96,29 +96,23 @@
p_rgh + rhok*gh
);
label p_rghRefCell = 0;
scalar p_rghRefValue = 0.0;
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell
(
p,
p_rgh,
mesh.solutionDict().subDict("SIMPLE"),
p_rghRefCell,
p_rghRefValue
pRefCell,
pRefValue
);
scalar pRefValue = 0.0;
if (p_rgh.needReference())
{
pRefValue = readScalar
(
mesh.solutionDict().subDict("SIMPLE").lookup("pRefValue")
);
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, p_rghRefCell)
pRefValue - getRefCellValue(p, pRefCell)
);
}

View File

@ -18,17 +18,9 @@
fvm::laplacian(rUAf, p_rgh) == fvc::div(phi)
);
p_rghEqn.setReference(p_rghRefCell, p_rghRefValue);
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
// retain the residual from the first iteration
if (nonOrth == 0)
{
p_rghEqn.solve();
}
else
{
p_rghEqn.solve();
}
if (nonOrth == nNonOrthCorr)
{
@ -55,7 +47,8 @@
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, p_rghRefCell)
pRefValue - getRefCellValue(p, pRefCell)
);
p_rgh = p - rhok*gh;
}
}

View File

@ -17,8 +17,11 @@
==
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
)
(
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
)*mesh.magSf()
),
mesh.solver(U.select(finalIter))
);
}

View File

@ -80,7 +80,7 @@ int main(int argc, char *argv[])
if (nOuterCorr != 1)
{
p.storePrevIter();
p_rgh.storePrevIter();
}
#include "UEqn.H"

View File

@ -53,15 +53,30 @@
)
);
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh
(
IOobject
(
"p_rgh",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
// Force p_rgh to be consistent with p
p_rgh = p - rho*gh;
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt
(
"DpDt",
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
thermo.correct();
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
dimensionedScalar totalVolume = sum(mesh.V());

View File

@ -9,7 +9,7 @@
);
hEqn.relax();
hEqn.solve();
hEqn.solve(mesh.solver(h.select(finalIter)));
thermo.correct();
}

View File

@ -1,11 +1,9 @@
{
bool closedVolume = p.needReference();
rho = thermo.rho();
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution - done in 2 parts. Part 1:
thermo.rho() -= psi*p;
thermo.rho() -= psi*p_rgh;
volScalarField rUA = 1.0/UEqn.A();
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
@ -18,24 +16,23 @@
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
);
surfaceScalarField buoyancyPhi =
rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
surfaceScalarField buoyancyPhi = -rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf();
phi += buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
fvScalarMatrix p_rghEqn
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
+ fvc::div(phi)
- fvm::laplacian(rhorUAf, p)
- fvm::laplacian(rhorUAf, p_rgh)
);
pEqn.solve
p_rghEqn.solve
(
mesh.solver
(
p.select
p_rgh.select
(
(
finalIter
@ -49,34 +46,25 @@
if (nonOrth == nNonOrthCorr)
{
// Calculate the conservative fluxes
phi += pEqn.flux();
phi += p_rghEqn.flux();
// Explicitly relax pressure for momentum corrector
p.relax();
p_rgh.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U += rUA*fvc::reconstruct((buoyancyPhi + pEqn.flux())/rhorUAf);
U += rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorUAf);
U.correctBoundaryConditions();
}
}
p = p_rgh + rho*gh;
// Second part of thermodynamic density update
thermo.rho() += psi*p;
thermo.rho() += psi*p_rgh;
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
{
p +=
(initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
thermo.rho() = psi*p;
rho += (initialMass - fvc::domainIntegrate(rho))/totalVolume;
}
}

View File

@ -62,11 +62,8 @@ int main(int argc, char *argv[])
{
#include "UEqn.H"
#include "hEqn.H"
for (int i=0; i<3; i++)
{
#include "pEqn.H"
}
}
turbulence->correct();

View File

@ -23,20 +23,6 @@
volScalarField& h = thermo.h();
const volScalarField& psi = thermo.psi();
Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh
(
IOobject
(
"p_rgh",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field U\n" << endl;
volVectorField U
(
@ -53,7 +39,6 @@
#include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::RASModel> turbulence
(
@ -66,40 +51,39 @@
)
);
Info<< "Calculating field g.h\n" << endl;
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
p = p_rgh + rho*gh;
thermo.correct();
rho = thermo.rho();
Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh
(
IOobject
(
"p_rgh",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
// Force p_rgh to be consistent with p
p_rgh = p - rho*gh;
label p_rghRefCell = 0;
scalar p_rghRefValue = 0.0;
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell
(
p,
p_rgh,
mesh.solutionDict().subDict("SIMPLE"),
p_rghRefCell,
p_rghRefValue
pRefCell,
pRefValue
);
scalar pRefValue = 0.0;
if (p_rgh.needReference())
{
pRefValue = readScalar
(
mesh.solutionDict().subDict("SIMPLE").lookup("pRefValue")
);
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, p_rghRefCell)
);
}
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
dimensionedScalar totalVolume = sum(mesh.V());

View File

@ -1,11 +1,12 @@
{
rho = thermo.rho();
rho.relax();
volScalarField rUA = 1.0/UEqn().A();
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
U = rUA*UEqn().H();
//UEqn.clear();
UEqn.clear();
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
bool closedVolume = adjustPhi(phi, U, p_rgh);
@ -20,7 +21,7 @@
fvm::laplacian(rhorUAf, p_rgh) == fvc::div(phi)
);
p_rghEqn.setReference(p_rghRefCell, p_rghRefValue);
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
p_rghEqn.solve();
if (nonOrth == nNonOrthCorr)
@ -42,13 +43,13 @@
p = p_rgh + rho*gh;
// For closed-volume cases adjust the pressure and density levels
// For closed-volume cases adjust the pressure level
// to obey overall mass continuity
if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
p_rgh == p - rho*gh;
p_rgh = p - rho*gh;
}
rho = thermo.rho();

View File

@ -58,7 +58,7 @@ int main(int argc, char *argv[])
#include "readSIMPLEControls.H"
p.storePrevIter();
p_rgh.storePrevIter();
rho.storePrevIter();
// Pressure-velocity SIMPLE corrector

View File

@ -93,6 +93,8 @@ int main(int argc, char *argv[])
// --- PIMPLE loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
bool finalIter = oCorr == nOuterCorr-1;
forAll(fluidRegions, i)
{
Info<< "\nSolving for fluid region "

View File

@ -13,7 +13,9 @@
==
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
(
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
)*mesh.magSf()
)
);

View File

@ -6,12 +6,16 @@
PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
PtrList<volScalarField> DpDtf(fluidRegions.size());
PtrList<volScalarField> p_rghFluid(fluidRegions.size());
PtrList<volScalarField> ghFluid(fluidRegions.size());
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size());
List<label> pRefCellFluid(fluidRegions.size(),0);
List<scalar> pRefValueFluid(fluidRegions.size(),0.0);
PtrList<dimensionedScalar> rhoMax(fluidRegions.size());
PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
// Populate fluid field pointer lists
forAll(fluidRegions, i)
@ -130,15 +134,74 @@
).ptr()
);
Info<< " Adding to ghFluid\n" << endl;
ghFluid.set
(
i,
new volScalarField("gh", gFluid[i] & fluidRegions[i].C())
);
Info<< " Adding to ghfFluid\n" << endl;
ghfFluid.set
(
i,
new surfaceScalarField("ghf", gFluid[i] & fluidRegions[i].Cf())
);
p_rghFluid.set
(
i,
new volScalarField
(
IOobject
(
"p_rgh",
runTime.timeName(),
fluidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
fluidRegions[i]
)
);
// Force p_rgh to be consistent with p
p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i];
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
setRefCell
(
thermoFluid[i].p(),
p_rghFluid[i],
fluidRegions[i].solutionDict().subDict("SIMPLE"),
pRefCellFluid[i],
pRefValueFluid[i]
);
rhoMax.set
(
i,
new dimensionedScalar
(
fluidRegions[i].solutionDict().subDict("SIMPLE").lookup
(
"rhoMax"
)
)
);
rhoMin.set
(
i,
new dimensionedScalar
(
fluidRegions[i].solutionDict().subDict("SIMPLE").lookup
(
"rhoMin"
)
)
);
}

View File

@ -5,8 +5,8 @@
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turb.alphaEff(), h)
==
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p))
- p*fvc::div(phi/fvc::interpolate(rho))
fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)")
- (rho/psi)*fvc::div(phi/fvc::interpolate(rho))
);
hEqn.relax();

View File

@ -1,7 +1,9 @@
{
// From buoyantSimpleFoam
rho = thermo.rho();
rho = max(rho, rhoMin[i]);
rho = min(rho, rhoMax[i]);
rho.relax();
volScalarField rUA = 1.0/UEqn().A();
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
@ -10,59 +12,54 @@
UEqn.clear();
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
bool closedVolume = adjustPhi(phi, U, p);
bool closedVolume = adjustPhi(phi, U, p_rgh);
surfaceScalarField buoyancyPhi =
rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
phi += buoyancyPhi;
surfaceScalarField buoyancyPhi = rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf();
phi -= buoyancyPhi;
// Solve pressure
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
fvScalarMatrix p_rghEqn
(
fvm::laplacian(rhorUAf, p) == fvc::div(phi)
fvm::laplacian(rhorUAf, p_rgh) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
// retain the residual from the first iteration
if (nonOrth == 0)
{
pEqn.solve();
}
else
{
pEqn.solve();
}
p_rghEqn.solve();
if (nonOrth == nNonOrthCorr)
{
// For closed-volume cases adjust the pressure and density levels
// Calculate the conservative fluxes
phi -= p_rghEqn.flux();
// Explicitly relax pressure for momentum corrector
p_rgh.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U -= rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorUAf);
U.correctBoundaryConditions();
}
}
p = p_rgh + rho*gh;
#include "continuityErrs.H"
// For closed-volume cases adjust the pressure level
// to obey overall mass continuity
if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
p_rgh = p - rho*gh;
}
// Calculate the conservative fluxes
phi -= pEqn.flux();
// Explicitly relax pressure for momentum corrector
p.relax();
// Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure
U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorUAf);
U.correctBoundaryConditions();
}
}
#include "continuityErrs.H"
rho = thermo.rho();
rho = max(rho, rhoMin[i]);
rho = min(rho, rhoMax[i]);
rho.relax();
Info<< "Min/max rho:" << min(rho).value() << ' '

View File

@ -5,7 +5,6 @@
volScalarField& K = KFluid[i];
volVectorField& U = UFluid[i];
surfaceScalarField& phi = phiFluid[i];
const dimensionedVector& g = gFluid[i];
compressible::turbulenceModel& turb = turbulence[i];
@ -22,3 +21,7 @@
const label pRefCell = pRefCellFluid[i];
const scalar pRefValue = pRefValueFluid[i];
volScalarField& p_rgh = p_rghFluid[i];
const volScalarField& gh = ghFluid[i];
const surfaceScalarField& ghf = ghfFluid[i];

View File

@ -1,6 +1,6 @@
// Pressure-velocity SIMPLE corrector
p.storePrevIter();
p_rgh.storePrevIter();
rho.storePrevIter();
{
#include "UEqn.H"

View File

@ -16,8 +16,11 @@
==
fvc::reconstruct
(
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
)
(
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
)*mesh.magSf()
),
mesh.solver(U.select(finalIter))
);
}

View File

@ -6,6 +6,9 @@
PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
PtrList<compressible::turbulenceModel> turbulence(fluidRegions.size());
PtrList<volScalarField> p_rghFluid(fluidRegions.size());
PtrList<volScalarField> ghFluid(fluidRegions.size());
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
PtrList<volScalarField> DpDtFluid(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size());
@ -129,6 +132,42 @@
).ptr()
);
Info<< " Adding to ghFluid\n" << endl;
ghFluid.set
(
i,
new volScalarField("gh", gFluid[i] & fluidRegions[i].C())
);
Info<< " Adding to ghfFluid\n" << endl;
ghfFluid.set
(
i,
new surfaceScalarField("ghf", gFluid[i] & fluidRegions[i].Cf())
);
p_rghFluid.set
(
i,
new volScalarField
(
IOobject
(
"p_rgh",
runTime.timeName(),
fluidRegions[i],
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
fluidRegions[i]
)
);
// Force p_rgh to be consistent with p
p_rghFluid[i] = thermoFluid[i].p() - rhoFluid[i]*ghFluid[i];
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
Info<< " Adding to DpDtFluid\n" << endl;
DpDtFluid.set
(
@ -147,6 +186,4 @@
)
)
);
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
}

View File

@ -7,16 +7,9 @@
==
DpDt
);
if (oCorr == nOuterCorr-1)
{
hEqn.relax();
hEqn.solve(mesh.solver("hFinal"));
}
else
{
hEqn.relax();
hEqn.solve();
}
hEqn.solve(mesh.solver(h.select(finalIter)));
thermo.correct();

View File

@ -1,5 +1,5 @@
{
bool closedVolume = p.needReference();
bool closedVolume = p_rgh.needReference();
rho = thermo.rho();
@ -17,34 +17,35 @@
)
);
phi = phiU + fvc::interpolate(rho)*(g & mesh.Sf())*rhorUAf;
phi = phiU - rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf();
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
fvScalarMatrix p_rghEqn
(
fvm::ddt(psi, p)
fvm::ddt(psi, p_rgh) + fvc::ddt(psi, rho)*gh
+ fvc::div(phi)
- fvm::laplacian(rhorUAf, p)
- fvm::laplacian(rhorUAf, p_rgh)
);
if
p_rghEqn.solve
(
mesh.solver
(
p_rgh.select
(
(
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
}
)
)
);
if (nonOrth == nNonOrthCorr)
{
phi += pEqn.flux();
phi += p_rghEqn.flux();
}
}
@ -52,6 +53,8 @@
U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf);
U.correctBoundaryConditions();
p = p_rgh + rho*gh;
// Update pressure substantive derivative
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
@ -65,9 +68,10 @@
// to obey overall mass continuity
if (closedVolume)
{
p += (massIni - fvc::domainIntegrate(psi*p))
p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi);
rho = thermo.rho();
p_rgh = p - rho*gh;
}
// Update thermal conductivity

View File

@ -1,17 +0,0 @@
const dictionary& piso = fluidRegions[i].solutionDict().subDict("PISO");
const int nOuterCorr =
piso.lookupOrDefault<int>("nOuterCorrectors", 1);
const int nCorr =
piso.lookupOrDefault<int>("nCorrectors", 1);
const int nNonOrthCorr =
piso.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
const bool momentumPredictor =
piso.lookupOrDefault("momentumPredictor", true);
const bool transonic =
piso.lookupOrDefault("transonic", false);

View File

@ -1,11 +1,10 @@
const fvMesh& mesh = fluidRegions[i];
fvMesh& mesh = fluidRegions[i];
basicPsiThermo& thermo = thermoFluid[i];
volScalarField& rho = rhoFluid[i];
volScalarField& K = KFluid[i];
volVectorField& U = UFluid[i];
surfaceScalarField& phi = phiFluid[i];
const dimensionedVector& g = gFluid[i];
compressible::turbulenceModel& turb = turbulence[i];
volScalarField& DpDt = DpDtFluid[i];
@ -14,4 +13,13 @@
const volScalarField& psi = thermo.psi();
volScalarField& h = thermo.h();
const dimensionedScalar massIni("massIni", dimMass, initialMassFluid[i]);
volScalarField& p_rgh = p_rghFluid[i];
const volScalarField& gh = ghFluid[i];
const surfaceScalarField& ghf = ghfFluid[i];
const dimensionedScalar initialMass
(
"initialMass",
dimMass,
initialMassFluid[i]
);

View File

@ -1,3 +1,8 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
if (oCorr == 0)
{
#include "rhoEqn.H"
@ -16,3 +21,8 @@ for (int corr=0; corr<nCorr; corr++)
turb.correct();
rho = thermo.rho();
if (finalIter)
{
mesh.data::remove("finalIteration");
}

View File

@ -1,2 +1,2 @@
p.storePrevIter();
p_rgh.storePrevIter();
rho.storePrevIter();

View File

@ -8,9 +8,5 @@
<< solidRegions[i].name() << nl << endl;
Info<< " Adding to thermos\n" << endl;
thermos.set
(
i,
basicSolidThermo::New(solidRegions[i])
);
thermos.set(i, basicSolidThermo::New(solidRegions[i]));
}

View File

@ -1,3 +1,8 @@
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
{
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
@ -7,8 +12,13 @@
- fvm::laplacian(K, T)
);
TEqn().relax();
TEqn().solve();
TEqn().solve(mesh.solver(T.select(finalIter)));
}
Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
}
if (finalIter)
{
mesh.data::remove("finalIteration");
}

View File

@ -13,5 +13,5 @@
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
solve(UEqn == -fvc::grad(p), mesh.solver(U.select(finalIter)));
}

View File

@ -90,17 +90,28 @@ int main(int argc, char *argv[])
#include "rhoEqn.H"
// --- PIMPLE loop
for (int ocorr=1; ocorr<=nOuterCorr; ocorr++)
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
bool finalIter = oCorr == nOuterCorr - 1;
if (finalIter)
{
mesh.data::add("finalIteration", true);
}
#include "UEqn.H"
#include "YEqn.H"
#include "hsEqn.H"
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
for (int corr=0; corr<nCorr; corr++)
{
#include "pEqn.H"
}
if (finalIter)
{
mesh.data::remove("finalIteration");
}
}
turbulence->correct();

View File

@ -15,7 +15,7 @@
hsEqn.relax();
hsEqn.solve();
hsEqn.solve(mesh.solver(hs.select(finalIter)));
thermo.correct();

View File

@ -26,7 +26,20 @@ if (transonic)
coalParcels.Srho()
);
pEqn.solve();
pEqn.solve
(
mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
);
if (nonOrth == nNonOrthCorr)
{
@ -54,7 +67,20 @@ else
coalParcels.Srho()
);
pEqn.solve();
pEqn.solve
(
mesh.solver
(
p.select
(
(
finalIter
&& corr == nCorr-1
&& nonOrth == nNonOrthCorr
)
)
)
);
if (nonOrth == nNonOrthCorr)
{

View File

@ -116,7 +116,7 @@ int main(int argc, char *argv[])
sampledSets::typeName,
mesh,
sampleDict,
IOobject::MUST_READ,
IOobject::MUST_READ_IF_MODIFIED,
true
);
@ -125,7 +125,7 @@ int main(int argc, char *argv[])
sampledSurfaces::typeName,
mesh,
sampleDict,
IOobject::MUST_READ,
IOobject::MUST_READ_IF_MODIFIED,
true
);

View File

@ -121,12 +121,16 @@ void Foam::Cloud<ParticleType>::initCloud(const bool checkClass)
}
else
{
WarningIn("Cloud<ParticleType>::initCloud(const bool checkClass)")
<< "Cannot read particle positions file " << nl
Pout<< "Cannot read particle positions file " << nl
<< " " << ioP.path() << nl
<< " assuming the initial cloud contains 0 particles." << endl;
}
// Ask for the tetBasePtIs to trigger all processors to build
// them, otherwise, if some processors have no particles then
// there is a comms mismatch.
polyMesh_.tetBasePtIs();
forAllIter(typename Cloud<ParticleType>, *this, pIter)
{
ParticleType& p = pIter();

View File

@ -77,24 +77,19 @@ Foam::MarshakRadiationFvPatchScalarField::MarshakRadiationFvPatchScalarField
{
if (dict.found("value"))
{
fvPatchScalarField::operator=
(
scalarField("value", dict, p.size())
);
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
refValue() = scalarField("value", dict, p.size());
}
else
{
const scalarField& Tp =
patch().lookupPatchField<volScalarField, scalar>(TName_);
refValue() = 0.0;
}
refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Tp);
// zero gradient
refGrad() = 0.0;
valueFraction() = 1.0;
fvPatchScalarField::operator=(refValue());
}
}

View File

@ -78,24 +78,15 @@ MarshakRadiationFixedTMixedFvPatchScalarField
Trad_("Trad", dict, p.size()),
emissivity_(readScalar(dict.lookup("emissivity")))
{
if (dict.found("value"))
{
fvPatchScalarField::operator=
(
scalarField("value", dict, p.size())
);
refValue() = scalarField("refValue", dict, p.size());
refGrad() = scalarField("refGradient", dict, p.size());
valueFraction() = scalarField("valueFraction", dict, p.size());
}
else
{
// refValue updated on each call to updateCoeffs()
refValue() = 4.0*constant::physicoChemical::sigma.value()*pow4(Trad_);
// zero gradient
refGrad() = 0.0;
valueFraction() = 1.0;
fvPatchScalarField::operator=(refValue());
}
}

View File

@ -1,4 +1,9 @@
thermalPorousZone/thermalPorousZone.C
thermalPorousZone/thermalPorousZones.C
thermalModel/thermalModel/thermalModel.C
thermalModel/thermalModel/thermalModelNew.C
thermalModel/fixedTemperature/fixedTemperature.C
thermalModel/noThermalModel/noThermalModel.C
LIB = $(FOAM_LIBBIN)/libthermalPorousZone

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fixedTemperature.H"
#include "addToRunTimeSelectionTable.H"
#include "basicThermo.H"
#include "volFields.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(fixedTemperature, 0);
addToRunTimeSelectionTable
(
thermalModel,
fixedTemperature,
pZone
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fixedTemperature::fixedTemperature(const porousZone& pZone)
:
thermalModel(pZone, typeName),
T_(readScalar(coeffDict_.lookup("T")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
Foam::fixedTemperature::~fixedTemperature()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fixedTemperature::addEnthalpySource
(
const basicThermo& thermo,
const volScalarField& rho,
fvScalarMatrix& hEqn
) const
{
const labelList& zones = pZone_.zoneIds();
if (zones.empty() || T_ < 0.0)
{
return;
}
const fvMesh& mesh = pZone_.mesh();
const scalarField& V = mesh.V();
scalarField& hDiag = hEqn.diag();
scalarField& hSource = hEqn.source();
// TODO: generalize for non-fixedTemperature methods
const scalar rate = 1e6;
forAll(zones, zoneI)
{
const labelList& cells = mesh.cellZones()[zones[zoneI]];
forAll(cells, i)
{
hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]];
hSource[cells[i]] += rate*V[cells[i]]*rho[cells[i]]*T_;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fixedTemperature
Description
Fixed temperature model
\*---------------------------------------------------------------------------*/
#ifndef fixedTemperature_H
#define fixedTemperature_H
#include "thermalModel.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedTemperature Declaration
\*---------------------------------------------------------------------------*/
class fixedTemperature
:
public thermalModel
{
protected:
// Protected data
//- Fixed temperature
const scalar T_;
public:
//- Runtime type information
TypeName("fixedTemperature");
// Constructors
//- Construct from porous zone
fixedTemperature(const porousZone& pZone);
//- Destructor
virtual ~fixedTemperature();
// Member Functions
//- Add the thermal source to the enthalpy equation
virtual void addEnthalpySource
(
const basicThermo& thermo,
const volScalarField& rho,
fvScalarMatrix& hEqn
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,74 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "noThermalModel.H"
#include "addToRunTimeSelectionTable.H"
#include "basicThermo.H"
#include "volFields.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(noThermalModel, 0);
addToRunTimeSelectionTable
(
thermalModel,
noThermalModel,
pZone
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::noThermalModel::noThermalModel(const porousZone& pZone)
:
thermalModel(pZone)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
Foam::noThermalModel::~noThermalModel()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::noThermalModel::addEnthalpySource
(
const basicThermo&,
const volScalarField&,
fvScalarMatrix&
) const
{
// do nothing
}
// ************************************************************************* //

View File

@ -0,0 +1,90 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::noThermalModel
Description
Dummy model for 'none' option
\*---------------------------------------------------------------------------*/
#ifndef noThermalModel_H
#define noThermalModel_H
#include "thermalModel.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class noThermalModel Declaration
\*---------------------------------------------------------------------------*/
class noThermalModel
:
public thermalModel
{
public:
//- Runtime type information
TypeName("none");
// Constructors
//- Construct from porous zone
noThermalModel(const porousZone& pZone);
//- Destructor
virtual ~noThermalModel();
// Member Functions
//- Add the thermal source to the enthalpy equation
virtual void addEnthalpySource
(
const basicThermo& thermo,
const volScalarField& rho,
fvScalarMatrix& hEqn
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,63 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "thermalModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(thermalModel, 0);
defineRunTimeSelectionTable(thermalModel, pZone);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::thermalModel::thermalModel(const porousZone& pZone)
:
pZone_(pZone),
coeffDict_(dictionary::null)
{}
Foam::thermalModel::thermalModel
(
const porousZone& pZone,
const word& modelType
)
:
pZone_(pZone),
coeffDict_(pZone_.dict().subDict(modelType + "Coeffs"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
Foam::thermalModel::~thermalModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,122 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::thermalModel
Description
Base class for selecting the temperature specification models
\*---------------------------------------------------------------------------*/
#ifndef thermalModel_H
#define thermalModel_H
#include "porousZone.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
#include "volFieldsFwd.H"
#include "fvMatricesFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class basicThermo;
/*---------------------------------------------------------------------------*\
Class thermalModel Declaration
\*---------------------------------------------------------------------------*/
class thermalModel
{
protected:
// Protected data
//- Reference to the porous zone
const porousZone& pZone_;
//- Sub-model coefficients dictionary
const dictionary coeffDict_;
public:
//- Runtime type information
TypeName("thermalModel");
//- Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
thermalModel,
pZone,
(
const porousZone& pZone
),
(pZone)
);
// Constructors
//- Construct null from porous zone
thermalModel(const porousZone& pZone);
//- Construct from porous zone and model type name
thermalModel(const porousZone& pZone, const word& modelType);
//- Destructor
virtual ~thermalModel();
//- Selector
static autoPtr<thermalModel> New(const porousZone& pZone);
// Member Functions
//- Add the thermal source to the enthalpy equation
virtual void addEnthalpySource
(
const basicThermo& thermo,
const volScalarField& rho,
fvScalarMatrix& hEqn
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "thermalModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::thermalModel> Foam::thermalModel::New
(
const porousZone& pZone
)
{
const word modelType(pZone.dict().lookup("thermalModel"));
Info<< "Selecting thermalModel " << modelType << endl;
pZoneConstructorTable::iterator cstrIter =
pZoneConstructorTablePtr_->find(modelType);
if (cstrIter == pZoneConstructorTablePtr_->end())
{
FatalErrorIn
(
"thermalModel::New(const porousZone&)"
) << "Unknown thermalModel type "
<< modelType << nl << nl
<< "Valid thermalModel types are :" << endl
<< pZoneConstructorTablePtr_->sortedToc()
<< abort(FatalError);
}
return autoPtr<thermalModel>(cstrIter()(pZone));
}
// ************************************************************************* //

View File

@ -24,9 +24,9 @@ License
\*----------------------------------------------------------------------------*/
#include "thermalPorousZone.H"
#include "fvMesh.H"
#include "fvMatrices.H"
#include "basicThermo.H"
#include "volFields.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -38,29 +38,8 @@ Foam::thermalPorousZone::thermalPorousZone
)
:
porousZone(key, mesh, dict),
T_("T", dimTemperature, -GREAT)
{
if (const dictionary* dictPtr = dict.subDictPtr("thermalModel"))
{
const word thermalModel(dictPtr->lookup("type"));
if (thermalModel == "fixedTemperature")
{
dictPtr->lookup("T") >> T_;
}
else
{
FatalIOErrorIn
(
"thermalPorousZone::thermalPorousZone"
"(const keyType&, const fvMesh&, const dictionary&)",
*dictPtr
) << "thermalModel " << thermalModel << " is not supported" << nl
<< " Supported thermalModels are: fixedTemperature"
<< exit(FatalIOError);
}
}
}
model_(thermalModel::New(*this))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -72,29 +51,7 @@ void Foam::thermalPorousZone::addEnthalpySource
fvScalarMatrix& hEqn
) const
{
const labelList& zones = this->zoneIds();
if (zones.empty() || T_.value() < 0.0)
{
return;
}
const scalarField& V = mesh().V();
scalarField& hDiag = hEqn.diag();
scalarField& hSource = hEqn.source();
// TODO: generalize for non-fixedTemperature methods
const scalar rate = 1e6;
forAll(zones, zoneI)
{
const labelList& cells = mesh().cellZones()[zones[zoneI]];
forAll(cells, i)
{
hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]];
hSource[cells[i]] += rate*V[cells[i]]*rho[cells[i]]*T_.value();
}
}
model_->addEnthalpySource(thermo, rho, hEqn);
}

View File

@ -29,7 +29,8 @@ Description
equations.
See Also
porousZone, thermalPorousZones and coordinateSystems
porousZone, thermalPorousZones and coordinateSystems with run-time
selectable thermal model
SourceFiles
thermalPorousZone.C
@ -40,6 +41,7 @@ SourceFiles
#define thermalPorousZone_H
#include "porousZone.H"
#include "thermalModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,23 +61,27 @@ class thermalPorousZone
{
// Private data
//- Temperature in the porous-zone
dimensionedScalar T_;
//- Disallow default bitwise copy construct
thermalPorousZone(const thermalPorousZone&);
//- Disallow default bitwise assignment
void operator=(const thermalPorousZone&);
//- Thermal model
autoPtr<thermalModel> model_;
public:
// Constructors
//- Construct from components
thermalPorousZone(const keyType& key, const fvMesh&, const dictionary&);
thermalPorousZone
(
const keyType& key,
const fvMesh& mesh,
const dictionary& dict
);
//- Return clone
autoPtr<thermalPorousZone> clone() const
@ -118,20 +124,6 @@ public:
// Member Functions
// Access
//- Return the temperature in the porous-zone
const dimensionedScalar& T() const
{
return T_;
}
//- Edit access to the temperature in the porous-zone
dimensionedScalar& T()
{
return T_;
}
//- Add the thermal source to the enthalpy equation
void addEnthalpySource
(

View File

@ -231,19 +231,17 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
scalar P = Psmooth(Prat);
scalar yPlusTherm = this->yPlusTherm(P, Prat);
// Evaluate new effective thermal diffusivity
scalar kappaEff = 0.0;
if (yPlus < yPlusTherm)
// Update turbulent thermal conductivity
if (yPlus > yPlusTherm)
{
kappaEff = Pr*yPlus;
scalar nu = nuw[faceI];
scalar kt = nu*(yPlus/(Prt_/kappa_*log(E_*yPlusTherm) + P) - 1/Pr);
kappatw[faceI] = max(0.0, kt);
}
else
{
kappaEff = nuw[faceI]*yPlus/(Prt_/kappa_*log(E_*yPlusTherm) + P);
kappatw[faceI] = 0.0;
}
// Update turbulent thermal diffusivity
kappatw[faceI] = max(0.0, kappaEff - nuw[faceI]/Pr);
}
fixedValueFvPatchField<scalar>::updateCoeffs();

View File

@ -127,8 +127,8 @@ hollowConeInjectorCoeffs
{
minValue 1e-06;
maxValue 0.00015;
d ( 0.00015 );
n ( 3 );
d 0.00015;
n 3;
}
exponentialPDF

View File

@ -22,7 +22,14 @@ solvers
{
solver PCG;
preconditioner DIC;
tolerance 0;
tolerance 1e-7;
relTol 0.1;
};
rhoFinal
{
$rho;
tolerance 1e-7;
relTol 0;
};
@ -40,37 +47,13 @@ solvers
pFinal
{
solver GAMG;
$p;
tolerance 1e-7;
relTol 0;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
};
ft
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-7;
relTol 0;
nSweeps 1;
};
fu
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-7;
relTol 0;
nSweeps 1;
};
U
"(U|ft|fu|k|hs)"
{
solver smoothSolver;
smoother GaussSeidel;
@ -79,31 +62,13 @@ solvers
nSweeps 1;
};
UFinal
"(U|ft|fu|k|hs)Final"
{
solver smoothSolver;
smoother GaussSeidel;
$U;
tolerance 1e-7;
relTol 0;
nSweeps 1;
};
k
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-7;
relTol 0;
nSweeps 1;
};
hs
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-7;
relTol 0;
};
Ii
{

View File

@ -32,7 +32,7 @@ solvers
relTol 0.0;
}
"(U|Yi|h|k|epsilon)"
"(U|Yi|hs|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;

View File

@ -15,11 +15,16 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Pr Pr [ 0 0 0 0 0 0 0 ] 0.72;
Pr 0.72;
thermoType ePsiThermo<pureMixture<sutherlandTransport<specieThermo<janafThermo<perfectGas>>>>>;
mixture N2 1 28.01348 100 10000 1000 2.9525407 0.0013968838 -4.9262577e-07 7.8600091e-11 -4.6074978e-15 -923.93753 5.8718221 3.5309628 -0.0001236595 -5.0299339e-07 2.4352768e-09 -1.4087954e-12 -1046.9637 2.9674391 1.458e-06 110;
mixture N2
1 28.01348
100 10000 1000
2.9525407 0.0013968838 -4.9262577e-07 7.8600091e-11 -4.6074978e-15 -923.93753 5.8718221
3.5309628 -0.0001236595 -5.0299339e-07 2.4352768e-09 -1.4087954e-12 -1046.9637 2.9674391
1.458e-06 110;
// ************************************************************************* //

View File

@ -0,0 +1,10 @@
cd ${0%/*} || exit 1 # run from this directory
m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication rhoPimpleFoam

View File

@ -22,6 +22,13 @@ solvers
solver PCG;
preconditioner DIC;
tolerance 1e-5;
relTol 0.1;
}
rhoFinal
{
$rho;
tolerance 1e-5;
relTol 0;
}
@ -65,7 +72,7 @@ solvers
mergeLevels 1;
}
h
"(U|h|k|epsilon)"
{
solver PBiCG;
preconditioner DILU;
@ -73,26 +80,9 @@ solvers
relTol 0.1;
}
hFinal
"(U|h|k|epsilon)Final"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-5;
relTol 0;
}
k
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-5;
relTol 0;
}
epsilon
{
solver PBiCG;
preconditioner DILU;
$U;
tolerance 1e-5;
relTol 0;
}

View File

@ -0,0 +1 @@
../angledDuctImplicit/Allrun

View File

@ -47,5 +47,25 @@ graphFormat raw;
runTimeModifiable true;
functions
{
residualControl1
{
type residualControl;
functionObjectLibs ( "libjobControl.so" );
outputControl timeStep;
outputInterval 1;
maxResiduals
{
p 1e-2;
U 1e-4;
T 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
}
}
// ************************************************************************* //

View File

@ -34,7 +34,6 @@ divSchemes
div(phi,h) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,k) Gauss upwind;
div(phid,p) Gauss linear;
}
laplacianSchemes

View File

@ -0,0 +1,10 @@
cd ${0%/*} || exit 1 # run from this directory
m4 constant/polyMesh/blockMeshDict.m4 > constant/polyMesh/blockMeshDict
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication rhoPorousSimpleFoam

View File

@ -31,11 +31,11 @@ FoamFile
f f [0 -1 0 0 0 0 0] (0 0 0);
}
thermalModel
{
type fixedTemperature;
thermalModel none; // fixedTemperature;
T T [0 0 0 1 0] 350;
fixedTemperatureCoeffs
{
T 350;
}
}
)

View File

@ -47,5 +47,25 @@ graphFormat raw;
runTimeModifiable true;
functions
{
residualControl1
{
type residualControl;
functionObjectLibs ( "libjobControl.so" );
outputControl timeStep;
outputInterval 1;
maxResiduals
{
p 1e-3;
U 1e-4;
T 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
}
}
// ************************************************************************* //

View File

@ -34,7 +34,6 @@ divSchemes
div(phi,h) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,k) Gauss upwind;
div(phid,p) Gauss linear;
}
laplacianSchemes

View File

@ -51,7 +51,7 @@ SIMPLE
{
nUCorrectors 2;
nNonOrthogonalCorrectors 0;
pMin pMin [ 1 -1 -2 0 0 0 0 ] 100;
pMin pMin [ 1 -1 -2 0 0 ] 100;
}
relaxationFactors

View File

@ -1,443 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
floor
{
type fixedValue;
value nonuniform List<scalar>
400
(
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
600
600
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
600
600
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
)
;
}
ceiling
{
type fixedValue;
value uniform 300;
}
fixedWalls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -23,411 +23,7 @@ boundaryField
floor
{
type fixedValue;
value nonuniform List<scalar>
400
(
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
600
600
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
600
600
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
)
;
value uniform 300;
}
ceiling
{

View File

@ -22,23 +22,20 @@ boundaryField
{
floor
{
type buoyantPressure;
rho rhok;
value uniform 0;
type calculated;
value $internalField;
}
ceiling
{
type buoyantPressure;
rho rhok;
value uniform 0;
type calculated;
value $internalField;
}
fixedWalls
{
type buoyantPressure;
rho rhok;
value uniform 0;
type calculated;
value $internalField;
}
}

View File

@ -10,41 +10,35 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
object alpha;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
leftWall
floor
{
type zeroGradient;
}
rightWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
type buoyantPressure;
rho rhok;
value uniform 0;
}
defaultFaces
ceiling
{
type empty;
type buoyantPressure;
rho rhok;
value uniform 0;
}
fixedWalls
{
type buoyantPressure;
rho rhok;
value uniform 0;
}
}

View File

@ -5,6 +5,6 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
cp 0/T.org 0/T
rm -f 0/T
# ----------------------------------------------------------------- end-of-file

View File

@ -8,6 +8,7 @@ application=`getApplication`
compileApplication ../../buoyantPimpleFoam/hotRoom/setHotRoom
runApplication blockMesh
cp 0/T.org 0/T
runApplication setHotRoom
runApplication $application

View File

@ -40,12 +40,12 @@ divSchemes
laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(kappaEff,T) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(nuEff,U) Gauss linear uncorrected;
laplacian((1|A(U)),p_rgh) Gauss linear uncorrected;
laplacian(kappaEff,T) Gauss linear uncorrected;
laplacian(DkEff,k) Gauss linear uncorrected;
laplacian(DepsilonEff,epsilon) Gauss linear uncorrected;
laplacian(DREff,R) Gauss linear uncorrected;
}
interpolationSchemes
@ -55,13 +55,13 @@ interpolationSchemes
snGradSchemes
{
default corrected;
default uncorrected;
}
fluxRequired
{
default no;
p ;
p_rgh;
}

View File

@ -17,17 +17,17 @@ FoamFile
solvers
{
p
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-8;
relTol 0.1;
relTol 0.01;
}
pFinal
p_rghFinal
{
$p;
$p_rgh;
relTol 0;
}

View File

@ -22,23 +22,20 @@ boundaryField
{
floor
{
type buoyantPressure;
rho rhok;
value uniform 0;
type calculated;
value $internalField;
}
ceiling
{
type buoyantPressure;
rho rhok;
value uniform 0;
type calculated;
value $internalField;
}
fixedWalls
{
type buoyantPressure;
rho rhok;
value uniform 0;
type calculated;
value $internalField;
}
}

View File

@ -5,6 +5,6 @@ cd ${0%/*} || exit 1 # run from this directory
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
cp 0/T.org 0/T
rm -f 0/T
# ----------------------------------------------------------------- end-of-file

View File

@ -8,6 +8,7 @@ application=`getApplication`
compileApplication ../../buoyantPimpleFoam/hotRoom/setHotRoom
runApplication blockMesh
cp 0/T.org 0/T
runApplication setHotRoom
runApplication $application

View File

@ -45,5 +45,25 @@ timePrecision 6;
runTimeModifiable true;
functions
{
residualControl1
{
type residualControl;
functionObjectLibs ( "libjobControl.so" );
outputControl timeStep;
outputInterval 1;
maxResiduals
{
p_rgh 1e-2;
U 1e-4;
T 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
}
}
// ************************************************************************* //

View File

@ -37,17 +37,15 @@ solvers
SIMPLE
{
nNonOrthogonalCorrectors 0;
p_rghRefCell 0;
p_rghRefValue 0;
pRefCell 0;
pRefValue 0;
}
relaxationFactors
{
rho 1;
p_rgh 0.7;
U 0.2;
T 0.7;
T 0.5;
"(k|epsilon|R)" 0.7;
}

View File

@ -22,30 +22,26 @@ boundaryField
{
ground
{
type buoyantPressure;
rho rhok;
value uniform 0;
type calculated;
value $internalField;
}
igloo_region0
{
type buoyantPressure;
rho rhok;
value uniform 0;
type calculated;
value $internalField;
}
twoFridgeFreezers_seal_0
{
type buoyantPressure;
rho rhok;
value uniform 0;
type calculated;
value $internalField;
}
twoFridgeFreezers_herring_1
{
type buoyantPressure;
rho rhok;
value uniform 0;
type calculated;
value $internalField;
}
}

View File

@ -21,55 +21,55 @@ FoamFile
{
type empty;
nFaces 0;
startFace 60456;
startFace 60336;
}
minX
{
type empty;
nFaces 0;
startFace 60456;
startFace 60336;
}
maxX
{
type empty;
nFaces 0;
startFace 60456;
startFace 60336;
}
minY
{
type empty;
nFaces 0;
startFace 60456;
startFace 60336;
}
ground
{
type wall;
nFaces 590;
startFace 60456;
startFace 60336;
}
maxZ
{
type empty;
nFaces 0;
startFace 61046;
startFace 60926;
}
igloo_region0
{
type wall;
nFaces 2260;
startFace 61046;
startFace 60926;
}
twoFridgeFreezers_seal_0
{
type wall;
nFaces 1344;
startFace 63306;
startFace 63186;
}
twoFridgeFreezers_herring_1
{
type wall;
nFaces 1116;
startFace 64650;
startFace 64530;
}
)

View File

@ -45,5 +45,25 @@ timePrecision 6;
runTimeModifiable true;
functions
{
residualControl1
{
type residualControl;
functionObjectLibs ( "libjobControl.so" );
outputControl timeStep;
outputInterval 1;
maxResiduals
{
p_rgh 1e-2;
U 1e-4;
T 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
}
}
// ************************************************************************* //

View File

@ -37,16 +37,15 @@ solvers
SIMPLE
{
nNonOrthogonalCorrectors 0;
p_rghRefCell 0;
p_rghRefValue 0;
pRefCell 0;
pRefValue 0;
}
relaxationFactors
{
p_rgh 0.8;
p_rgh 0.7;
U 0.2;
T 0.7;
T 0.5;
"(k|epsilon)" 0.7;
}

View File

@ -22,20 +22,20 @@ boundaryField
{
floor
{
type buoyantPressure;
value uniform 1e5;
type calculated;
value $internalField;
}
ceiling
{
type buoyantPressure;
value uniform 1e5;
type calculated;
value $internalField;
}
fixedWalls
{
type buoyantPressure;
value uniform 1e5;
type calculated;
value $internalField;
}
}

View File

@ -10,29 +10,32 @@ FoamFile
version 2.0;
format ascii;
class volScalarField;
object T;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 300;
internalField uniform 1e5;
boundaryField
{
floor
{
type fixedValue;
value uniform 300;
type buoyantPressure;
value uniform 1e5;
}
ceiling
{
type fixedValue;
value uniform 300;
type buoyantPressure;
value uniform 1e5;
}
fixedWalls
{
type zeroGradient;
type buoyantPressure;
value uniform 1e5;
}
}

View File

@ -42,7 +42,7 @@ laplacianSchemes
{
default none;
laplacian(muEff,U) Gauss linear corrected;
laplacian((rho*(1|A(U))),p) Gauss linear corrected;
laplacian((rho*(1|A(U))),p_rgh) Gauss linear corrected;
laplacian(alphaEff,h) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
@ -62,7 +62,7 @@ snGradSchemes
fluxRequired
{
default no;
p ;
p_rgh;
}

View File

@ -25,17 +25,17 @@ solvers
relTol 0;
}
p
p_rgh
{
solver PCG;
preconditioner DIC;
tolerance 1e-8;
relTol 0.1;
relTol 0.01;
}
pFinal
p_rghFinal
{
$p;
$p_rgh;
relTol 0;
}
@ -44,7 +44,7 @@ solvers
solver PBiCG;
preconditioner DILU;
tolerance 1e-6;
relTol 0;
relTol 0.1;
}
"(U|h|k|epsilon|R)Final"
@ -56,7 +56,7 @@ solvers
PIMPLE
{
momentumPredictor no;
momentumPredictor yes;
nOuterCorrectors 1;
nCorrectors 2;
nNonOrthogonalCorrectors 0;

View File

@ -23,26 +23,26 @@ boundaryField
{
frontAndBack
{
type buoyantPressure;
value uniform 1e5;
type calculated;
value $internalField;
}
topAndBottom
{
type buoyantPressure;
value uniform 1e5;
type calculated;
value $internalField;
}
hot
{
type buoyantPressure;
value uniform 1e5;
type calculated;
value $internalField;
}
cold
{
type buoyantPressure;
value uniform 1e5;
type calculated;
value $internalField;
}
}

View File

@ -44,5 +44,25 @@ timePrecision 6;
runTimeModifiable true;
functions
{
residualControl1
{
type residualControl;
functionObjectLibs ( "libjobControl.so" );
outputControl timeStep;
outputInterval 1;
maxResiduals
{
p_rgh 1e-2;
U 1e-3;
h 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
}
}
// ************************************************************************* //

View File

@ -44,17 +44,16 @@ SIMPLE
{
momentumPredictor yes;
nNonOrthogonalCorrectors 0;
p_rghRefCell 0;
p_rghRefValue 100000;
pRefValue 100000;
convergence 1e-04;
pRefCell 0;
pRefValue 0;
}
relaxationFactors
{
p_rgh 0.9;
rho 1.0;
p_rgh 0.7;
U 0.3;
h 0.7;
h 0.3;
"(k|epsilon|omega)" 0.7;
}

View File

@ -23,411 +23,7 @@ boundaryField
floor
{
type fixedValue;
value nonuniform List<scalar>
400
(
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
600
600
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
600
600
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
)
;
value uniform 300;
}
ceiling
{

View File

@ -23,411 +23,7 @@ boundaryField
floor
{
type fixedValue;
value nonuniform List<scalar>
400
(
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
600
600
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
600
600
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
300
)
;
value uniform 300;
}
ceiling
{

View File

@ -22,20 +22,20 @@ boundaryField
{
floor
{
type buoyantPressure;
value uniform 1e5;
type calculated;
value $internalField;
}
ceiling
{
type buoyantPressure;
value uniform 1e5;
type calculated;
value $internalField;
}
fixedWalls
{
type buoyantPressure;
value uniform 1e5;
type calculated;
value $internalField;
}
}

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
floor
{
type buoyantPressure;
value uniform 1e5;
}
ceiling
{
type buoyantPressure;
value uniform 1e5;
}
fixedWalls
{
type buoyantPressure;
value uniform 1e5;
}
}
// ************************************************************************* //

View File

@ -45,5 +45,25 @@ timePrecision 6;
runTimeModifiable true;
functions
{
residualControl1
{
type residualControl;
functionObjectLibs ( "libjobControl.so" );
outputControl timeStep;
outputInterval 1;
maxResiduals
{
p_rgh 1e-2;
U 1e-3;
h 1e-3;
// possibly check turbulence fields
"(k|epsilon|omega)" 1e-3;
}
}
}
// ************************************************************************* //

View File

@ -40,12 +40,12 @@ divSchemes
laplacianSchemes
{
default none;
laplacian(muEff,U) Gauss linear corrected;
laplacian((rho*(1|A(U))),p) Gauss linear corrected;
laplacian(alphaEff,h) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(muEff,U) Gauss linear uncorrected;
laplacian((rho*(1|A(U))),p_rgh) Gauss linear uncorrected;
laplacian(alphaEff,h) Gauss linear uncorrected;
laplacian(DkEff,k) Gauss linear uncorrected;
laplacian(DepsilonEff,epsilon) Gauss linear uncorrected;
laplacian(DREff,R) Gauss linear uncorrected;
}
interpolationSchemes
@ -61,7 +61,7 @@ snGradSchemes
fluxRequired
{
default no;
p ;
p_rgh;
}

Some files were not shown because too many files have changed in this diff Show More