diff --git a/ReleaseNotes-dev b/ReleaseNotes-dev
index 0a6041c55b..d35d1b518e 100644
--- a/ReleaseNotes-dev
+++ b/ReleaseNotes-dev
@@ -39,13 +39,43 @@
*** DSMC
*** Dynamic Mesh
*** Numerics
+*** *Updated* command line help, e.g. `snappyHexMesh -help' now gives:
+
+ Usage: snappyHexMesh [OPTIONS]
+ options:
+ -case
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 _sidePatch
+ + extrude edges inbetween different faceZones as a
+ (nonuniformTransform)cyclic _
+ + 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
diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H b/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H
index d7a6b97ac1..360687a60d 100644
--- a/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H
+++ b/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H
@@ -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 =
- (
- pZones.size()
- && mesh.solutionDict().subDict("SIMPLE").readIfPresent
- (
- "nUCorrectors",
- nUCorr
- )
- && (nUCorr > 0)
- );
+ if (pZones.size())
+ {
+ // nUCorrectors for pressureImplicitPorosity
+ if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors"))
+ {
+ nUCorr = readInt
+ (
+ mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors")
+ );
+ }
+
+ if (nUCorr > 0)
+ {
+ pressureImplicitPorosity = true;
+ Info<< "Using pressure implicit porosity" << endl;
+ }
+ else
+ {
+ Info<< "Using pressure explicit porosity" << endl;
+ }
+ }
+
diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/hEqn.H b/applications/solvers/compressible/rhoPorousSimpleFoam/hEqn.H
index ff0b91bcb7..9e5138de8a 100644
--- a/applications/solvers/compressible/rhoPorousSimpleFoam/hEqn.H
+++ b/applications/solvers/compressible/rhoPorousSimpleFoam/hEqn.H
@@ -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);
diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPorousSimpleFoam/pEqn.H
index 0386899612..40b7cb3969 100644
--- a/applications/solvers/compressible/rhoPorousSimpleFoam/pEqn.H
+++ b/applications/solvers/compressible/rhoPorousSimpleFoam/pEqn.H
@@ -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;
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H
index dbfc61739f..9a835792a4 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/TEqn.H
@@ -12,7 +12,7 @@
);
TEqn.relax();
- TEqn.solve();
+ TEqn.solve(mesh.solver(T.select(finalIter)));
rhok = 1.0 - beta*(T - TRef);
}
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H
index 35387f4ff4..20a05e5cd4 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/UEqn.H
@@ -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))
);
}
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C
index ebf68d409c..54519906a4 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C
@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
if (nOuterCorr != 1)
{
- p.storePrevIter();
+ p_rgh.storePrevIter();
}
#include "UEqn.H"
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H
index 23d20cfa96..342af079d8 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/createFields.H
@@ -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
- (
- IOobject
+ if (p_rgh.needReference())
+ {
+ p += dimensionedScalar
(
- "rhok",
- runTime.timeName(),
- mesh
- ),
- 1.0 - beta*(T - TRef)
- );
+ "p",
+ p.dimensions(),
+ pRefValue - getRefCellValue(p, pRefCell)
+ );
+ }
+
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H
index 21be033f9b..60828e18dc 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/pEqn.H
@@ -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;
+ }
}
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H
index 76cc4da8ba..477a322833 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/createFields.H
@@ -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)
);
}
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H
index 5664bb2154..50149ed360 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/pEqn.H
@@ -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();
- }
+ 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;
}
}
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H
index d4878d063d..8c6a3f7671 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H
@@ -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))
);
}
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C
index 0075c1e3ed..cb4c4d34f6 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C
@@ -80,7 +80,7 @@ int main(int argc, char *argv[])
if (nOuterCorr != 1)
{
- p.storePrevIter();
+ p_rgh.storePrevIter();
}
#include "UEqn.H"
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H
index b8ac5595e4..e39d0bb803 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H
@@ -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());
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H
index 3125cc3ffa..94537508b3 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/hEqn.H
@@ -9,7 +9,7 @@
);
hEqn.relax();
- hEqn.solve();
+ hEqn.solve(mesh.solver(h.select(finalIter)));
thermo.correct();
}
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H
index a1c3dbfed5..e625f122a3 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H
@@ -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;
- }
}
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C
index 06fa5d12a0..64cc110cec 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C
@@ -62,10 +62,7 @@ int main(int argc, char *argv[])
{
#include "UEqn.H"
#include "hEqn.H"
- for (int i=0; i<3; i++)
- {
#include "pEqn.H"
- }
}
turbulence->correct();
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H
index cf23150332..d6fa9acee9 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H
@@ -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 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();
- p_rgh = p - rho*gh;
-
- label p_rghRefCell = 0;
- scalar p_rghRefValue = 0.0;
- setRefCell
+ Info<< "Reading field p_rgh\n" << endl;
+ volScalarField p_rgh
(
- p_rgh,
- mesh.solutionDict().subDict("SIMPLE"),
- p_rghRefCell,
- p_rghRefValue
+ 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 pRefCell = 0;
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)
- );
- }
+ setRefCell
+ (
+ p,
+ p_rgh,
+ mesh.solutionDict().subDict("SIMPLE"),
+ pRefCell,
+ pRefValue
+ );
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
+ dimensionedScalar totalVolume = sum(mesh.V());
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H
index 3088b42c69..f1a62d4770 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H
@@ -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();
diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
index 0dbe80c67c..6c35536333 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
+++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
#include "readSIMPLEControls.H"
- p.storePrevIter();
+ p_rgh.storePrevIter();
rho.storePrevIter();
// Pressure-velocity SIMPLE corrector
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C
index a81b0faaf3..36b3f1c3b0 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C
@@ -93,6 +93,8 @@ int main(int argc, char *argv[])
// --- PIMPLE loop
for (int oCorr=0; oCorr phiFluid(fluidRegions.size());
PtrList gFluid(fluidRegions.size());
PtrList turbulence(fluidRegions.size());
- PtrList DpDtf(fluidRegions.size());
+ PtrList p_rghFluid(fluidRegions.size());
+ PtrList ghFluid(fluidRegions.size());
+ PtrList ghfFluid(fluidRegions.size());
List initialMassFluid(fluidRegions.size());
List