Also added tutorial case demonstrating usage. Note that the new drag
models are symmetric and should be used without any blending.
This work was supported by Georg Skillas and Zhen Li, at Evonik
It may be convenient to specify these directions un-normalized so it is
necessary to normalize them before they are used to calculate the force
coefficients.
which simplifies the reactingEulerFoam populationBalance test cases.
Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum
Dresden - Rossendorf (HZDR)
Sub-model blending should be set such that the sum of all the blending
coefficients equals one. If there are three models specified for a phase
pair (e.g., (air in water), (water in air) and (air and water)), then
the sum-to-one constraint is guaranteed by the blending functions.
Frequently, however, the symmetric model ((air and water) in this
example) is omitted. In that case, the blending coefficients should be
selected so that the sum of just the two non-symmetric coefficients
equal one.
In the case of linear blending, this means setting the minimum partially
continuous alpha to one-minus the fully continuous value of the opposite
phase. For example:
blending
{
default
{
type linear;
minFullyContinuousAlpha.air 0.7;
minPartlyContinuousAlpha.air 0.3;
minFullyContinuousAlpha.water 0.7;
minPartlyContinuousAlpha.water 0.3;
}
}
The reactingTwoPhaseEulerFoam and reactingMultiPhaseEulerFoam tutorials
have been modified to adhere to this principle.
Two new phase models have been added as selectable options for
reactingMultiphaseEulerFoam; pureStationaryPhaseModel and
pureStationaryIsothermalPhaseModel. These phases do not store a
velocity and their phase fractions remain constant throughout the
simulation. They are intended for use in modelling static particle beds
and other forms of porous media by means of the existing Euler-Euler
transfer models (drag, heat transfer, etc...).
Note that this functionality has not been extended to
reactingTwoPhaseEulerFoam, or the non-reacting *EulerFoam solvers.
Additional maintenance work has been carried out on the phase model
and phase system structure. The system can now loop over subsets of
phases with specific functionality (moving, multi-component, etc...) in
order to avoid testing for the existence of equations or variables in
the top level solver. The mass transfer handling and it's effect on
per-phase source terms has been refactored to reduce duplication. Const
and non-const access to phase properties has been formalised by renaming
non-const accessors with a "Ref" suffix, which is consistent with other
recent developments to classes including tmp and GeometricField, among
others. More sub-modelling details have been made private in order to
reduce the size of interfaces and improve abstraction.
This work was supported by Zhen Li, at Evonik
MULES and CMULES have been extended so that the limits can be supplied
as fields. These arguments are templated so that zeroField, oneField or
UniformField<scalar> can be used in place of a scalar value with no
additional overhead. The flux argument has been removed from the
unlimited CMULES correct functions in order to make this templating
possible.
An additional form of limit sum has also been added to MULES. This
limits the flux sum by ofsetting in proportion to the phase fraction,
rather than by reducing the magnitude of the fluxes with the same sign
as the imbalance. The new procedure makes it possible to limit the flux
sum in the presence of constraints without encountering a divide by
zero.
The initial set of cases in the test directory are aimed at testing the
reactingEulerFoam populationBalance functionality.
Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum
Dresden - Rossendorf (HZDR) and VTT Technical Research Centre of Finland Ltd.
Integrated with the "tutorials" functionality by CFD Direct Ltd.
Improvements to existing functionality
--------------------------------------
- MPI is initialised without thread support if it is not needed e.g. uncollated
- Use native c++11 threading; avoids problem with static destruction order.
- etc/cellModels now only read if needed.
- etc/controlDict can now be read from the environment variable FOAM_CONTROLDICT
- Uniform files (e.g. '0/uniform/time') are now read only once on the master only
(with the masterUncollated or collated file handlers)
- collated format writes to 'processorsNNN' instead of 'processors'. The file
format is unchanged.
- Thread buffer and file buffer size are no longer limited to 2Gb.
The global controlDict file contains parameters for file handling. Under some
circumstances, e.g. running in parallel on a system without NFS, the user may
need to set some parameters, e.g. fileHandler, before the global controlDict
file is read from file. To support this, OpenFOAM now allows the global
controlDict to be read as a string set to the FOAM_CONTROLDICT environment
variable.
The FOAM_CONTROLDICT environment variable can be set to the content the global
controlDict file, e.g. from a sh/bash shell:
export FOAM_CONTROLDICT=$(foamDictionary $FOAM_ETC/controlDict)
FOAM_CONTROLDICT can then be passed to mpirun using the -x option, e.g.:
mpirun -np 2 -x FOAM_CONTROLDICT simpleFoam -parallel
Note that while this avoids the need for NFS to read the OpenFOAM configuration
the executable still needs to load shared libraries which must either be copied
locally or available via NFS or equivalent.
New: Multiple IO ranks
----------------------
The masterUncollated and collated fileHandlers can now use multiple ranks for
writing e.g.:
mpirun -np 6 simpleFoam -parallel -ioRanks '(0 3)'
In this example ranks 0 ('processor0') and 3 ('processor3') now handle all the
I/O. Rank 0 handles 0,1,2 and rank 3 handles 3,4,5. The set of IO ranks should always
include 0 as first element and be sorted in increasing order.
The collated fileHandler uses the directory naming processorsNNN_XXX-YYY where
NNN is the total number of processors and XXX and YYY are first and last
processor in the rank, e.g. in above example the directories would be
processors6_0-2
processors6_3-5
and each of the collated files in these contains data of the local ranks
only. The same naming also applies when e.g. running decomposePar:
decomposePar -fileHandler collated -ioRanks '(0 3)'
New: Distributed data
---------------------
The individual root directories can be placed on different hosts with different
paths if necessary. In the current framework it is necessary to specify the
root per slave process but this has been simplified with the option of specifying
the root per host with the -hostRoots command line option:
mpirun -np 6 simpleFoam -parallel -ioRanks '(0 3)' \
-hostRoots '("machineA" "/tmp/" "machineB" "/tmp")'
The hostRoots option is followed by a list of machine name + root directory, the
machine name can contain regular expressions.
New: hostCollated
-----------------
The new hostCollated fileHandler automatically sets the 'ioRanks' according to
the host name with the lowest rank e.g. to run simpleFoam on 6 processors with
ranks 0-2 on machineA and ranks 3-5 on machineB with the machines specified in
the hostfile:
mpirun -np 6 --hostfile hostfile simpleFoam -parallel -fileHandler hostCollated
This is equivalent to
mpirun -np 6 --hostfile hostfile simpleFoam -parallel -fileHandler collated -ioRanks '(0 3)'
This example will write directories:
processors6_0-2/
processors6_3-5/
A typical example would use distributed data e.g. no two nodes, machineA and
machineB, each with three processes:
decomposePar -fileHandler collated -case cavity
# Copy case (constant/*, system/*, processors6/) to master:
rsync -a cavity machineA:/tmp/
# Create root on slave:
ssh machineB mkdir -p /tmp/cavity
# Run
mpirun --hostfile hostfile icoFoam \
-case /tmp/cavity -parallel -fileHandler hostCollated \
-hostRoots '("machineA" "/tmp" "machineB" "/tmp")'
Contributed by Mattijs Janssens
Specialized variants of the power law porosity and k epsilon turbulence models
developed to simulate atmospheric flow over forested and non-forested complex
terrain.
Class
Foam::powerLawLopesdaCosta
Description
Variant of the power law porosity model with spatially varying
drag coefficient
given by:
\f[
S = -\rho C_d \Sigma |U|^{(C_1 - 1)} U
\f]
where
\vartable
\Sigma | Porosity surface area per unit volume
C_d | Model linear coefficient
C_1 | Model exponent coefficient
\endvartable
Reference:
\verbatim
Costa, J. C. P. L. D. (2007).
Atmospheric flow over forested and non-forested complex terrain.
\endverbatim
Class
Foam::RASModels::kEpsilonLopesdaCosta
Description
Variant of the standard k-epsilon turbulence model with additional source
terms to handle the changes in turbulence in porous regions represented by
the powerLawLopesdaCosta porosity model.
Reference:
\verbatim
Costa, J. C. P. L. D. (2007).
Atmospheric flow over forested and non-forested complex terrain.
\endverbatim
The default model coefficients are
\verbatim
kEpsilonLopesdaCostaCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
sigmak 1.0;
sigmaEps 1.3;
}
\endverbatim
Tutorial case to follow.
Replaced the ad hoc geometric mean blending with the more physical wall distance
Reynolds number blending function.
Additionally the part of the production term active for y+ < 11.6 has been
reinstated.
Sets the boundary values of p_rgh corresponding to a constant density hydrostatic
pressure distribution.
Description
This boundary condition provides a hydrostatic pressure condition for p_rgh,
calculated as:
\f[
p_{rgh} = p_{ref} - (\rho - \rho_0) g (h - h_{ref})
\f]
where
\vartable
p_{rgh} | Pseudo hydrostatic pressure [Pa]
p_{ref} | Static pressure at hRef [Pa]
h | Height in the opposite direction to gravity
h_{ref} | Reference height in the opposite direction to gravity
\rho | Density field
\rho_{ref} | Uniform reference density at boundary
g | Acceleration due to gravity [m/s^2]
\endtable
Usage
\table
Property | Description | Required | Default value
pRef | Reference static pressure | yes |
rhoRef | Reference density | yes |
rho | Density field name | no | rho
\endtable
Example of the boundary condition specification:
\verbatim
<patchName>
{
type prghUniformDensityHydrostaticPressure;
rhoRef 1000;
p 0;
value uniform 0; // optional initial value
}
\endverbatim
Partial elimination has been implemented for the multiphase Euler-Euler
solver. This does a linear solution of the drag system when calculating
flux and velocity corrections after the solution of the pressure
equation. This can improve the behaviour of the solution in the event
that the drag coupling is high. It is controlled by means of a
"partialElimination" switch within the PIMPLE control dictionary in
fvSolution.
A re-organisation has also been done in order to remove the exposure of
the sub-modelling from the top-level solver. Rather than looping the
drag, virtual mass, lift, etc..., models directly, the solver now calls
a set of phase-system methods which group the different force terms.
These new methods are documented in MomentumTransferPhaseSystem.H. Many
other accessors have been removed as a consequence of this grouping.
A bug was also fixed whereby the face-based algorithm was not
transferring the momentum associated with a given interfacial mass
transfer.
Description
Evaluates and writes the turbulence intensity field 'I'.
The turbulence intensity field 'I' is the root-mean-square of the turbulent
velocity fluctuations normalised by the local velocity magnitude:
\f[
I \equiv \frac{\sqrt{\frac{2}{3}\, k}}{U}
\f]
To avoid spurious extrema and division by 0 I is limited to 1 where the
velocity magnitude is less than the turbulent velocity fluctuations.
Example of function object specification:
\verbatim
functions
{
.
.
.
turbulenceIntensity
{
type turbulenceIntensity;
libs ("libfieldFunctionObjects.so");
}
.
.
.
}
\endverbatim
or using the standard configuration file:
\verbatim
functions
{
.
.
.
#includeFunc turbulenceIntensity
.
.
.
}
\endverbatim