For example in the new tutorial case:
tutorials/incompressible/pimpleFoam/laminar/pitzDailyPulse
a cosine bell velocity pulse is specified at the inlet by directly defining the
code for it:
inlet
{
type uniformFixedValue;
uniformValue coded;
name pulse;
codeInclude
#{
#include "mathematicalConstants.H"
#};
code
#{
return vector
(
0.5*(1 - cos(constant::mathematical::twoPi*min(x/0.3, 1))),
0,
0
);
#};
}
which is then compiled automatically and linked into the running pimpleFoam
dynamically and executed to set the inlet velocity.
e.g. in tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/cuttingPlane
surfaceFormat vtk;
writeFormat binary;
fields (p U);
selects writing the VTK surface files in binary format which significantly
speeds-up reading of the files in paraview.
Currently binary writing is supported in VTK and EnSight formats.
These cases now check for a mesh in geometrically identical cases and
copy rather than re-generate if possible. This reduces the run-time of
the test loop by about 20 minutes.
A surface geometry file should be stored in
$FOAM_TUTORIALS/resources/geometry if it is used in multiple cases,
otherwise it should be stored locally to the case. This change enforces
that across all tutorials.
to enable the calculation of the residence time for a fluid; mainly used in HVAC
analysis. E.g. residence time of air inside a ventilated room, see the new
tutorial roomResidenceTime.
Contributed by Tobias Holzmann
Rather than defining patches for all external block faces to provide name and
type use the defaultPatch entry to collect undefined faces into a single named
and typed patch, e.g.
defaultPatch
{
name walls;
type wall;
}
If the functionObject requires an object list rather than a field list the
non-named arguments are now inserted into the object list, for example
functions
{
#includeFunc writeObjects(kEpsilon:G)
}
which is equivalent to
functions
{
#includeFunc writeObjects(objects = (kEpsilon:G))
}
For example the generation term in the k-epsilon turbulence kEpsilon:G is a
temporary field that is specifically named and registered so that it can be
looked-up be the wall-function boundary conditions and requires slightly
different handling compared to normal temporary fields which are not registered.
The tutorials/incompressible/simpleFoam/pitzDaily case now demostrates this
functionality with the addition of
cacheTemporaryObjects
(
kEpsilon:G
);
functions
{
#includeFunc writeObjects(objects = (kEpsilon:G))
}
in controlDict which caches kEpsilon:G and writes it at every write time.
Both the functionObject call context (the command line for postProcess, and the
controlDict path for run-time post-precessing) and the configuration file
context where the arguments are substituted are now printed in the error
message, e.g.
postProcess -func 'patchAverage(name=inlet, ields=(p U))'
generates the message
--> FOAM FATAL IO ERROR:
Essential value for keyword 'fields' not set in function entry
patchAverage(name=inlet, ields=(p U))
in command line postProcess -func patchAverage(name=inlet, ields=(p U))
Placeholder value is <field_names>
file: /home/dm2/henry/OpenFOAM/OpenFOAM-dev/etc/caseDicts/postProcessing/surfaceFieldValue/patchAverage from line 13 to line 17.
and with the following in controlDict
functions
{
#includeFunc patchAverage(name=inlet, ields=(p U))
}
generates the message
--> FOAM FATAL IO ERROR:
Essential value for keyword 'fields' not set in function entry
patchAverage(name=inlet, ields=(p U))
in file /home/dm2/henry/OpenFOAM/OpenFOAM-dev/tutorials/incompressible/pimpleFoam/RAS/pitzDaily/system/controlDict at line 55
Placeholder value is <field_names>
file: /home/dm2/henry/OpenFOAM/OpenFOAM-dev/etc/caseDicts/postProcessing/surfaceFieldValue/patchAverage from line 13 to line 17.
which are now read directly from the thermophysicalProperties dictionary for
consistency with non-reacting mixture thermodynamics. The species thermo and
reactions lists can still be in separate files if convenient and included into
the thermophysicalProperties file using the standard dictionary #include.
The various temporary fields used to create the nuTilda equation sources are now
internal fields to avoid unnecessary evaluation of boundary conditions, lowering
storage and reducing CPU time, particularly when running in parallel. These
temporary fields are now named with respect to the model so that they can be
cached conveniently and written as required.
The LESRegion field can now be contructed on demand if it is requested as a
cached temporary field and written out for diagnostics if needed, for example in
the tutorials/incompressible/pisoFoam/LES/motorBike tutorial:
cacheTemporaryObjects
(
SpalartAllmarasDDES:LESRegion
);
functions
{
writeCachedObjects
{
type writeObjects;
libs ("libutilityFunctionObjects.so");
writeControl writeTime;
writeOption anyWrite;
objects
(
SpalartAllmarasDDES:LESRegion
);
}
#include "cuttingPlane"
#include "streamLines"
#include "forceCoeffs"
}
All wall functions now operate collaboratively, obtaining the Cmu, kappa and E
coefficients and yPlusLam from the nutWallFunction base class. Now these
optional inputs need only be specified in the nut boundary condition with the k,
epsilon, omega, v2 and f wall functions obtaining these values from there. This
is much simpler to specify and avoids inconsistencies in the operation of the
wall functions for the different turbulence fields.
The code has also been rationalised and simplified avoiding unnecessary code
and duplication.
The volumeFractionSource represents the effect of a reduction in the
volume of the domain due to the presence of a stationary phase, most
likely a solid porous media. It only represents the dynamic effects
associated with the reduction in volume; it does not does not model
loss, drag or heat transfer. Separate models (e.g., the existing
porosity models) will be necessary to represent these effects. An
example usage, in system/fvOptions, is as follows:
volumeFraction
{
type volumeFractionSource;
phase solid;
phi phi;
rho rho;
U U;
fields (rho U e);
}
The volume fraction will be read from constant/alpha.<phase>, and must
be generated in advance using setFields or a function object. Note that
the names of the flux, density (if compressible) and velocity must all
be specified. Every field for which a transport equation is solved
should also be specified in the "fields" entry.
The solidEquilibriumEnergySource adds the thermal inertia and diffusive
characteristics of a stationary solid phase to the energy equation of
the fluid, assuming that the two phases are in thermal equilibrium. An
example usage is as follows:
solidEqulibriumEnergy
{
type solidEqulibriumEnergySource;
phase solid;
field e;
}
This will read the volume fraction in the same way as the
volumeFractionSource option. In addition, thermal properties of the
solid will be constructed from settings in
system/thermophysicalProperties.<phase>.
Two tutorials have been added, demonstrating use of these options in
both incompressible and compressible simulations. These are
incompressible/pimpleFoam/laminar/blockedChannel and
compressible/rhoPimpleFoam/laminar/blockedChannel.
Implementation of the Giesekus model for visco-elasticity, derived from the new
generalised form of the Maxwell model which now support additional sources.
Giesekus, H., 1982.
A simple constitutive equation for polymer fluids based on the
concept of deformation-dependent tensional mobility.
J. Non-Newton. Fluid. 11, 69–109.
This implementation is instantiated for incompressible, compressible and VoF
two-phase flow.
For most steady cases simpleFoam is likely to converge faster than pimpleFoam
with LTS but this capability may be useful for testing meshes, BCs etc. for more
complex solver for which SIMPLE is not stable and LTS is provided instead.
The writeEntry form is now defined and used consistently throughout OpenFOAM
making it easier to use and extend, particularly to support binary IO of complex
dictionary entries.
Now for transient simulations "Final" solver settings are required for ALL
equations providing consistency between the solution of velocity, energy,
composition and radiation properties.
However "Final" relaxation factors are no longer required for fields or
equations and if not present the standard value for the variable will be
applied. Given that relaxation factors other than 1 are rarely required for
transient runs and hence the same for all iterations including the final one
this approach provide simpler input while still providing the flexibility to
specify a different value for the final iteration if required. For steady cases
it is usual to execute just 1 outer iteration per time-step for which the
standard relaxation factors are appropriate, and if more than one iteration is
executed it is common to use the same factors for both. In the unlikely event
of requiring different relaxation factors for the final iteration this is still
possible to specify via the now optional "Final" specification.
snappyHexMesh now generates a face-zone for the AMI-s, and createBaffles
and mergeOrSplitPoints -split are used to create the patches. Before,
snappy generated AMI patches directly, which were then converted to
AMI-s with createPatch.
This way, the AMI-s match exactly at the start of the simulation. For
more complicated cases that may be derived from this tutorial, this
could be important.