Commit Graph

1676 Commits

Author SHA1 Message Date
01494463d0 FoamFile: 'version' entry is now optional, defaulting to 2.0
The FOAM file format has not changed from version 2.0 in many years and so there
is no longer a need for the 'version' entry in the FoamFile header to be
required and to reduce unnecessary clutter it is now optional, defaulting to the
current file format 2.0.
2021-06-23 20:50:10 +01:00
7801f04dff dimensionSets: Added dimFlux (volumetric flux) and dimMassFlux (mass flux) 2021-06-22 17:32:31 +01:00
3baba56734 dynamicMesh: Renamed boundaryMesh to repatchMesh and removed unused code 2021-06-22 09:48:36 +01:00
0ef0247628 snappyHexMesh: Renamed shellSurfaces to the more logical refinementRegions 2021-06-21 14:22:43 +01:00
ca35389788 snappyHexMesh: 'refinementRegions', 'refinementSurfaces' and 'features' are now optional
entries in 'castellatedMeshControls' in snappyHexMeshDict to remove unnecessary clutter.
2021-06-21 13:30:53 +01:00
f4a65fbada sampling: Renamed and moved classes from fileFormats
The writer class has been renamed setWriter in order to clarify its
usage. The coordSet and setWriter classes have been moved into the
sampling library, as this fits their usage.
2021-06-18 13:57:11 +01:00
77f3c014bc searchableSurfaces: Removed dependence on the set writers 2021-06-18 13:57:09 +01:00
0ba5f5b8a9 fileFormats: Added generic write functions for VTK poly data
The new write functions are currently being utilised by setSet and the
vtkSurfaceWriter, but it should eventually be possible for more examples
of VTK poly data writing to be converted to use these functions.
2021-06-18 13:54:56 +01:00
464ad80e35 fvPatchFields: Reordered constructor definitions to match declarations 2021-06-17 10:19:05 +01:00
30d25869f3 conformalVoronoiMesh: Updated for changes to fvSubsetMesh 2021-06-16 19:13:09 +01:00
926ba22b74 refineMesh: Rationalised and standardised the coordinate axes naming to e1, e2 and e3
the previous naming tan1, tan2, normal was non-intuitive and very confusing.

It was not practical to maintain backward compatibility but all tutorials and
example refineMeshDict files have been updated to provide examples of the
change.
2021-06-15 16:08:55 +01:00
7b7fa5a9af compressibleMultiphaseInterFoam: Added test for contact angle in both phases in interface pair
to ensure that the contact angle specification is used irrespective of which
phase it is specified in.  An error is reported if both phases of the interface
pair have a contact angle specification as the specifications might be
inconsistent.

Resolves bug-report https://bugs.openfoam.org/view.php?id=3688
2021-06-15 10:14:21 +01:00
de76426d86 multiphaseInterFoam: Added test for contact angle in both phases in interface pair
to ensure that the contact angle specification is used irrespective of which
phase it is specified in.  An error is reported if both phases of the interface
pair have a contact angle specification as the specifications might be
inconsistent.

Resolves bug-report https://bugs.openfoam.org/view.php?id=3688
2021-06-14 10:42:16 +01:00
6c0087d005 multiphaseEulerFoam: Updated the internal energy pressure work term
The pressure work term for total internal energy is div(U p) which can be
discretised is various ways, given a mass flux field phi it seems logical to
implement it in the form div(phi/interpolate(rho), p) but this is not exactly
consistent with the relationship between enthalpy and internal energy (h = e +
p/rho) and the transport of enthalpy, it would be more consistent to implement
it in the form div(phi, p/rho).  A further improvement in consistency can be
gained by using the same convection scheme for this work term and the convection
term div(phi, e) and for reacting solvers this is easily achieved by using the
multi-variate limiter mvConvection provided for energy and specie convection.

This more consistent total internal energy work term has now been implemented in
all the compressible and reacting flow solvers and provides more accurate
solutions when running with internal energy, particularly for variable density
mixing cases with small pressure variation.

For non-reacting compressible solvers this improvement requires a change to the
corresponding divScheme in fvSchemes:

    "div\(alphaPhi.*,p\)" -> "div\(alphaRhoPhi.*,\(p\|thermo:rho.*\)\)"

and all the tutorials have been updated accordingly.
2021-06-11 19:36:33 +01:00
90831fbb55 Compressible and reacting flow solvers: Changed the internal energy pressure work for consistency with enthalpy
The pressure work term for total internal energy is div(U p) which can be
discretised is various ways, given a mass flux field phi it seems logical to
implement it in the form div(phi/interpolate(rho), p) but this is not exactly
consistent with the relationship between enthalpy and internal energy (h = e +
p/rho) and the transport of enthalpy, it would be more consistent to implement
it in the form div(phi, p/rho).  A further improvement in consistency can be
gained by using the same convection scheme for this work term and the convection
term div(phi, e) and for reacting solvers this is easily achieved by using the
multi-variate limiter mvConvection provided for energy and specie convection.

This more consistent total internal energy work term has now been implemented in
all the compressible and reacting flow solvers and provides more accurate
solutions when running with internal energy, particularly for variable density
mixing cases with small pressure variation.

For non-reacting compressible solvers this improvement requires a change to the
corresponding divScheme in fvSchemes:

    div(phiv,p) -> div(phi,(p|rho))

and all the tutorials have been updated accordingly.
2021-06-11 11:34:38 +01:00
881bbfa591 chtMultiRegionFoam: Added optional hydrostatic initialisation of pressure
Class
    Foam::hydrostaticInitialisation

Description
    Optional hydrostatic initialisation of p_rgh and p by solving for and
    caching the hydrostatic ph_rgh and updating the density such that

        p = ph_rgh + rho*gh + pRef

    This initialisation process is applied at the beginning of the run (not on
    restart) if the \c hydrostaticInitialisation switch is set true in
    fvSolution/PIMPLE or fvSolution/SIMPLE.  The calculation is iterative if the
    density is a function of pressure and an optional number of iterations \c
    nHydrostaticCorrectors may be specified which defaults to 5.
2021-06-11 11:33:31 +01:00
012df9d699 chtMultiRegionFoam: Added optional hydrostatic initialisation of pressure
Class
    Foam::hydrostaticInitialisation

Description
    Optional hydrostatic initialisation of p_rgh and p by solving for and
    caching the hydrostatic ph_rgh and updating the density such that

        p = ph_rgh + rho*gh + pRef

    This initialisation process is applied at the beginning of the run (not on
    restart) if the \c hydrostaticInitialisation switch is set true in
    fvSolution/PIMPLE or fvSolution/SIMPLE.  The calculation is iterative if the
    density is a function of pressure and an optional number of iterations \c
    nHydrostaticCorrectors may be specified which defaults to 5.
2021-06-11 11:31:19 +01:00
bc844c383c multiphaseEulerFoam: populationBalance: Store coalescence and breakup pair indexing
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2021-06-08 09:03:33 +01:00
3f9435fb18 multiphaseEulerFoam: populationBalance: Revised algebraic operations
Field algebra has been optimised by careful ordering to minimise the
number of expensive operations; e.g., changing a/b/c to a/(b*c) in order
to minimise the number of divisions.

Some minor consistency improvements have also been made throughout
population balance.

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2021-06-08 08:55:17 +01:00
8fec877d5b multiphaseEulerFoam: populationBalance: Simplifed drift term implementation
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2021-06-04 10:51:38 +01:00
1a3ae93fb3 multiphaseEulerFoam: Ensure mass transfer rates stay registered 2021-06-03 16:57:11 +01:00
6c21d5d8ef Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-06-01 19:13:02 +01:00
ee777e4083 Standardise on British spelling: -ize -> -ise
OpenFOAM is predominantly written in Britain with British spelling conventions
so -ise is preferred to -ize.
2021-06-01 19:11:58 +01:00
9e2a05b4cc multiphaseEulerFoam: Added interface composition population balance system
A phase system has been added that combines interface composition phase
change modelling and population balance modelling. It can be selected in
constant/phaseProperties using the following setting:

    type    interfaceCompositionPhaseChangePopulationBalanceMultiphaseSystem;

In order to facilitate the operation of population balance models with
mass transfers generated by the interface composition system, the full
interfacial mass transfer rate is now being stored, as well as the
linearised specie transfers. This means the mass transfer rates
associated with the interface composition mechanism can be looked up and
utilised by sub models.

Based on a patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2021-06-01 15:54:29 +01:00
55f751641e Standardise on British spelling: initialize -> initialise
OpenFOAM is predominantly written in Britain with British spelling conventions
so -ise is preferred to -ize.
2021-06-01 14:51:48 +01:00
789bdc02c3 fluidThermo::hydrostaticInitialisation: Generalised hydrostatic initialisation of pressure
for buoyant solvers buoyantPimpleFoam, buoyantSimpleFoam and
buoyantReactingFoam:

Class
    Foam::hydrostaticInitialisation

Description
    Optional hydrostatic initialisation of p_rgh and p by solving for and
    caching the hydrostatic ph_rgh and updating the density such that

        p = ph_rgh + rho*gh + pRef

    This initialisation process is applied at the beginning of the run (not on
    restart) if the \c hydrostaticInitialisation switch is set true in
    fvSolution/PIMPLE or fvSolution/SIMPLE.  The calculation is iterative if the
    density is a function of pressure and an optional number of iterations \c
    nHydrostaticCorrectors may be specified which defaults to 5.
2021-06-01 11:57:55 +01:00
a997ddae5f buoyantReactingFoam: Added optional hydrostatic initialisation and replaced fireFoam
The fireFoam solver has solver has been replaced by the more general
buoyantReactingFoam solver, which supports buoyant compressible reacting flow
coupled to multiple run-time-selectable lagrangian clouds and surface film
modelling and optional hydrostatic initialisation of the pressure and p_rgh.

Hydrostatic initialisation of the pressure fields is useful for large fires in
open domains where the stability of the initial flow is dominated by the initial
pressure distribution in the domain and at the boundaries.  The optional
hydrostaticInitialization switch in fvSolution/PIMPLE with
nHydrostaticCorrectors enables hydrostatic initialisation, e.g.

PIMPLE
{
    momentumPredictor yes;
    nOuterCorrectors  1;
    nCorrectors       2;
    nNonOrthogonalCorrectors 0;

    hydrostaticInitialization yes;
    nHydrostaticCorrectors 5;
}

and the resulting ph_rgh field can be used with the prghTotalHydrostaticPressure
p_rgh boundary condition to apply this hydrostatic pressure distribution at the
boundaries throughout the simulation.

See the following cases for examples transferred from fireFoam:

    $FOAM_TUTORIALS/combustion/buoyantReactingFoam/RAS
2021-05-31 15:05:19 +01:00
49ce8f6507 fvModels: Added new clouds and surfaceFilm fvModels to replace specialised solvers
With the new fvModels framework it is now possible to implement complex models
and wrappers around existing complex models which can then be optionally
selected in any general solver which provides compatible fields and
thermophysical properties.  This simplifies code development and maintenance by
significantly reducing complex code duplication and also provide the opportunity
of running these models in other solvers without the need for code duplication
and alteration.

The immediate advantage of this development is the replacement of the
specialised Lagrangian solvers with their general counterparts:

reactingParticleFoam        -> reactingFoam
reactingParcelFoam          -> reactingFoam
sprayFoam                   -> reactingFoam
simpleReactingParticleFoam  -> reactingFoam
buoyantReactingParticleFoam -> buoyantReactingFoam

For example to run a reactingParticleFoam case in reactingFoam add the following
entries in constant/fvModels:

buoyancyForce
{
    type        buoyancyForce;
}

clouds
{
    type    clouds;
    libs    ("liblagrangianParcel.so");
}

which add the acceleration due to gravity needed by Lagrangian clouds and the
clouds themselves.

See the following cases for examples converted from reactingParticleFoam:

    $FOAM_TUTORIALS/combustion/reactingFoam/Lagrangian

and to run a buoyantReactingParticleFoam case in buoyantReactingFoam add the
following entry constant/fvModels:

clouds
{
    type    clouds;
    libs    ("liblagrangianParcel.so");
}

to add support for Lagrangian clouds and/or

surfaceFilm
{
    type    surfaceFilm;
    libs    ("libsurfaceFilmModels.so");
}

to add support for surface film.  The buoyancyForce fvModel is not required in
this case as the buoyantReactingFoam solver has built-in support for buoyancy
utilising the p_rgh formulation to provide better numerical handling for this
force for strongly buoyancy-driven flows.

See the following cases for examples converted from buoyantReactingParticleFoam:

    $FOAM_TUTORIALS/combustion/buoyantReactingFoam/Lagrangian

All the tutorial cases for the redundant solvers have been updated and converted
into their new equivalents and redirection scripts replace these solvers to
provide users with prompts on which solvers have been replaced by which and
information on how to upgrade their cases.

To support this change and allow all previous Lagrangian tutorials to run as
before the special Lagrangian solver fvSolution/PIMPLE control
solvePrimaryRegion has been replaced by the more general and useful controls:

    models          : Enable the fvModels
    thermophysics   : Enable thermophysics (energy and optional composition)
    flow            : Enable flow (pressure/velocity system)

which also replace the fvSolution/PIMPLE control frozenFlow present in some
solvers.  These three controls can be used in various combinations to allow for
example only the fvModels to be evaluated, e.g. in

$FOAM_TUTORIALS/combustion/buoyantReactingFoam/Lagrangian/rivuletPanel

PIMPLE
{
    models          yes;
    thermophysics   no;
    flow            no;
    .
    .
    .

so that only the film is solved.  Or during the start-up of a case it might be
beneficial to run the pressure-velocity system for a while without updating
temperature which can be achieved by switching-off thermophysics.  Also the
behaviour of the previous frozenFlow switch can be reproduced by switching flow
off with the other two switches on, allowing for example reactions, temperature
and composition update without flow.
2021-05-31 10:45:16 +01:00
2a38355945 compressibleInterFoam: Minor improvements to the VoFClouds and VoFSurfaceFilm fvModels 2021-05-26 08:45:14 +01:00
4064161331 dynamicLibrary::compileTemplate: Standardised naming convention for the dynamic compilation template files
which now all have Template.H or Template.C appended to differentiate them from
standard OpenFOAM library files.
2021-05-20 10:52:57 +01:00
276e4452d7 compressibleInterFoam::pEqn: Add fvModels contribution to the continuity correction after phase-fraction filtering
The phase-fraction filtering of the compressibility terms is present to avoid
spurious phase-change due to numerical noise.  The fvModels contribution may
cause physical phase-change due to cavitation, boiling, transfer from film or
VoF even where none of the phase is present and hence must be added after the
compressibility filtering.
2021-05-13 16:17:44 +01:00
707fb6d849 compressibleInterFoam: Added the Lagrangian fvModel VoFClouds
With VoFClouds and VoFSurfaceFilm compressibleInterFoam supports Lagrangian
clouds which can impinge on walls forming a film which in turn can transfer to
the VoF when the film is thick enough to resolve.  The new tutorial case

tutorials/multiphase/compressibleInterFoam/laminar/cylinder

is provided to demonstrate this functionality.

Direct transfer of droplets to the VoF phase is not yet supported but will be
added later.
2021-05-13 10:33:56 +01:00
5c8dc9c2f1 lagrangian: Simplified and rationalised SLGThermo pending a more general and extensible replacement
The reduced SLGThermo has been renamed parcelThermo to better represent the
purpose.

parcelThermo is not created and stored in the cloud that requires it rather than
requiring it to be created in the solver createFields and passed to the cloud on
construction.
2021-05-12 14:17:45 +01:00
845d5b16e3 transformPoints: Generalised to apply a sequence of transformations
This makes usage of transformPoints the same as for
surfaceTransformPoints. Transformations are supplied as a string and are
applied in sequence.

Usage
    transformPoints "\<transformations\>" [OPTION]

    Supported transformations:
      - "translate=<translation vector>"
        Translational transformation by given vector
      - "rotate=(<n1 vector> <n2 vector>)"
        Rotational transformation from unit vector n1 to n2
      - "Rx=<angle [deg] about x-axis>"
        Rotational transformation by given angle about x-axis
      - "Ry=<angle [deg] about y-axis>"
        Rotational transformation by given angle about y-axis
      - "Rz=<angle [deg] about z-axis>"
        Rotational transformation by given angle about z-axis
      - "Ra=<axis vector> <angle [deg] about axis>"
        Rotational transformation by given angle about given axis
      - "scale=<x-y-z scaling vector>"
        Anisotropic scaling by the given vector in the x, y, z
        coordinate directions

    Example usage:
        transformPoints \
            "translate=(-0.05 -0.05 0), \
            Rz=45, \
            translate=(0.05 0.05 0)"
2021-05-11 10:06:45 +01:00
643fbbd1d5 compressibleInterFoam: Created run-time loadable library for VoFSurfaceFilm
Now the VoFSurfaceFilm library is optionally loaded at run-time for cases that
require surface film by adding the optional "libs" entry in controlDict:

libs            ("libVoFSurfaceFilm.so");

See tutorials/multiphase/compressibleInterFoam/laminar/plateFilm
2021-05-10 13:49:18 +01:00
ef0dced356 compressibleInterFoam: Created run-time loadable library for VoFSurfaceFilm
Now the VoFSurfaceFilm library is optionally loaded at run-time for cases that
require surface film by adding the optional "libs" entry in controlDict:

libs            ("libVoFSurfaceFilm.so");

See tutorials/multiphase/compressibleInterFoam/laminar/plateFilm
2021-05-10 13:45:56 +01:00
e8ff92cd67 CorrectPhi: Added pressureReference argument to set the reference cell
so that the same reference cell is used for pcorr and p or p_rgh to improve
consistency between flux and flux correction.
2021-04-30 21:07:15 +01:00
61f3662b0a foamDictionary: Added writePrecision option 2021-04-30 09:14:44 +01:00
9c7328c097 thermophysicalModels: Improved compilation error message generated for unsupported combination of properties and mixing
in particular for equations of state which do not support coefficient mixing
required by equilibrium constant evaluation in reactions.

Also improved the set of pre-compiled combinations of properties and mixing
rules.
2021-04-29 18:48:15 +01:00
dd06d98c16 multiphaseEulerFoam: Renamed Laakkonen et al models
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2021-04-28 16:52:06 +01:00
ab7d010a9a fvConstraints: Added limitPressure which replaces pressureControl.limit
To provide more flexibility, extensibility, run-time modifiability and
consistency the handling of optional pressure limits has been moved from
pressureControl (settings in system/fvSolution) to the new limitPressure
fvConstraint (settings in system/fvConstraints).

All tutorials have been updated which provides guidance when upgrading cases but
also helpful error messages are generated for cases using the old settings
providing specific details as to how the case should be updated, e.g. for the
tutorials/compressible/rhoSimpleFoam/squareBend case which has the pressure
limit specification:

SIMPLE
{
...
    pMinFactor      0.1;
    pMaxFactor      2;
...

generates the error message

--> FOAM FATAL IO ERROR:
Pressure limits should now be specified in fvConstraints:

limitp
{
    type       limitPressure;

    minFactor  0.1;
    maxFactor  2;
}

file: /home/dm2/henry/OpenFOAM/OpenFOAM-dev/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution/SIMPLE from line 41 to line 54.
2021-04-27 10:25:28 +01:00
974712b2bd thermophysicalModels: Removed seldom used or unused instantiations
Now that dynamic compilation of thermo and chemistry is available it is no
longer necessary or useful to instantiate vast numbers of thermo combinations
within the standard OpenFOAM libraries.  This reduces compile time, library size
and simplifies maintenance.
2021-04-21 21:22:52 +01:00
735c169a25 Corrected documentation for Doxygen
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2021-04-19 14:34:10 +01:00
ed5341f7f2 multiphaseEulerFoam: InterfaceCompositionPhaseChangePhaseSystem: Fixed sign
Resolves bug report https://bugs.openfoam.org/view.php?id=3664
2021-04-15 11:57:25 +01:00
b6114a79ee Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-04-15 10:46:13 +01:00
3de28f8736 interFoam,compressibleInterFoam,multiphaseEulerFoam: Ensure divU is registered for mapping
divU is cached before mesh-motion and mapped post-motion to drive the optional pcorr flux
update to ensure the fluxes are conservative following mesh motion and change.
2021-04-15 10:44:04 +01:00
000876bbc6 multiphaseEulerFoam: Pressure implicit thermal mass transfer
The phase system now have the ability to specify the derivative of mass
transfer rates w.r.t. pressure. This permits implicit handling of
pressure-coupled mass transfer processes.

This implicit handling has been applied to the mass transfers that are
modelled by the thermal phase system. This should result in significant
stability improvements. The implicit handling can be toggled on or off
by means of a "pressureImplicit" switch in constant/phaseProperties. It
is on by default.

Patch contributed by Juho Peltola, VTT.
2021-04-14 16:28:27 +01:00
bf340f02e3 twoPhaseMixtureThermo: Corrected Alpha2 constructor
Resolves bug-report https://bugs.openfoam.org/view.php?id=3662
2021-04-14 11:35:48 +01:00
4f6ea81d0c multiphaseEulerFoam: LaakkonenAlopaeusAittamaa: Updated to a more recent reference
The former implementation of the daughterSizeDistributionModel based on
Laakkonen et al. (2006) had the issue of not conserving the total
particle number and volume properly, except when the coefficient C4 is
set to a value of 2. The issue is solved by following the work of
Laakkonen et al. (2007).

The default coefficients in both the breakupModel and the
daughterSizeDistributionModel were updated as well according to the
suggestions of the authors.

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
and VTT Technical Research Centre of Finland Ltd.
2021-04-13 15:07:15 +01:00
65d28880fa multiphaseEulerFoam: daughterSizeDistributionModels: Removed particleNumber parameter
The current implementation of the uniform daughterSizeDistribution model
is not general enough to support uniform breakup into multiple fragments
while conserving both the total particle number and volume, except for
binary breakup (which was the default setting).

The model has therefore been renamed to uniformBinary, i.e. resulting in
two fragments.

It is currently used for verification purposes only. If the need for a
more general form arises, then that will require additional development.

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
and VTT Technical Research Centre of Finland Ltd.
2021-04-13 14:51:57 +01:00