v2406: New and improved numerics
The energy equation now includes the effect of the work done by the MRF, similar to the contribution employed when performing moving mesh calculations. The additional term takes the form:
if (MRF.active())
{
EEqn += fvc::div(MRF.phi(), p);
}
This change requires an additional entry in the <case>/fvSchemes file, e.g.
div(phiMRF,p) Gauss limitedLinear 1;
The effect can be seen on the total temperature prediction below for a compressor case, where the left image shows the earlier behaviour (v2312 and earlier) and the new behaviour (right)
Tutorial
Source code
Gitlab
In OpenFOAM-v2406 important first steps have been taken to enable future support of multiple finite-area regions.
Unfortunately these changes will require some adjustment to workflows that use finite-area (other workflows are unaffected). Although we at OpenCFD do try our very best to avoid interrupting workflows, there are occasional times that this becomes unavoidable.
To assist the user in upgrading a finite-area case setup, the bin/foamUpgradeFiniteArea script is provided:
Usage: foamUpgradeFiniteArea [OPTION]
options:
-case=DIR Specify starting directory, default is cwd
-dry-run | -n Test without performing actions
-verbose | -v Additional verbosity
-link-back Link back from new finite-area/ to old locations
-no-mesh Do not move system/faMeshDefinition
-git Use 'git mv' when making changes
-help Print help and exit
Relocate finite-area files to new sub-directory locations
This is fortunately less complicated than it sounds - there is now simply an additional finite-area subdirectory
old location | new location |
---|---|
0/{areafield} | 0/finite-area/{areafield} |
constant/faMesh/ | constant/finite-area/faMesh/ |
system/faMeshDefinition | system/finite-area/faMeshDefinition |
system/faSchemes | system/finite-area/faSchemes |
system/faSolution | system/finite-area/faSolution |
For code developers, there is not much change either. It is only important that area fields are registered in the correct location:
// Good, uses area mesh thisDb()
areaScalarField h
(
IOobject
(
"h",
runTime.timeName(),
aMesh.thisDb(),
// ^-- works with v2312, v2406, ...
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
aMesh
);
As usual, more information can be found in the user upgrade and developer upgrade guides.
Tutorials
- $FOAM_TUTORIALS/compressible/acousticFoam/obliqueAirJet/main
- $FOAM_TUTORIALS/finiteArea/liquidFilmFoam/cylinder
- $FOAM_TUTORIALS/finiteArea/sphereSurfactantFoam/sphereTransport
- $FOAM_TUTORIALS/finiteArea/surfactantFoam/planeTransport
- $FOAM_TUTORIALS/heatTransfer/buoyantPimpleFoam/hotRoomWithThermalShell
- $FOAM_TUTORIALS/incompressible/adjointOptimisationFoam/sensitivityMaps/motorBike
- $FOAM_TUTORIALS/incompressible/pimpleFoam/laminar/contactAngleCavity
- $FOAM_TUTORIALS/incompressible/pimpleFoam/laminar/contaminatedDroplet2D
- $FOAM_TUTORIALS/incompressible/pimpleFoam/laminar/filmPanel0
- $FOAM_TUTORIALS/incompressible/pimpleFoam/laminar/inclinedPlaneFilm
- $FOAM_TUTORIALS/incompressible/pimpleFoam/laminar/sloshing2D
- $FOAM_TUTORIALS/incompressible/simpleFoam/motorBike/system/finite-area/faSchemes
- $FOAM_TUTORIALS/lagrangian/kinematicParcelFoam/drippingChair
- $FOAM_TUTORIALS/lagrangian/kinematicParcelFoam/pitzDailyWithSprinklers
- $FOAM_TUTORIALS/lagrangian/reactingParcelFoam/liquidFilmStepWithSprinklers
- $FOAM_TUTORIALS/lagrangian/reactingParcelFoam/splashPanelFilm