Commit Graph

5296 Commits

Author SHA1 Message Date
ad1f53a06d Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-06-15 16:11:55 +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
301eac2089 primitives: Added 2D barycentric tensor 2021-06-15 13:50:58 +01:00
be9fb841a1 snappyHexMesh: Simplified and rationalised the region refinement level specification
The inside or outside region refinement level is now specified using the simple
"level <level>" entry in refinementRegions e.g.

    refinementRegions
    {
        refinementBox
        {
            mode    inside;
            level   5;
        }
    }

rather than

    refinementRegions
    {
        refinementBox
        {
            mode    inside;
            levels  ((1E15 5));
        }
    }

where the spurious "1E15" number is not used and the '((...))' is unnecessary clutter.
2021-06-15 13:20:44 +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
28745eca4b multiphaseEulerFoam: Updated tutorials for improved internal energy pressure work term 20210612 2021-06-11 23:23:17 +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
62c782367d multiphaseEulerFoam: Formatting improvements to population balance test cases
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2021-06-11 14:17:39 +01:00
8106c1bef4 unityLewisFourier,unityLewisEddyDiffusivity: Changed the specie diffusivity to be based on the enthalpy diffusivity
such that the Lewis number is unity with respect to enthalpy even when solving
for internal energy providing more consistent behaviour between the energy
choices.
2021-06-11 12:06:01 +01:00
0ea1b2cb00 ThermophysicalTransportModels: Changed the thermal differential diffusion term to use sensible enthalpy
Differential diffusion of species requires a corresponding term in the enthalpy
equation and the same term in the internal energy equation, not the analogous
term for internal energy as previously implemented.  With this correction the
internal energy equation is now consistent with the enthalpy equation.
2021-06-11 11:57:54 +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
3e62cc93a5 caseDicts: improved usability of sample topoSetDict files 2021-06-11 10:44:04 +01:00
f8066490e9 cloudProperties: grouped related entries in injectionModels 2021-06-11 09:59:09 +01:00
73bf986396 scalarTransport: removed risky ".*" regex in sample 's' field file 2021-06-11 09:39:11 +01:00
a1036ec012 templates: usability improvements in snappyHexMeshDict 2021-06-11 09:34:43 +01:00
a6de41a1bf cubicGradientLimiter: Corrected cubic coefficients
Resolves bug-report https://bugs.openfoam.org/view.php?id=3684
2021-06-10 09:04:58 +01:00
eea13a52b2 cubicGradientLimiter: Corrected cubic coefficients
Resolves bug-report https://bugs.openfoam.org/view.php?id=3684
2021-06-10 08:43:26 +01:00
d92434cad0 functionObjects::fieldAverage: Added support for internal fields
Patch contributed by Timo Niemi, VTT.
Resolves patch request https://bugs.openfoam.org/view.php?id=3682
2021-06-08 16:40:38 +01:00
d739b7e36f finiteVolume: LimitedScheme: Correction when using "patchType" overrides 2021-06-08 15:00:48 +01:00
e6ce04f070 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-06-08 13:25:38 +01:00
fd9a97c42e kOmega: Corrected documentation 2021-06-08 13:25:24 +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
52298a5ff1 src/thermophysicalModels/basic/Make/files: Added hydrostaticInitialisation 2021-06-01 13:29:23 +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
4344414d0c Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-06-01 10:48:07 +01:00
44bb20af03 dynamicCode::basicChemistryModelTemplate.C: Corrected cpp test for TDAC 2021-06-01 10:47:31 +01:00
af7b5bed7c tests: Updated for new pimple controls 2021-06-01 09:07:21 +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
86a5a39a4e ReactingMultiphaseParcel: Corrected type tests for "none" models 2021-05-29 23:34:40 +01:00
a6cf873a00 parcelThermo: Added copy constructor to clone the liquid and solid properties 2021-05-29 23:09:56 +01:00
2a38355945 compressibleInterFoam: Minor improvements to the VoFClouds and VoFSurfaceFilm fvModels 2021-05-26 08:45:14 +01:00
f8fc2fd029 lagrangian::ReactingCloud: Removed redundant specie Srho source function
superseded by the SYi source function.
2021-05-26 08:43:27 +01:00
e99737fd1b TDACChemistryModel: Removed redundant variableTimeStep_ variable
Resolves bug-report https://bugs.openfoam.org/view.php?id=3680
2021-05-24 12:26:31 +01:00
2cff2ab7be Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 20210522 2021-05-21 11:52:34 +01:00
562df25d13 functionObjects::timeControl: Updated to use beginTime
for consistency with the handling of restarts in Time.  See

commit 7aca9bfa78
Author: Henry Weller <http://cfd.direct>
Date:   Fri Dec 11 13:37:16 2020 +0000

    Time: Added beginTime used to rationalise the write times when restarting

    Now if a case is restarted from an arbitrary time, for example one generated at
    a premature stop condition, or with an increased writeInterval, the subsequent
    time directories written are referenced to the original start time of the case
    rather than the restart time.
2021-05-21 11:50:40 +01:00
46e878e20d etc: pataview: Automatically detect the newest available version of cmake 2021-05-21 11:13:47 +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
811abdfc4b test/multiphase/multiphaseEulerFoam: Removed unused "name" entry from codedFunctionObjects 2021-05-19 18:09:43 +01:00
178828a921 codedBase: Merged with CodedBase to simplify and rationalise the implementation 2021-05-19 17:59:52 +01:00