Commit Graph

5801 Commits

Author SHA1 Message Date
bc32409e6b snappyHexMesh: Corrected code documentation
Patch contributed by Bruno Santos
Resolves contribution request https://bugs.openfoam.org/view.php?id=3794
2022-01-27 11:14:15 +00:00
4b914573eb etc/caseDicts/annotated/snappyHexMeshDict: Added documentation for more optional controls
Patch contributed by Bruno Santos
Resolves contribution request https://bugs.openfoam.org/view.php?id=3794
2022-01-27 11:12:07 +00:00
4c2ccffacf UPtrList: Added convert method to return a UPtrList of a different type
This is useful for creating a UPtrList<BaseType> from a
UPtrList<DerivedType>, or creating a UPtrList<const Type> from a
UPtrList<Type>.

The new pointers are constructed by implicit conversion of the old ones,
so the new type must be a base class of the old type and it must not
remove const-ness.
2022-01-27 10:07:48 +00:00
54fb312457 sampling: Corrected the order of the mid point of a line-cell sampled set 2022-01-26 16:45:38 +00:00
158ae8e7cc Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-01-26 16:36:53 +00:00
c7aaf66ffa specieCoeffs: Updated for single-precision compilation 2022-01-26 16:36:14 +00:00
ab6aa6b602 PatchCollisionDensity: Write out both mass and number collision density 2022-01-26 16:09:07 +00:00
f4b497bd81 driftFluxFoam::mixtureViscosityModels: Added the basic Quemada viscosity model for for colloidal dispersions
currently without strain-rate dependency.

Class
    Foam::mixtureViscosityModels::Quemada

Description
     Quemada viscosity model for for colloidal dispersions.

     References:
     \verbatim
         Quemada, D. (1998).
         Rheological modelling of complex fluids. I.
         The concept of effective volume fraction revisited.
         The European Physical Journal-Applied Physics, 1(1), 119-127.
    \endverbatim

Usage
    Example usage:
    \verbatim
    viscosityModel  Quemada;

    alphaMax    0.6; // Maximum dispersed phase-fraction (packing fraction)
    q           2;   // Exponent, defaults to 2

    rho         1996;
    \endverbatim
2022-01-26 15:25:30 +00:00
4623ece721 fvModels,fvConstraints: Changed Function1(time) to Function1(user time)
Time-dependent input data is now expected to be specified in user-time rather
than real-time.
2022-01-26 12:45:54 +00:00
8cb90dab4f functionObjectList: Improved error message if a functionObject configuration file is not foundation
e.g. if streamlinesLines is specified rather than the correct streamlinesLine in
the controlDict::functions list:

functions
{
    #includeFunc streamlinesLines
    (
        funcName=streamlines,
        start=(-0.0205 0.001 0.00001),
        end=(-0.0205 0.0251 0.00001),
        nPoints=10,
        fields=(p k U)
    )
}

the following error message is generated providing a list of all the
functionObject configuration files available and the run stops rather than
continuing regardless of the error:

--> FOAM FATAL IO ERROR:
Cannot find functionObject configuration file streamlinesLines

Available configured functionObjects:
88
(
CourantNo
Lambda2
MachNo
PecletNo
Q
Qdot
XiReactionRate
add
age
boundaryProbes
cellMax
cellMaxMag
cellMin
cellMinMag
components
cutPlaneSurface
ddt
div
divide
dsmcFields
enstrophy
faceZoneAverage
faceZoneFlowRate
fieldAverage
flowType
forceCoeffsCompressible
forceCoeffsIncompressible
forcesCompressible
forcesIncompressible
grad
graphCell
graphCellFace
graphFace
graphLayerAverage
graphUniform
interfaceHeight
internalProbes
isoSurface
log
mag
magSqr
moments
multiply
particles
patchAverage
patchDifference
patchFlowRate
patchIntegrate
patchSurface
phaseForces
phaseMap
phaseScalarTransport
probes
randomise
residuals
scalarTransport
scale
shearStress
sizeDistribution
staticPressureIncompressible
stopAtClockTime
stopAtFile
streamFunction
streamlinesLine
streamlinesPatch
streamlinesPoints
streamlinesSphere
subtract
surfaceInterpolate
time
timeStep
totalEnthalpy
totalPressureCompressible
totalPressureIncompressible
triSurfaceDifference
triSurfaceVolumetricFlowRate
turbulenceFields
turbulenceIntensity
uniform
vorticity
wallHeatFlux
wallHeatTransferCoeff
wallShearStress
writeCellCentres
writeCellVolumes
writeObjects
writeVTK
yPlus
)

file: /home/dm2/henry/OpenFOAM/OpenFOAM-dev/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict/functions

    From function static bool Foam::functionObjectList::readFunctionObject(const Foam::string&, Foam::dictionary&, const Foam::Pair<Foam::string>&, const Foam::word&)
    in file db/functionObjects/functionObjectList/functionObjectList.C at line 250.

FOAM exiting
2022-01-26 12:02:07 +00:00
f2d4d82c34 waveSuperposition: Keep scale functions in the same position in space 2022-01-26 11:19:41 +00:00
01f72b4c82 fvConstraints::limitMag: Generalised replacement for limitVelocity
limitMag limits the magnitude of a specified field of any rank to a specified
maximum value.  To limit the velocity field U using limitMag rather than
limitVelocity specify

    limitU
    {
        type            limitMag;
        selectionMode   all;
        field           U;
        max             100;
    }

in the system/fvConstraints dictionary.
2022-01-25 11:21:14 +00:00
e5ac86bd5e Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-01-25 11:18:35 +00:00
af8e4376e6 chemistryModel::ISAT: Minor optimisation 2022-01-25 11:18:15 +00:00
a033b7276f functionObjects: writeVTK: Fixes
The lookup been fixed to prevent failures when a field is looked up with
the wrong type, and it now also provides warnings when a field cannot be
found for any type.
2022-01-25 10:26:06 +00:00
cd98d6a906 surfaceWriter: Corrected field count in variadic interface 2022-01-25 09:25:40 +00:00
8bb48df87f flowRateInletVelocityFvPatchVectorField: Added optional profile entry to specify the velocity profile
The unreliable extrapolateProfile option has been replaced by the more flexible
and reliable profile option which allows the velocity profile to be specified as
a Function1 of the normalised distance to the wall.  To simplify the
specification of the most common velocity profiles the new laminarBL (quadratic
profile) and turbulentBL (1/7th power law) Function1s are provided.

In addition to the new profile option the flow rate can now be specified as a
meanVelocity, volumetricFlowRate or massFlowRate, all of which are Function1s of
time.

The following tutorials have been updated to use the laminarBL profile:
    multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis
    multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface

The following tutorials have been updated to use the turbulentBL profile:
    combustion/reactingFoam/Lagrangian/verticalChannel
    combustion/reactingFoam/Lagrangian/verticalChannelLTS
    combustion/reactingFoam/Lagrangian/verticalChannelSteady
    compressible/rhoPimpleFoam/RAS/angledDuct
    compressible/rhoPimpleFoam/RAS/angledDuctLTS
    compressible/rhoPimpleFoam/RAS/squareBendLiq
    compressible/rhoPorousSimpleFoam/angledDuctImplicit
    compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff
    compressible/rhoSimpleFoam/squareBend
    compressible/rhoSimpleFoam/squareBendLiq
    heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger
    heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger
    incompressible/porousSimpleFoam/angledDuctImplicit
    incompressible/porousSimpleFoam/straightDuctImplicit
    multiphase/interFoam/RAS/angledDuct

Class
    Foam::flowRateInletVelocityFvPatchVectorField

Description
    Velocity inlet boundary condition creating a velocity field with
    optionally specified profile normal to the patch adjusted to match the
    specified mass flow rate, volumetric flow rate or mean velocity.

    For a mass-based flux:
    - the flow rate should be provided in kg/s
    - if \c rho is "none" the flow rate is in m3/s
    - otherwise \c rho should correspond to the name of the density field
    - if the density field cannot be found in the database, the user must
      specify the inlet density using the \c rhoInlet entry

    For a volumetric-based flux:
    - the flow rate is in m3/s

Usage
    \table
        Property     | Description             | Required    | Default value
        massFlowRate | Mass flow rate [kg/s]   | no          |
        volumetricFlowRate | Volumetric flow rate [m^3/s]| no |
        meanVelocity | Mean velocity [m/s]| no |
        profile      | Velocity profile        | no          |
        rho          | Density field name      | no          | rho
        rhoInlet     | Inlet density           | no          |
        alpha        | Volume fraction field name | no       |
    \endtable

    Example of the boundary condition specification for a volumetric flow rate:
    \verbatim
    <patchName>
    {
        type                flowRateInletVelocity;
        volumetricFlowRate  0.2;
        profile             laminarBL;
    }
    \endverbatim

    Example of the boundary condition specification for a mass flow rate:
     \verbatim
    <patchName>
    {
        type                flowRateInletVelocity;
        massFlowRate        0.2;
        profile             turbulentBL;
        rho                 rho;
        rhoInlet            1.0;
    }
    \endverbatim

    Example of the boundary condition specification for a volumetric flow rate:
    \verbatim
    <patchName>
    {
        type                flowRateInletVelocity;
        meanVelocity        5;
        profile             turbulentBL;
    }
    \endverbatim

    The \c volumetricFlowRate, \c massFlowRate or \c meanVelocity entries are
    \c Function1 of time, see Foam::Function1s.

    The \c profile entry is a \c Function1 of the normalised distance to the
    wall.  Any suitable Foam::Function1s can be used including
    Foam::Function1s::codedFunction1 but Foam::Function1s::laminarBL and
    Foam::Function1s::turbulentBL have been created specifically for this
    purpose and are likely to be appropriate for most cases.

Note
    - \c rhoInlet is required for the case of a mass flow rate, where the
      density field is not available at start-up
    - The value is positive into the domain (as an inlet)
    - May not work correctly for transonic inlets
    - Strange behaviour with potentialFoam since the U equation is not solved

See also
    Foam::fixedValueFvPatchField
    Foam::Function1s::laminarBL
    Foam::Function1s::turbulentBL
    Foam::Function1s
    Foam::flowRateOutletVelocityFvPatchVectorField
2022-01-24 19:10:39 +00:00
db45df2e6e solidSpecie: Moved into solidThermo
Resolved bug-report https://bugs.openfoam.org/view.php?id=3787
2022-01-20 15:38:04 +00:00
8145de3cf1 chemistryModel::ISAT: Refactored and improved implementation 2022-01-20 12:31:50 +00:00
b139515cf7 chemistryTabulationMethods: Untemplated to simply the code and reduce compilation time
With the changes to chemistryModel to evaluate and integrate reaction rates
mass-fraction based rather than mole-fraction based ISAT is now independent of
the thermodynamics and with some restructuring of chemistryModel and the
addition of the non-templated base-class odeChemistryModel is has been possible
to un-template chemistryTabulationMethods and ISAT in particular.  This
simplifies the ISAT code and hence maintenance as well as reducing the
compilation time of chemistryModel on the various thermo packages.
2022-01-19 18:31:58 +00:00
66f325fc41 multiphaseEulerFoam: Add "none" diameterModel for phases that are always continuous
This model will generate an error if the diameter is requested. This
will happen if another sub model is included that depends on the
diameter of the continuous phase. It therefore provides a check that the
sub-modelling combination is valid.

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-01-19 15:21:06 +00:00
3cc9475b45 multiphaseEulerFoam: Added reporting of selected binary breakup model
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-01-19 15:15:05 +00:00
bf3ec0eb87 multiphaseEulerFoam: populationBalance: Removed unused header includes
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-01-19 15:13:31 +00:00
a3f7c38835 chemistryModel: Refactored interface to chemistry reduction
in preparation for un-templating ISAT
2022-01-18 22:06:04 +00:00
427307c190 chemistryTabulationMethod::add: Removed redundant rho argument 2022-01-18 16:07:12 +00:00
ded017b762 mapFields: Corrected handling of userTime
Resolves bug-report https://bugs.openfoam.org/view.php?id=3786
2022-01-18 10:52:06 +00:00
c104aac1da Removed duplicate file 2022-01-17 23:58:32 +00:00
75a3d1fd1e fvMeshDistributors::cpuLoad: New class to simply caching multiple CPU loads per cell
Used by fvMeshDistributors::loadBalancer to generate the multi-constraint
weights for mesh redistribution.
2022-01-17 19:58:04 +00:00
472ce5ace6 fvMeshDistributors::loadBalancer: Prototype general CPU load balancer
used in conjunction with the new loadBalancing option in constant/chemistryProperties:

    loadBalancing   on;

which enables per-cell CPU time caching used by the loadBalancer to redistribute
the mesh.  Currently this option is only provided for chemistry integration but
the implementation is general and in future options will be provided to balance
other local cell loads, in particular Lagrangian particles.

The loadBalancer in enabled by specifying a distributor entry in
constant/dynamicMeshDict, e.g.

distributor
{
    type            loadBalancer;

    libs            ("libfvMeshDistributors.so");

    multiConstraint true;

    // How often to redistribute
    redistributionInterval  10;

    // Maximum fractional cell distribution imbalance
    // before rebalancing
    maxImbalance    0.1;
}

with which the mesh is checked for more than 10% load-imbalance every 10
time-steps and redistributed using a multi-constraint method, i.e. separate CPU
load weights are provided for each of the loads, currently that is the chemistry
integration load and the CPU time taken for the rest of the simulation,
transport equations solution etc.

The fvMeshDistributors::loadBalancer uses the distributor specified in
system/decomposeParDict to redistribute the mesh based on the cell CPU loads,
e.g. to use the Zoltan RCB method specify:

distributor     zoltan;
libs            ("libzoltanDecomp.so");

zoltanCoeffs
{
    lb_method   rcb;
}

Unfortunately only a few available redistribution methods support
multi-constraints: Zoltan::RCB, MeTiS, parMeTiS and xtraPuLP, of these only
Zoltan::RCB is currently available in OpenFOAM.  Load-balancing is possible
without using a multi-constraint method (i.e. using any of the other
decomposition methods provided with OpenFOAM and Zoltan) by summing the various
CPU loads which is selected by setting:

    multiConstraint false;

but the load-balancing is likely to be a lot less effective with this option.

Due to the licencing issues with parMeTiS interfacing to xtraPuLP might be the
best option for further work on load-balancing in OpenFOAM, or MeTiS could be
used in parallel by first agglomerating the distribution graph on the master
processor and redistributing the result; this pseudo-parallel option is already
provided for the Scotch method.
2022-01-17 11:31:12 +00:00
3c353761ed tutorials::dynamicMeshDict: Corrected dictionary name 2022-01-17 10:54:11 +00:00
aab660450a fileOperation, timeSelector: Correct handling of negative time directories
Resolves bug-report https://bugs.openfoam.org/view.php?id=3784
2022-01-15 21:15:41 +00:00
8c0dd22f83 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 20220115 2022-01-14 17:59:04 +00:00
76d8280c96 Time: Improved the time directory precision changes for variable time-step cases
Resolves bug-report https://bugs.openfoam.org/view.php?id=3781
2022-01-14 17:58:14 +00:00
40286ba59e setAtmBoundaryLayer: New initialisation utility
This utility initialises the U, k and epsilon fields (if available) to
the output of the atmBoundaryLayer model. This is the same model as used
in the atmBoundaryLayerInlet.* boundary conditions and in the
waveAtmBoundaryLayer wave model.

The settings for the initialisation are read from a
system/setAtmBoundaryLayerDict file and are identical to the settings
required by the other use cases. An example of the settings required
within a system/setAtmBoundaryLayerDict file is shown below:

    zDir            (0 0 1);        // Vertical direction
    flowDir         (1 0 0);        // Direction of far-field flow
    Zref            20;             // Reference height
    Uref            10;             // Speed at reference height
    z0              uniform 0.1;    // Roughness height
    zGround         uniform 0;      // Ground height
2022-01-14 17:13:09 +00:00
fca30da1fd Time: Corrected the handling of user-time in the write time precision update
Resolves bug-report https://bugs.openfoam.org/view.php?id=3781
2022-01-13 17:38:11 +00:00
62ad471222 multiphaseEulerFoam: Made segregated drag model numerically symmetric 2022-01-13 10:12:20 +00:00
30c877a7ab multiphaseEulerFoam: Use phaseSystem::propertiesName 2022-01-13 10:12:20 +00:00
b58e1f5d5a className: Added define with name for non-template classes 2022-01-12 16:47:46 +00:00
01f0753ac7 cpuTime: Updated to use the POSIX clock() function
which provides better resolution of the CPU time than times function used
previously.  This will be needed for load-balancing chemistry, Lagrangian
etc. for which the CPU time spent per cell is required.
2022-01-11 23:05:29 +00:00
3f1bb7ee13 multiphaseEulerFoam: Minor fixes to population balance function objects
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-01-11 14:07:01 +00:00
32b656f8a7 multiphaseEulerFoam, turbulentDispersionModel: Corrected face-force for multiphase case
This is a completion of commit 64da7a2c. The fix has now also been
applied to the face-momentum equation.
2022-01-11 13:55:46 +00:00
cc96abda03 basicThermo: Cache thermal conductivity kappa rather than thermal diffusivity alpha
Now that Cp and Cv are cached it is more convenient and consistent and slightly
more efficient to cache thermal conductivity kappa rather than thermal
diffusivity alpha which is not a fundamental property, the appropriate form
depending on the energy solved for.  kappa is converted into the appropriate
thermal diffusivity for the energy form solved for by dividing by the
corresponding cached heat capacity when required, which is efficient.
2022-01-10 20:19:00 +00:00
1ae5288274 functionObjects::fieldAverage: Corrected handling of internal fields
Resolves bug-report https://bugs.openfoam.org/view.php?id=3776
2022-01-07 21:16:21 +00:00
a05910e22e Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-01-07 10:21:52 +00:00
0b681597c4 basicSpecieMixture: Corrected test for zero total mass-fraction
Resolves bug-report https://bugs.openfoam.org/view.php?id=3775
2022-01-07 10:20:52 +00:00
794255284f multiphaseEulerFoam: revised sizeDistribution functionObject
Following the addition of the new moments functionObject, all related
functionality was removed from sizeDistribution.

In its revised version, sizeDistribution allows for different kinds of
weighted region averaging in case of field-dependent representative
particle properties.

A packaged function has also been added to allow for command line solver
post-processing.

For example, the following function object specification returns the
volume-based number density function:

    numberDensity
    {
        type                sizeDistribution;
        libs                ("libmultiphaseEulerFoamFunctionObjects.so");
        writeControl        writeTime;
        populationBalance   bubbles;
        functionType        numberDensity;
        coordinateType      volume;
        setFormat           raw;
    }

The same can be achieved using a packaged function:

    #includeFunc sizeDistribution
    (
        populationBalance=bubbles,
        functionType=numberDensity,
        coordinateType=volume,
        funcName=numberDensity
    )

Or on the command line:

    multiphaseEulerFoam -postProcess -func "
    sizeDistribution
    (
        populationBalance=bubbles,
        functionType=numberDensity,
        coordinateType=volume,
        funcName=numberDensity
    )"

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-01-07 09:48:30 +00:00
36c565b9bf multiphaseEulerFoam: new functionObject "moments"
This function calculates integral (integer moments) or mean properties
(mean, variance, standard deviation) of a size distribution computed with
multiphaseEulerFoam. It has to be run with multiphaseEulerFoam, either
at run-time or with -postProcess. It will not work with the postProcess
utility.

The following function object specification for example returns the first
moment of the volume-based number density function which is equivalent to
the phase fraction of the particulate phase:

    moments
    {
        type                moments;
        libs                ("libmultiphaseEulerFoamFunctionObjects.so");
        executeControl      timeStep;
        writeControl        writeTime;
        populationBalance   bubbles;
        momentType          integerMoment;
        coordinateType      volume;
        order               1;
    }

The same can be achieved using a packaged function:

    #includeFunc moments
    (
        populationBalance=bubbles,
        momentType=integerMoment,
        coordinateType=volume,
        order=1,
        funcName=moments
    )

Or on the command line:

    multiphaseEulerFoam -postProcess -func "
        moments
        (
            populationBalance=bubbles,
            momentType=integerMoment,
            coordinateType=volume,
            order=1,
            funcName=moments
        )"

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-01-07 09:48:30 +00:00
07c43e9c5d setWriter, surfaceWriter: Added lists of fields to the variadic interface 2022-01-07 09:48:30 +00:00
1041a0c21b Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-01-06 15:38:21 +00:00
b56f6d9109 cyclicFvPatchField: Corrected handling of rotated cyclic transformation for tensors
This correction applies to the handling of the implicit part of the matrix for
the segregates solution of the tensor components, e.g. when solving for the
Reynolds stress in cases with rotated cyclic patches.
2022-01-06 15:26:05 +00:00