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 *** DSMC
*** Dynamic Mesh *** Dynamic Mesh
*** Numerics *** 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 * Solvers
A number of new solvers have been developed for a range of engineering 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 applications. There has been a set of improvements to certain classes of
solver that are introduced in this release. solver that are introduced in this release.
*** *New* Solvers *** *New* Solvers
+ ... + =reactingParcelFilmFoam=: Lagrangian cloud and film transport in a
reacting gas phase system
*** Modifications to multiphase and buoyant solvers *** Modifications to multiphase and buoyant solvers
+ ... + ...
*** Modifications to solvers for sensible enthalpy *** Modifications to solvers for sensible enthalpy
@ -58,23 +88,43 @@
* Boundary conditions * Boundary conditions
New boundary conditions have been introduced to support new applications in New boundary conditions have been introduced to support new applications in
OpenFOAM. OpenFOAM.
+ ... + *New* wall functions:
+ kappatJayatillekeWallFunction: incompressible RAS thermal wall function
* Utilities * Utilities
There have been some utilities added and updated in this release. There have been some utilities added and updated in this release.
*** *New* utilities *** *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 *** Updated utilities
+ ... + ...
* Post-processing * Post-processing
+ =foamToEnsight=: new =-nodeValues= option to generate and output nodal + =foamToEnsight=: new =-nodeValues= option to generate and output nodal
field data. This is optional and saves memory (compared to letting EnSight field data.
do the interpolation) in case of meshes with large + Function objects:
amounts of polyhedral cells. On typical snappyHexMesh generated meshes + =residualControl=: new function object to allow users to terminate steady
we've seen differences of 0.4 v.s. 2.5Gb memory usage. 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 * New tutorials
There is a large number of new tutorials to support the new solvers in the There is a large number of new tutorials to support the new solvers in the
release. release.
+ ... + =reactingParcelFilmFoam= tutorials:
+ multipleBoxes, hotBoxes, panel, evaporationTest

View File

@ -45,14 +45,9 @@
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue);
dimensionedScalar rhoMax dimensionedScalar pMin
( (
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMax") mesh.solutionDict().subDict("SIMPLE").lookup("pMin")
);
dimensionedScalar rhoMin
(
mesh.solutionDict().subDict("SIMPLE").lookup("rhoMin")
); );
Info<< "Creating turbulence model\n" << endl; Info<< "Creating turbulence model\n" << endl;
@ -70,16 +65,29 @@
dimensionedScalar initialMass = fvc::domainIntegrate(rho); dimensionedScalar initialMass = fvc::domainIntegrate(rho);
thermalPorousZones pZones(mesh); thermalPorousZones pZones(mesh);
Switch pressureImplicitPorosity(false);
// nUCorrectors used for pressureImplicitPorosity // nUCorrectors used for pressureImplicitPorosity
int nUCorr = 0; int nUCorr = 0;
const bool pressureImplicitPorosity = if (pZones.size())
( {
pZones.size() // nUCorrectors for pressureImplicitPorosity
&& mesh.solutionDict().subDict("SIMPLE").readIfPresent if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
( {
"nUCorrectors", nUCorr = readInt
nUCorr (
) mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
&& (nUCorr > 0) );
); }
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::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h) - fvm::laplacian(turbulence->alphaEff(), h)
== ==
fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)") fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p, "div(U,p)"))
- (rho/psi)*fvc::div(phi/fvc::interpolate(rho)) - p*fvc::div(phi/fvc::interpolate(rho))
); );
pZones.addEnthalpySource(thermo, rho, hEqn); 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) if (pressureImplicitPorosity)
{ {
U = trTU()&UEqn().H(); U = trTU()&UEqn().H();
@ -63,6 +58,8 @@ else
U.correctBoundaryConditions(); U.correctBoundaryConditions();
bound(p, pMin);
// For closed-volume cases adjust the pressure and density levels // For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity // to obey overall mass continuity
if (closedVolume) if (closedVolume)
@ -72,7 +69,5 @@ if (closedVolume)
} }
rho = thermo.rho(); rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax(); rho.relax();
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;

View File

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

View File

@ -18,9 +18,10 @@
fvc::reconstruct fvc::reconstruct
( (
( (
fvc::interpolate(rhok)*(g & mesh.Sf()) - ghf*fvc::snGrad(rhok)
- fvc::snGrad(p)*mesh.magSf() - 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) if (nOuterCorr != 1)
{ {
p.storePrevIter(); p_rgh.storePrevIter();
} }
#include "UEqn.H" #include "UEqn.H"

View File

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

View File

@ -7,22 +7,23 @@
phi = (fvc::interpolate(U) & mesh.Sf()) phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi); + fvc::ddtPhiCorr(rUA, U, phi);
surfaceScalarField buoyancyPhi = surfaceScalarField buoyancyPhi = rUAf*ghf*fvc::snGrad(rhok)*mesh.magSf();
rUAf*fvc::interpolate(rhok)*(g & mesh.Sf()); phi -= buoyancyPhi;
phi += buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) 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 mesh.solver
( (
p.select p_rgh.select
( (
( (
finalIter finalIter
@ -36,17 +37,30 @@
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
// Calculate the conservative fluxes // Calculate the conservative fluxes
phi -= pEqn.flux(); phi -= p_rghEqn.flux();
// Explicitly relax pressure for momentum corrector // Explicitly relax pressure for momentum corrector
p.relax(); p_rgh.relax();
// Correct the momentum source with the pressure gradient flux // Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure // calculated from the relaxed pressure
U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rUAf); U -= rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rUAf);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
} }
} }
#include "continuityErrs.H" #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 p_rgh + rhok*gh
); );
label p_rghRefCell = 0; label pRefCell = 0;
scalar p_rghRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell setRefCell
( (
p,
p_rgh, p_rgh,
mesh.solutionDict().subDict("SIMPLE"), mesh.solutionDict().subDict("SIMPLE"),
p_rghRefCell, pRefCell,
p_rghRefValue pRefValue
); );
scalar pRefValue = 0.0;
if (p_rgh.needReference()) if (p_rgh.needReference())
{ {
pRefValue = readScalar
(
mesh.solutionDict().subDict("SIMPLE").lookup("pRefValue")
);
p += dimensionedScalar p += dimensionedScalar
( (
"p", "p",
p.dimensions(), 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) 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 p_rghEqn.solve();
if (nonOrth == 0)
{
p_rghEqn.solve();
}
else
{
p_rghEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
@ -55,7 +47,8 @@
( (
"p", "p",
p.dimensions(), 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::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) if (nOuterCorr != 1)
{ {
p.storePrevIter(); p_rgh.storePrevIter();
} }
#include "UEqn.H" #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; Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt volScalarField DpDt
( (
"DpDt", "DpDt",
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) 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.relax();
hEqn.solve(); hEqn.solve(mesh.solver(h.select(finalIter)));
thermo.correct(); thermo.correct();
} }

View File

@ -1,11 +1,9 @@
{ {
bool closedVolume = p.needReference();
rho = thermo.rho(); rho = thermo.rho();
// Thermodynamic density needs to be updated by psi*d(p) after the // Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution - done in 2 parts. Part 1: // pressure solution - done in 2 parts. Part 1:
thermo.rho() -= psi*p; thermo.rho() -= psi*p_rgh;
volScalarField rUA = 1.0/UEqn.A(); volScalarField rUA = 1.0/UEqn.A();
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA)); surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
@ -18,24 +16,23 @@
+ fvc::ddtPhiCorr(rUA, rho, U, phi) + fvc::ddtPhiCorr(rUA, rho, U, phi)
); );
surfaceScalarField buoyancyPhi = surfaceScalarField buoyancyPhi = -rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf();
rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf());
phi += buoyancyPhi; phi += buoyancyPhi;
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) 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) + fvc::div(phi)
- fvm::laplacian(rhorUAf, p) - fvm::laplacian(rhorUAf, p_rgh)
); );
pEqn.solve p_rghEqn.solve
( (
mesh.solver mesh.solver
( (
p.select p_rgh.select
( (
( (
finalIter finalIter
@ -49,34 +46,25 @@
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
// Calculate the conservative fluxes // Calculate the conservative fluxes
phi += pEqn.flux(); phi += p_rghEqn.flux();
// Explicitly relax pressure for momentum corrector // Explicitly relax pressure for momentum corrector
p.relax(); p_rgh.relax();
// Correct the momentum source with the pressure gradient flux // Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure // calculated from the relaxed pressure
U += rUA*fvc::reconstruct((buoyancyPhi + pEqn.flux())/rhorUAf); U += rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorUAf);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
} }
} }
p = p_rgh + rho*gh;
// Second part of thermodynamic density update // 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); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
#include "rhoEqn.H" #include "rhoEqn.H"
#include "compressibleContinuityErrs.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,10 +62,7 @@ int main(int argc, char *argv[])
{ {
#include "UEqn.H" #include "UEqn.H"
#include "hEqn.H" #include "hEqn.H"
for (int i=0; i<3; i++)
{
#include "pEqn.H" #include "pEqn.H"
}
} }
turbulence->correct(); turbulence->correct();

View File

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

View File

@ -1,11 +1,12 @@
{ {
rho = thermo.rho(); rho = thermo.rho();
rho.relax();
volScalarField rUA = 1.0/UEqn().A(); volScalarField rUA = 1.0/UEqn().A();
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA)); surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
U = rUA*UEqn().H(); U = rUA*UEqn().H();
//UEqn.clear(); UEqn.clear();
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
bool closedVolume = adjustPhi(phi, U, p_rgh); bool closedVolume = adjustPhi(phi, U, p_rgh);
@ -20,7 +21,7 @@
fvm::laplacian(rhorUAf, p_rgh) == fvc::div(phi) 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(); p_rghEqn.solve();
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
@ -42,13 +43,13 @@
p = p_rgh + rho*gh; 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 // to obey overall mass continuity
if (closedVolume) if (closedVolume)
{ {
p += (initialMass - fvc::domainIntegrate(psi*p)) p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi); /fvc::domainIntegrate(psi);
p_rgh == p - rho*gh; p_rgh = p - rho*gh;
} }
rho = thermo.rho(); rho = thermo.rho();

View File

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

View File

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

View File

@ -13,7 +13,9 @@
== ==
fvc::reconstruct 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<surfaceScalarField> phiFluid(fluidRegions.size());
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size()); PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
PtrList<compressible::turbulenceModel> turbulence(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<scalar> initialMassFluid(fluidRegions.size());
List<label> pRefCellFluid(fluidRegions.size(),0); List<label> pRefCellFluid(fluidRegions.size(),0);
List<scalar> pRefValueFluid(fluidRegions.size(),0.0); List<scalar> pRefValueFluid(fluidRegions.size(),0.0);
PtrList<dimensionedScalar> rhoMax(fluidRegions.size());
PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
// Populate fluid field pointer lists // Populate fluid field pointer lists
forAll(fluidRegions, i) forAll(fluidRegions, i)
@ -130,15 +134,74 @@
).ptr() ).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(); initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
setRefCell setRefCell
( (
thermoFluid[i].p(), thermoFluid[i].p(),
p_rghFluid[i],
fluidRegions[i].solutionDict().subDict("SIMPLE"), fluidRegions[i].solutionDict().subDict("SIMPLE"),
pRefCellFluid[i], pRefCellFluid[i],
pRefValueFluid[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::Sp(fvc::div(phi), h)
- fvm::laplacian(turb.alphaEff(), h) - fvm::laplacian(turb.alphaEff(), h)
== ==
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p)) fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)")
- p*fvc::div(phi/fvc::interpolate(rho)) - (rho/psi)*fvc::div(phi/fvc::interpolate(rho))
); );
hEqn.relax(); hEqn.relax();

View File

@ -1,7 +1,9 @@
{ {
// From buoyantSimpleFoam // From buoyantSimpleFoam
rho = thermo.rho(); rho = thermo.rho();
rho = max(rho, rhoMin[i]);
rho = min(rho, rhoMax[i]);
rho.relax();
volScalarField rUA = 1.0/UEqn().A(); volScalarField rUA = 1.0/UEqn().A();
surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA)); surfaceScalarField rhorUAf("(rho*(1|A(U)))", fvc::interpolate(rho*rUA));
@ -10,59 +12,54 @@
UEqn.clear(); UEqn.clear();
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
bool closedVolume = adjustPhi(phi, U, p); bool closedVolume = adjustPhi(phi, U, p_rgh);
surfaceScalarField buoyancyPhi = surfaceScalarField buoyancyPhi = rhorUAf*ghf*fvc::snGrad(rho)*mesh.magSf();
rhorUAf*fvc::interpolate(rho)*(g & mesh.Sf()); phi -= buoyancyPhi;
phi += buoyancyPhi;
// Solve pressure // Solve pressure
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) 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 p_rghEqn.solve();
if (nonOrth == 0)
{
pEqn.solve();
}
else
{
pEqn.solve();
}
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
// 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);
}
// Calculate the conservative fluxes // Calculate the conservative fluxes
phi -= pEqn.flux(); phi -= p_rghEqn.flux();
// Explicitly relax pressure for momentum corrector // Explicitly relax pressure for momentum corrector
p.relax(); p_rgh.relax();
// Correct the momentum source with the pressure gradient flux // Correct the momentum source with the pressure gradient flux
// calculated from the relaxed pressure // calculated from the relaxed pressure
U += rUA*fvc::reconstruct((buoyancyPhi - pEqn.flux())/rhorUAf); U -= rUA*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorUAf);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
} }
} }
p = p_rgh + rho*gh;
#include "continuityErrs.H" #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;
}
rho = thermo.rho(); rho = thermo.rho();
rho = max(rho, rhoMin[i]);
rho = min(rho, rhoMax[i]);
rho.relax(); rho.relax();
Info<< "Min/max rho:" << min(rho).value() << ' ' Info<< "Min/max rho:" << min(rho).value() << ' '

View File

@ -5,7 +5,6 @@
volScalarField& K = KFluid[i]; volScalarField& K = KFluid[i];
volVectorField& U = UFluid[i]; volVectorField& U = UFluid[i];
surfaceScalarField& phi = phiFluid[i]; surfaceScalarField& phi = phiFluid[i];
const dimensionedVector& g = gFluid[i];
compressible::turbulenceModel& turb = turbulence[i]; compressible::turbulenceModel& turb = turbulence[i];
@ -22,3 +21,7 @@
const label pRefCell = pRefCellFluid[i]; const label pRefCell = pRefCellFluid[i];
const scalar pRefValue = pRefValueFluid[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 // Pressure-velocity SIMPLE corrector
p.storePrevIter(); p_rgh.storePrevIter();
rho.storePrevIter(); rho.storePrevIter();
{ {
#include "UEqn.H" #include "UEqn.H"

View File

@ -16,8 +16,11 @@
== ==
fvc::reconstruct 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<surfaceScalarField> phiFluid(fluidRegions.size());
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size()); PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
PtrList<compressible::turbulenceModel> turbulence(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()); PtrList<volScalarField> DpDtFluid(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size()); List<scalar> initialMassFluid(fluidRegions.size());
@ -129,6 +132,42 @@
).ptr() ).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; Info<< " Adding to DpDtFluid\n" << endl;
DpDtFluid.set DpDtFluid.set
( (
@ -147,6 +186,4 @@
) )
) )
); );
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
} }

View File

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

View File

@ -1,5 +1,5 @@
{ {
bool closedVolume = p.needReference(); bool closedVolume = p_rgh.needReference();
rho = thermo.rho(); 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++) 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) + fvc::div(phi)
- fvm::laplacian(rhorUAf, p) - fvm::laplacian(rhorUAf, p_rgh)
); );
if p_rghEqn.solve
( (
oCorr == nOuterCorr-1 mesh.solver
&& corr == nCorr-1 (
&& nonOrth == nNonOrthCorr p_rgh.select
) (
{ (
pEqn.solve(mesh.solver(p.name() + "Final")); oCorr == nOuterCorr-1
} && corr == nCorr-1
else && nonOrth == nNonOrthCorr
{ )
pEqn.solve(mesh.solver(p.name())); )
} )
);
if (nonOrth == nNonOrthCorr) if (nonOrth == nNonOrthCorr)
{ {
phi += pEqn.flux(); phi += p_rghEqn.flux();
} }
} }
@ -52,6 +53,8 @@
U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf); U += rUA*fvc::reconstruct((phi - phiU)/rhorUAf);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
p = p_rgh + rho*gh;
// Update pressure substantive derivative // Update pressure substantive derivative
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
@ -65,9 +68,10 @@
// to obey overall mass continuity // to obey overall mass continuity
if (closedVolume) if (closedVolume)
{ {
p += (massIni - fvc::domainIntegrate(psi*p)) p += (initialMass - fvc::domainIntegrate(psi*p))
/fvc::domainIntegrate(psi); /fvc::domainIntegrate(psi);
rho = thermo.rho(); rho = thermo.rho();
p_rgh = p - rho*gh;
} }
// Update thermal conductivity // 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]; basicPsiThermo& thermo = thermoFluid[i];
volScalarField& rho = rhoFluid[i]; volScalarField& rho = rhoFluid[i];
volScalarField& K = KFluid[i]; volScalarField& K = KFluid[i];
volVectorField& U = UFluid[i]; volVectorField& U = UFluid[i];
surfaceScalarField& phi = phiFluid[i]; surfaceScalarField& phi = phiFluid[i];
const dimensionedVector& g = gFluid[i];
compressible::turbulenceModel& turb = turbulence[i]; compressible::turbulenceModel& turb = turbulence[i];
volScalarField& DpDt = DpDtFluid[i]; volScalarField& DpDt = DpDtFluid[i];
@ -14,4 +13,13 @@
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
volScalarField& h = thermo.h(); 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) if (oCorr == 0)
{ {
#include "rhoEqn.H" #include "rhoEqn.H"
@ -16,3 +21,8 @@ for (int corr=0; corr<nCorr; corr++)
turb.correct(); turb.correct();
rho = thermo.rho(); rho = thermo.rho();
if (finalIter)
{
mesh.data::remove("finalIteration");
}

View File

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

View File

@ -8,9 +8,5 @@
<< solidRegions[i].name() << nl << endl; << solidRegions[i].name() << nl << endl;
Info<< " Adding to thermos\n" << endl; Info<< " Adding to thermos\n" << endl;
thermos.set thermos.set(i, basicSolidThermo::New(solidRegions[i]));
(
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++) for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{ {
@ -7,8 +12,13 @@
- fvm::laplacian(K, T) - fvm::laplacian(K, T)
); );
TEqn().relax(); TEqn().relax();
TEqn().solve(); TEqn().solve(mesh.solver(T.select(finalIter)));
} }
Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl; Info<< "Min/max T:" << min(T) << ' ' << max(T) << endl;
} }
if (finalIter)
{
mesh.data::remove("finalIteration");
}

View File

@ -13,5 +13,5 @@
if (momentumPredictor) 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" #include "rhoEqn.H"
// --- PIMPLE loop // --- 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 "UEqn.H"
#include "YEqn.H" #include "YEqn.H"
#include "hsEqn.H" #include "hsEqn.H"
// --- PISO loop // --- PISO loop
for (int corr=1; corr<=nCorr; corr++) for (int corr=0; corr<nCorr; corr++)
{ {
#include "pEqn.H" #include "pEqn.H"
} }
if (finalIter)
{
mesh.data::remove("finalIteration");
}
} }
turbulence->correct(); turbulence->correct();

View File

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

View File

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

View File

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

View File

@ -121,12 +121,16 @@ void Foam::Cloud<ParticleType>::initCloud(const bool checkClass)
} }
else else
{ {
WarningIn("Cloud<ParticleType>::initCloud(const bool checkClass)") Pout<< "Cannot read particle positions file " << nl
<< "Cannot read particle positions file " << nl
<< " " << ioP.path() << nl << " " << ioP.path() << nl
<< " assuming the initial cloud contains 0 particles." << endl; << " 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) forAllIter(typename Cloud<ParticleType>, *this, pIter)
{ {
ParticleType& p = pIter(); ParticleType& p = pIter();

View File

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

View File

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

View File

@ -1,4 +1,9 @@
thermalPorousZone/thermalPorousZone.C thermalPorousZone/thermalPorousZone.C
thermalPorousZone/thermalPorousZones.C thermalPorousZone/thermalPorousZones.C
thermalModel/thermalModel/thermalModel.C
thermalModel/thermalModel/thermalModelNew.C
thermalModel/fixedTemperature/fixedTemperature.C
thermalModel/noThermalModel/noThermalModel.C
LIB = $(FOAM_LIBBIN)/libthermalPorousZone 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 "thermalPorousZone.H"
#include "fvMesh.H"
#include "fvMatrices.H"
#include "basicThermo.H" #include "basicThermo.H"
#include "volFields.H"
#include "fvMatrices.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -38,29 +38,8 @@ Foam::thermalPorousZone::thermalPorousZone
) )
: :
porousZone(key, mesh, dict), porousZone(key, mesh, dict),
T_("T", dimTemperature, -GREAT) model_(thermalModel::New(*this))
{ {}
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);
}
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -72,29 +51,7 @@ void Foam::thermalPorousZone::addEnthalpySource
fvScalarMatrix& hEqn fvScalarMatrix& hEqn
) const ) const
{ {
const labelList& zones = this->zoneIds(); model_->addEnthalpySource(thermo, rho, hEqn);
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();
}
}
} }

View File

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

View File

@ -231,19 +231,17 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs()
scalar P = Psmooth(Prat); scalar P = Psmooth(Prat);
scalar yPlusTherm = this->yPlusTherm(P, Prat); scalar yPlusTherm = this->yPlusTherm(P, Prat);
// Evaluate new effective thermal diffusivity // Update turbulent thermal conductivity
scalar kappaEff = 0.0; if (yPlus > yPlusTherm)
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 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(); fixedValueFvPatchField<scalar>::updateCoeffs();

View File

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

View File

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

View File

@ -32,7 +32,7 @@ solvers
relTol 0.0; relTol 0.0;
} }
"(U|Yi|h|k|epsilon)" "(U|Yi|hs|k|epsilon)"
{ {
solver PBiCG; solver PBiCG;
preconditioner DILU; 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>>>>>; 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; solver PCG;
preconditioner DIC; preconditioner DIC;
tolerance 1e-5; tolerance 1e-5;
relTol 0.1;
}
rhoFinal
{
$rho;
tolerance 1e-5;
relTol 0; relTol 0;
} }
@ -65,7 +72,7 @@ solvers
mergeLevels 1; mergeLevels 1;
} }
h "(U|h|k|epsilon)"
{ {
solver PBiCG; solver PBiCG;
preconditioner DILU; preconditioner DILU;
@ -73,26 +80,9 @@ solvers
relTol 0.1; relTol 0.1;
} }
hFinal "(U|h|k|epsilon)Final"
{ {
solver PBiCG; $U;
preconditioner DILU;
tolerance 1e-5;
relTol 0;
}
k
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-5;
relTol 0;
}
epsilon
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-5; tolerance 1e-5;
relTol 0; relTol 0;
} }

View File

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

View File

@ -47,5 +47,25 @@ graphFormat raw;
runTimeModifiable true; 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,h) Gauss upwind;
div(phi,epsilon) Gauss upwind; div(phi,epsilon) Gauss upwind;
div(phi,k) Gauss upwind; div(phi,k) Gauss upwind;
div(phid,p) Gauss linear;
} }
laplacianSchemes 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); f f [0 -1 0 0 0 0 0] (0 0 0);
} }
thermalModel thermalModel none; // fixedTemperature;
{
type fixedTemperature;
T T [0 0 0 1 0] 350; fixedTemperatureCoeffs
{
T 350;
} }
} }
) )

View File

@ -47,5 +47,25 @@ graphFormat raw;
runTimeModifiable true; 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,h) Gauss upwind;
div(phi,epsilon) Gauss upwind; div(phi,epsilon) Gauss upwind;
div(phi,k) Gauss upwind; div(phi,k) Gauss upwind;
div(phid,p) Gauss linear;
} }
laplacianSchemes laplacianSchemes

View File

@ -51,7 +51,7 @@ SIMPLE
{ {
nUCorrectors 2; nUCorrectors 2;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
pMin pMin [ 1 -1 -2 0 0 0 0 ] 100; pMin pMin [ 1 -1 -2 0 0 ] 100;
} }
relaxationFactors 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 floor
{ {
type fixedValue; type fixedValue;
value nonuniform List<scalar> value uniform 300;
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 ceiling
{ {

View File

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

View File

@ -10,41 +10,35 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; 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; internalField uniform 0;
boundaryField boundaryField
{ {
leftWall floor
{ {
type zeroGradient; type buoyantPressure;
} rho rhok;
rightWall
{
type zeroGradient;
}
lowerWall
{
type zeroGradient;
}
atmosphere
{
type inletOutlet;
inletValue uniform 0;
value uniform 0; 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 . $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase cleanCase
cp 0/T.org 0/T rm -f 0/T
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,5 +45,25 @@ timePrecision 6;
runTimeModifiable true; 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 SIMPLE
{ {
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
p_rghRefCell 0; pRefCell 0;
p_rghRefValue 0;
pRefValue 0; pRefValue 0;
} }
relaxationFactors relaxationFactors
{ {
rho 1;
p_rgh 0.7; p_rgh 0.7;
U 0.2; U 0.2;
T 0.7; T 0.5;
"(k|epsilon|R)" 0.7; "(k|epsilon|R)" 0.7;
} }

View File

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

View File

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

View File

@ -45,5 +45,25 @@ timePrecision 6;
runTimeModifiable true; 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 SIMPLE
{ {
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
p_rghRefCell 0; pRefCell 0;
p_rghRefValue 0;
pRefValue 0; pRefValue 0;
} }
relaxationFactors relaxationFactors
{ {
p_rgh 0.8; p_rgh 0.7;
U 0.2; U 0.2;
T 0.7; T 0.5;
"(k|epsilon)" 0.7; "(k|epsilon)" 0.7;
} }

View File

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

View File

@ -10,29 +10,32 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; 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 boundaryField
{ {
floor floor
{ {
type fixedValue; type buoyantPressure;
value uniform 300; value uniform 1e5;
} }
ceiling ceiling
{ {
type fixedValue; type buoyantPressure;
value uniform 300; value uniform 1e5;
} }
fixedWalls fixedWalls
{ {
type zeroGradient; type buoyantPressure;
value uniform 1e5;
} }
} }

View File

@ -42,7 +42,7 @@ laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear corrected; 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(alphaEff,h) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected;
@ -62,7 +62,7 @@ snGradSchemes
fluxRequired fluxRequired
{ {
default no; default no;
p ; p_rgh;
} }

View File

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

View File

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

View File

@ -44,5 +44,25 @@ timePrecision 6;
runTimeModifiable true; 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; momentumPredictor yes;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
p_rghRefCell 0; pRefCell 0;
p_rghRefValue 100000; pRefValue 0;
pRefValue 100000;
convergence 1e-04;
} }
relaxationFactors relaxationFactors
{ {
p_rgh 0.9; rho 1.0;
p_rgh 0.7;
U 0.3; U 0.3;
h 0.7; h 0.3;
"(k|epsilon|omega)" 0.7; "(k|epsilon|omega)" 0.7;
} }

View File

@ -23,411 +23,7 @@ boundaryField
floor floor
{ {
type fixedValue; type fixedValue;
value nonuniform List<scalar> value uniform 300;
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 ceiling
{ {

View File

@ -23,411 +23,7 @@ boundaryField
floor floor
{ {
type fixedValue; type fixedValue;
value nonuniform List<scalar> value uniform 300;
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 ceiling
{ {

View File

@ -22,20 +22,20 @@ boundaryField
{ {
floor floor
{ {
type buoyantPressure; type calculated;
value uniform 1e5; value $internalField;
} }
ceiling ceiling
{ {
type buoyantPressure; type calculated;
value uniform 1e5; value $internalField;
} }
fixedWalls fixedWalls
{ {
type buoyantPressure; type calculated;
value uniform 1e5; 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; 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 laplacianSchemes
{ {
default none; default none;
laplacian(muEff,U) Gauss linear corrected; laplacian(muEff,U) Gauss linear uncorrected;
laplacian((rho*(1|A(U))),p) Gauss linear corrected; laplacian((rho*(1|A(U))),p_rgh) Gauss linear uncorrected;
laplacian(alphaEff,h) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear uncorrected;
laplacian(DkEff,k) Gauss linear corrected; laplacian(DkEff,k) Gauss linear uncorrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear uncorrected;
laplacian(DREff,R) Gauss linear corrected; laplacian(DREff,R) Gauss linear uncorrected;
} }
interpolationSchemes interpolationSchemes
@ -61,7 +61,7 @@ snGradSchemes
fluxRequired fluxRequired
{ {
default no; default no;
p ; p_rgh;
} }

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