Commit Graph

5046 Commits

Author SHA1 Message Date
aa4151d649 Function1: Added squarePulse
This function gives a value of one during a user-specified duration, and
zero at all other times. It is useful for defining the time range in
which an injection or ignition heat source or similar operates.

Example usage, scaling a value:

    <name>
    {
        type        scale;
        scale       squarePulse;
        start       0;
        duration    1;
        value       100;
    }

This function has been utilised in a number of tutorial fvOption
configurations to provide a specific window in which the fvOption is
applied. This was previously achieved by "timeStart" and "duration"
controls hard coded into the fvOptions themselves.
2021-02-09 20:02:21 +00:00
e7f746652b fvOptions: Use macros for looping over primitive types 2021-02-09 20:02:21 +00:00
69e98dc28d fvOptions: Added massSource option
This fvOption applies a mass source to the continuity equation and to
all field equations.

Example usage:

    massSource
    {
        type            massSource;

        selectionMode   cellSet;
        cellSet         massSource;

        massFlowRate    1e-4;

        fieldValues
        {
            U               (10 0 0);
            T               350;
            k               0.375;
            epsilon         14.855;
        }
    }

Values should be provided for all solved for fields. Warnings will be
issued if values are not provided for fields for which transport equations
are solved. Warnings will also be issued if values are provided for fields
which are not solved for.
2021-02-09 20:02:14 +00:00
07f5080f2e fvOptions: Remove type restrictions and rewrite of field-name handling
A number of fvOptions that apply to a user-derined field can now
automatically work what primitive type they apply to. These options can
apply to any field type, and in some cases even multiple fields of
differing type. Example usage of the options to which this change
applies are shown below:

    codedSource1
    {
        type            codedSource;
        name            codedSource1;

        field           h;

        ...
    }

    fixedValueConstraint1
    {
        type            fixedValueConstraint;

        fieldValues
        {
            R           (1 0 0 1 0 1);
            epsilon     150;
        }

        ...
    }

    phaseLimitStabilization11
    {
        type            phaseLimitStabilization;

        field           sigma.liquid;

        ...
    }

Previously to apply to a given type, these options had to be selected
with the name of the type prepended to the option name (e.g., "type
symmTensorPhaseLimitStabilization;") and those that operated on multiple
fields were restricted to those fields being of the same type.

A number of other options have had improvements made to their handling
of user specification of fields. Where possible, the option will now
attempt to work out what field the option applies to automatically. The
following options, therefore, no longer require "field" or "fields"
entries:

    actuationDiskSource
    buoyancyEnergy
    buoyancyForce
    meanVelocityForce
    rotorDiskSource
    volumeFractionSource
    constantHeatTransfer
    function2HeatTransfer
    variableHeatTransfer

Non-standard field names can be overridden in the same way as in
boundary conditions; e.g., the velocity name can be overridden with a "U
<UName>;" entry if it does not have the default name, "U". The name of
the energy field is now always determined from the thermodynamics
model and should always be correct. Some options that can be applied to
an individual phase also support a "phase <phaseName>;" entry;

fvOptions field-name handling has been rewritten to increase its
flexibility and to improve warning messages. The flexibility now allows
for options that apply to all fields, or all fields of a given phase,
rather than being limited to a specific list of field names. Messages
warning about options that have not been applied now always print just
once per time-step.
2021-02-09 16:53:26 +00:00
81ec2012be titaniaSynthesis: Removed blockMeshDict.m4 and replaced by titaniaSynthesis dictionary. 2021-02-09 15:13:33 +00:00
a1e7357823 surfaceFilmModels: Renamed injection -> ejection
The injection models do not inject parcels into the film they specifically eject
parcels from the film and the name "injection" is very confusing and misleading
hence the logical rename injection -> ejection.
2021-02-09 11:49:39 +00:00
e36a9475f9 foamSearch: Updated documentation for "slash" syntax
Resolves bug-report https://bugs.openfoam.org/view.php?id=3625
2021-02-09 09:55:59 +00:00
aa852124e3 ThermophysicalTransportModels: Corrected reference to the pressure field
Resolves bug-report https://bugs.openfoam.org/view.php?id=3624
2021-02-08 19:48:29 +00:00
8917f4b51f src/thermophysicalModels/specie/transport: Removed commented D function
Self-diffusion is not useful enough to implement, the multi-component diffusion
models require at least binary diffusion coefficients.
2021-02-06 21:17:37 +00:00
c5b6e666c2 sloshingTank: Removed blockMeshDict.m4 and replaced by sloshingTank2D and sloshingTank3D dictionary.
Vertices are generated using run time compilation functionality.

File duplication avoided by placement in:
tutorials/resources/blockMesh/sloshingTank2D
tutorials/resources/blockMesh/sloshingTank3D
2021-02-05 16:25:49 +00:00
95c98625b5 tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer: Updated eMesh files 2021-02-05 13:23:40 +00:00
35f73c1c17 angledDuct: Removed blockMeshDict.m4 and replaced by angledDuct dictionary.
Vertices are generated using run time compilation functionality.

File duplication avoided by placement in:
tutorials/resources/blockMesh/angledDuct.
2021-02-05 08:53:31 +00:00
66c62e9296 searchableSurface: Renamed geometry directory triSurface -> geometry
Originally the only supported geometry specification were triangulated surfaces,
hence the name of the directory: constant/triSurface, however now that other
surface specifications are supported and provided it is much more logical that
the directory is named accordingly: constant/geometry.  All tutorial and
template cases have been updated.

Note that backward compatibility is provided such that if the constant/geometry
directory does not exist but constant/triSurface does then the geometry files
are read from there.
2021-02-04 13:51:48 +00:00
1e728ad7e3 applications/test: Tested and updated 2021-02-03 12:37:44 +00:00
ed0686ea0c multiphaseEulerFoam: Support for frozen flow switch
multiphaseEulerFoam now supports the "frozenFlow" setting in
system/fvSolution/PIMPLE. With this switch on, the pressure-velocity
system is not solved. Energy and species transport are simulated using
fixed velocity and pressure fields. Non-transport effects on the phase
fraction, such as mass transfer or fvOption sources, are also included.

Note that this setting does not enforce conservation. In general, any
processes that alter the phase fraction have to be set up carefully in
order to avoid generating an inconsistent set of phase fractions.

This switch has been enabled in two zero-dimensional test cases which
are designed to operate at a constant pressure. The "frozenFlow" switch
now enforces this constant pressure directly. Previously the pressure
equation was being solved, but the system was not well posed, and the
cases were failing to run as a result.
2021-02-03 10:24:45 +00:00
15c56bf425 fvcMeshPhi: Store name of tmp flux field before tmp is reused 2021-02-02 23:54:45 +00:00
6c25033b24 multiphaseEulerFoam: Correct fixed-flux BCs to be consistent with the velocity BCs 2021-02-02 20:17:22 +00:00
5df6fe3a58 dictionary: Added includedDictionary helper class to handle the context of included files
for codeStream when reading on master only.
2021-02-02 16:35:05 +00:00
5e824f75dc multiphaseEulerFoam/.../diameterModels: Fixes to caching behaviour 2021-02-02 09:49:58 +00:00
9fde87a5f9 multiphaseEulerFoam::MomentumTransferPhaseSystem: Minor update to MRF handling 2021-02-02 08:59:59 +00:00
4108cbec9c multiphaseEulerFoam::MomentumTransferPhaseSystem: evaluate ddtCorrByAs for moving phases only 2021-02-02 08:39:08 +00:00
6c82a06ed8 multiphaseEulerFoam: Added mesh-motion dilatation effects
to support mesh-motion with cell-volume changes in both the cell- and
face-momentum algorithms.
2021-02-01 14:52:27 +00:00
441ff53e2d multiphaseEulerFoam: Added moving-mesh support for both cell- and face-momentum algorithms
Mesh-motion with or without topology change or AMI is now supported in
multiphaseEulerFoam for both cell- and face-momentum algorithms.

The new tutorial case mixerVesselAMI2D is provided which is the AMI version of
the 4-phase MRF mixerVessel2D case.  It is setup with the cell-momentum
algorithm but also runs fine with the face-momentum algorithm although the
results are noticeably less accurate, particularly when the case is run
single-phase and compared directly with those from pimpleFoam.

Further testing is in progress.

I2D/constant/thermophysicalProperties.water
2021-02-01 11:06:25 +00:00
d35103fe22 caseDicts/postProcessing: Removed duplicate preconfiguration 20210130 2021-01-28 09:41:49 +00:00
eadbf9a840 compressibleInterFoam::Allwmake: Added twoPhaseChange 2021-01-27 08:34:04 +00:00
89ab9286c6 compressibleInterFoam: Added support for phase-change and cavitation
The new compressible form of the twoPhaseChange library including cavitation
models Kunz, Merkle and SchnerrSauer provides compressibleInterFoam with
optional phase change functionality specified in the optional
constant/phaseChangeProperties dictionary, e.g.

    phaseChangeModel SchnerrSauer;

    pSat            2300;   // Saturation pressure
2021-01-26 11:42:14 +00:00
79e43a20fd Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-01-26 11:36:04 +00:00
46bf7a267f dictionary: Provide the parent dictionary to indirectly included dictionaries
to ensure IO settings are inherited.
2021-01-26 11:34:48 +00:00
2caad45a9b functionObjects/setTimeStep: Compatibility with 'adjustableRunTime'
setTimeStep is now compatible with a 'writeControl adjustableRunTime;'
setting in the systemControlDict. If 'adjustableRunTime' is selected
then the time-step values set by this function object will not be
exactly as specified, but write intervals will be matched exactly.

All function object time adjustment is now done during the execute
methods, so the specific setTimeStep hooks have been removed.
2021-01-26 08:12:21 +00:00
ac56655601 caseDicts/postProcessing: Added preconfiguration for time function object 2021-01-26 08:12:21 +00:00
3ca14ebe58 functionObjects: Fixes to restart and run-time modification behaviour
All function objects now re-read as a result of run-time modifications
to the system/controlDict.

Function objects that write log files (via the logFiles class) will now
generate a new postProcessing/<funcName>/<time> directory as a result of
either restart or run-time modification. Log files will therefore never
be overwritten by restart or run-time modification, except for when a
case is restarted at the same time as a previous execution (e.g.,
repeated runs at the start time).
2021-01-26 08:12:21 +00:00
4e301e9227 src/twoPhaseModels: Checked and updated for clang 2021-01-25 10:58:13 +00:00
e901e84eb2 heheuPsiThermo: Corrected psiu, psib, muu and mub
Resolves bug-report https://bugs.openfoam.org/view.php?id=3617
2021-01-25 10:57:59 +00:00
c2f4c6191d interFoam: Added support for phase-change with cavitation models
The phase-change functionality in interPhaseChangeFoam has been generalised and
moved into the run-time selectable twoPhaseChange library included into
interFoam providing optional phase-change.  The three cavitation models provided
in interPhaseChangeFoam are now included in the twoPhaseChange library and the
two interPhaseChangeFoam cavitation tutorials updated for interFoam.

interPhaseChangeFoam has been replaced by a user redirection script which prints
the following message:

The interPhaseChangeFoam solver has solver has been replaced by the more general
interFoam solver, which now supports phase-change using the new twoPhaseChange
models library.

To run with with phase-change create a constant/phaseChangeProperties dictionary
containing the phase-change model specification, e.g.

    phaseChangeModel SchnerrSauer;

    pSat            2300;   // Saturation pressure

See the following cases for an example converted from interPhaseChangeFoam:

    $FOAM_TUTORIALS/multiphase/interFoam/laminar/cavitatingBullet
    $FOAM_TUTORIALS/multiphase/interFoam/RAS/propeller
2021-01-24 23:35:17 +00:00
1adc1806df functionObjects::logFiles: Removed the writing of additional '_0' or '_<time>' files on restart
Given that logFiles now writes the log files into postProcessing/<func
name>/<time> it is no longer useful to add '_<time>' to the log file name in the
case that the file already exists without this extension.
2021-01-21 12:06:46 +00:00
a2eda110f8 foamyHexMesh: Removed unused merge distance 2021-01-19 14:38:49 +00:00
187f69de13 ListOps: Renumbering of nested lists 2021-01-19 13:40:27 +00:00
d7fd626e41 multiphaseEulerFoam: Added minimum diameter limit to KochFriedlander sintering model
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2021-01-15 15:25:18 +00:00
fe3910de34 surfaceFilmModels::kinematicSingleLayer: Updated rho -> thermo:rho 2021-01-14 15:56:39 +00:00
b5fd577934 ISstream::getLine: continuation lines are now optional 2021-01-14 12:33:15 +00:00
58ae03c9eb Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-01-14 10:53:54 +00:00
c6f69e7987 Function1/2: Updated the writing of Function1/2 entries within Function1/2s
Resolves bug-report https://bugs.openfoam.org/view.php?id=3613
2021-01-14 10:52:55 +00:00
33f2057e27 tests/fvMeshTools/cavity: Updated options passes to reconstructParMesh 2021-01-14 10:27:36 +00:00
4b8147c8ab multiphaseEulerFoam: Added error if mass transfer is specified for a stationary phase 2021-01-14 10:25:29 +00:00
407a90c065 mirrorMesh: Updated plane entries in annotated case dictionary 2021-01-14 08:33:57 +00:00
199e53fd0d dynamicMotionSolverFvMesh: Removed unsupported motion solver keywords
A dynamicMotionSolverFvMesh must now use a "motionSolver" or
"motionSolvers" entry to select the underlying motion solver. For
example, in constant/dynamicMeshDict:

    dynamicFvMesh   dynamicMotionSolverFvMesh;
    motionSolverLibs ("librigidBodyMeshMotion.so");
    motionSolver    rigidBodyMotion;
    ...

Previously the motion solver could also be specified with the keyword
"solver", but this resulted in a name clash with rigid body solvers
which are frequently specified in the same scope. For this reason, the
"solver" and "solvers" entries have been removed.
2021-01-14 08:33:57 +00:00
9e947d1644 topoSet: Renamed point entries for cylinder sources
End points of topoSet cylinder sources should now be specified as
"point1" and "point2", which is consistent with other parts of the code.

The previous keywords, "p1" and "p2" have been retained for backwards
compatibility but may be removed in future.
2021-01-14 08:33:57 +00:00
f1086e51e5 Converting conditional lookups to new dictionary::*BackwardsCompatibility methods 2021-01-14 08:33:57 +00:00
6566e6659e dictionary: Added backwards compatability lookup methods
These allows for dictionary lookups which fall back to a different,
older keyword. Both lookup and lookup-or-default methods are provided;
lookupBackwardsCompatible and lookupOrDefaultBackwardsCompatible,
respectively.

A list of keywords are provided to these methods. The first is taken to
be the current preferred name of the entry, and subsequent elements are
considered to relate to older syntax. These keywords are tried in turn.
If nothing are found then any errors or messages printed relate to the
first keyword in the list.

This centralises backwards compatability logic and allows for current
backwards compatibility settings to be conveniently searched for.
2021-01-14 08:33:57 +00:00
b3605515ae ThermophysicalTransportModels::FickianFourier,FickianEddyDiffusivity: Added support for mixing binary diffusion coefficents
Setting the 'mixtureDiffusionCoefficients' true the mass diffusion coefficient
functions with respect to the mixture 'Dm' are used directly but if set false
the binary mass diffusion coefficient functions 'D' are evaluated and mixed to
provide the mass diffusion with respect to the mixture, e.g.

Usage
    \verbatim
    laminar
    {
        model           FickianFourier;

        mixtureDiffusionCoefficients yes;

        Dm // [m^2/s]
        {
            O2 1e-2;
            O3 5e-2;
            N2 1e-2;
        }

        DT // [kg/m/s] Optional
        {
            O2 1e-2;
            O3 5e-2;
            N2 1e-2;
        }
    }
    \endverbatim

    or if binary mass diffusion coefficient functions are available they can be
    mixed to form the mass diffusion coefficients w.r.t. the mixture:

    \verbatim
    laminar
    {
        model           FickianFourier;

        mixtureDiffusionCoefficients no;

        D // [m^2/s]
        {
            O2-O2 1e-2;
            O3-O3 5e-2;
            N2-N2 1e-2;
            O3-O2 5e-2;
            O3-N2 5e-2;
            O2-N2 1e-2;
        }

        DT // [kg/m/s] Optional
        {
            O2 1e-2;
            O3 5e-2;
            N2 1e-2;
        }
    }
    \endverbatim
2021-01-13 21:22:49 +00:00