Commit Graph

1052 Commits

Author SHA1 Message Date
49c9766c44 multiphaseEulerFoam: Updated name of functionObjects library 2020-07-15 20:53:05 +01:00
b832453b72 multiphaseEulerFoam: replacement for reactingMultiphaseEulerFoam
The new multiphaseEulerFoam is based on reactingMultiphaseEulerFoam with some
improvements and rationalisation to assist maintenance and further development.

The phase system solution has been enhanced to handle two phases more
effectively and all two-phase specific models updated for compatibility so that
multiphaseEulerFoam can also replace reactingTwoPhaseEulerFoam.
When running multiphaseEulerFoam with only two-phases the default behaviour is
to solve for both phase-fractions but optionally a reference phase can be
specified so that only the other phase-fraction is solved, providing better
compatibility with the behaviour of reactingTwoPhaseEulerFoam.

All reactingMultiphaseEulerFoam and reactingTwoPhaseEulerFoam tutorials have
been updated for multiphaseEulerFoam.
2020-07-15 18:13:40 +01:00
1d9ad9aa8e reactingEulerFoam::phaseSystem: Merged with multiphaseSystem
The base phaseSystem now provides all the functionality needed for
reactingMultiphaseEulerFoam and twoPhaseSystem is a specialisation, simplifying
maintenance.
2020-07-14 15:51:44 +01:00
1c9004358d reactingEulerFoam::functionObjects::phaseMap: Corrected documentation 2020-07-14 12:11:58 +01:00
35a04f0fb8 reactingEulerFoam::functionObjects::phaseMap: New functionObject to write the phase map field
Description
    This functionObject writes the phase-fraction map field alpha.map with
    incremental value ranges for each phase
    e.g., with values 0-1 for water, 1-2 for air, 2-3 for oil etc.

    Example of function object specification:
    \verbatim
    phaseMap
    {
        type            phaseMap;
        libs            ("libreactingEulerFoamFunctionObjects.so");
        writeControl    writeTime;
    }
    \endverbatim

Usage
    \table
        Property     | Description             | Required    | Default value
        type         | type name: phaseMap     | yes         |
    \endtable

This replaces the alphas functionality previously built-in to
reactingMultiphaseEulerFoam so that the storage, calculation and writing of the
phase map field is now under user control.
2020-07-14 10:18:00 +01:00
c3d72345fb reactingMultiphaseEulerFoam: Improved the handling of the optional referencePhase
The optional reference phase fraction field is not read even if the file is
present, it is constructed with "calculated" BCs as it is a derived field.  All
other phase fraction field files are read and now must be present.
2020-07-13 18:06:44 +01:00
7412cc47e1 MomentumTransportModels::mixtureKEpsilon: Used the dispersed phase drag only for bubble generated turbulence 2020-07-10 23:49:29 +01:00
4b959ba566 multiphaseEulerFoam: Superseded by the much more general and extensible reactingMultiphaseEulerFoam 2020-07-10 20:17:25 +01:00
5c1f24054d reactingMultiphaseEulerFoam: Simplified the velocity and flux correction after partial elimination 2020-07-10 12:04:08 +01:00
2e62bfe5bc reactingMultiphaseEulerFoam: Updated remaining two-phase turbulent transport and IATE models
for compatibility with reactingMultiphaseEulerFoam when run with two-phases.
Some of these two-phase models could be enhanced to operate with multiple
dispersed phases in the future.

In order to update these models for reactingMultiphaseEulerFoam it has been
necessary to break compatibility with the now redundant twoPhaseEulerFoam solver
which has been superseded by the much more capable reactingEulerFoam solvers and
now removed.
2020-07-10 09:37:48 +01:00
27ce5a0a18 reactingMultiphaseEulerFoam: Updated partial elimination
to ensure the velocity and flux of the phases sum the conservative mixture
values obtained from the pressure solution.

Also corrected handling of MRF and updated to work with partial elimination.
2020-07-09 15:37:35 +01:00
e63f3c1e98 rhoReactingBuoyantFoam: Added pRef 2020-07-04 09:51:04 +01:00
3cc2ded6d0 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-07-03 15:45:18 +01:00
2f30c1364b heatTransfer solvers: Added optional pressure reference
Added optional pressure reference pRef to p_rgh in buoyantPimpleFoam,
buoyantSimpleFoam and chtMultiRegionFoam which handles cases in which the
pressure variation is small compared to the pressure level more accurately.

The pRef value is provided in the optional constant/pRef file.

All tutorials and templates have been updated to use pRef as appropriate.
2020-07-03 15:41:58 +01:00
3f5df8fb78 reacting*EulerFoam/.../kineticTheoryModel: Run without drag
This change protects the lookup of the drag model so that if it is not
found then the drag terms in the Theta equation are set to zero. This is
not likely to be correct usage in physical cases, but is useful for
doing uncoupled simulations for the purpose of model verification.
2020-07-03 09:04:32 +01:00
fa79bab863 interfaceCompression: New run-time selectable VoF interface compression scheme
A new run-time selectable interface compression scheme framework has been added
to the two-phase VoF solvers to provide greater flexibility, extensibility and
more consistent user-interface.  The previously built-in interface compression
is now in the standard run-time selectable surfaceInterpolationScheme
interfaceCompression:

Class
    Foam::interfaceCompression

Description
    Interface compression corrected scheme, based on counter-gradient
    transport, to maintain sharp interfaces during VoF simulations.

    The interface compression is applied to the face interpolated field from a
    suitable 2nd-order shape-preserving NVD or TVD scheme, e.g.  vanLeer or
    vanAlbada.  A coefficient is supplied to control the degree of compression,
    with a value of 1 suitable for most VoF cases to ensure interface integrity.
    A value larger than 1 can be used but the additional compression can bias
    the interface to follow the mesh more closely while a value smaller than 1
    can lead to interface smearing.

    Example:
    \verbatim
    divSchemes
    {
        .
        .
        div(phi,alpha)     Gauss interfaceCompression vanLeer 1;
        .
        .
    }
    \endverbatim

The separate scheme for the interface compression term "div(phirb,alpha)" is no
longer required or used nor is the compression coefficient cAlpha in fvSolution
as this is now part of the "div(phi,alpha)" scheme specification as shown above.

Backward-compatibility is provided by checking the specified "div(phi,alpha)"
scheme against the known interface compression schemes and if it is not one of
those the new interfaceCompression scheme is used with the cAlpha value
specified in fvSolution.

More details can be found here:
https://cfd.direct/openfoam/free-software/multiphase-interface-capturing

Henry G. Weller
CFD Direct Ltd.
2020-07-02 10:13:15 +01:00
08603410b6 basicThermo, basicSpecieMixture: Added sensible enthalpy methods 2020-06-30 08:34:15 +01:00
4d0661ccd0 alphatWallBoilingWallFunction: Added missing mapping and cloning functionality 2020-06-30 08:34:15 +01:00
393d8e17fd potentialFoam: Ensure that the flux field phi is relative in MRF regions 2020-06-29 16:53:09 +01:00
658b0c5195 reactingMultiphaseEulerFoam: Make phase fluxes relative in MRF regions 2020-06-25 19:28:19 +01:00
20c66b0c2b reactingEulerFoam::MomentumTransferPhaseSystem::AFfs: Ensure the face force field list exists for single phase 2020-06-25 10:29:03 +01:00
993bbc35de Standardised private member function section header 2020-06-24 17:08:40 +01:00
1fec2bae30 reactingEulerFoam::MomentumTransferPhaseSystem: Removed unused member function declaration 2020-06-24 17:06:01 +01:00
87c7a76e3f reactingEulerFoam::shapeModel/shapeModel.H: Updated documentation
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2020-06-24 14:51:17 +01:00
b2b9f3a56b reactingEulerFoam::shapeModels/spherical: Corrected source file link
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2020-06-24 14:48:45 +01:00
f544de4f81 setRDeltaT: Corrected typo 2020-06-24 14:40:29 +01:00
c109bec4cc chtMultiRegionFoam: Changed solid energy from enthalpy to internal energy
The solid is currently assumed incompressible (the solid pressure is not
updated) and in general would be near incompressible so internal energy is a
more appropriate energy choice than enthalpy which would require a pressure work
term currently not implemented.  Additionally due to the way in which the
conduction is handled in terms of the gradient of energy the accuracy of the
current enthalpy implementation is sensitive to the pressure distribution as
this introduces an enthalpy gradient from the p/rho term which would need to be
corrected; this issue is avoided by solving for internal energy instead.

This improvement requires the scheme and solver settings for the solids in
chtMultiRegionFoam cases to be changed from "h" to "e" and the thermo-physical
properties in <solid>/thermophysicalProperties to be set to the corresponding
internal energy forms, e.g.:

    thermo          eConst;
    .
    .
    .
    energy          sensibleInternalEnergy;

All tutorials have be updated to reflect this and provide guidance when updating
cases.
2020-06-10 15:38:54 +01:00
4250d7ce42 Added "using" statements to avoid warning messages from clang 2020-06-02 21:37:36 +01:00
80f15bd984 thermophysicalModels: Refactored mixtures
to separate those based on pure species from the simplified combustion mixtures
based on composite reactant and product pseudo species.
2020-06-02 17:24:44 +01:00
cf36a5de3c solidDisplacementFoam: Correct handling of the re-reading of the controls
when the fvSolution file is changed during the run

Resolves bug-report https://bugs.openfoam.org/view.php?id=3498
2020-05-25 11:08:59 +01:00
cda505c718 solidDisplacementFoam: Added Function1 support for the pressure specification 2020-05-20 19:14:52 +01:00
746c080603 VoF: Removed the isotropic compression option which has not proved useful for any cases 2020-05-09 14:41:15 +01:00
4c2fae3d06 thermophysicalModels: Added new tabulated equation of state, thermo and transport models
using the new nonUniformTable to interpolate between the values vs temperature
provided.  All properties (density, heat capacity, viscosity and thermal
conductivite) are considered functions of temperature only and the equation of
state is thus incompressible.  Built-in mixing rules corresponding to those in
the other thermo and transport models are not efficient or practical for
tabulated data and so these models are currently only instantiated for the pure
specie/mixture rhoThermo package but a general external mixing method will be
added in the future.

To handle reactions the Jacobian function dKcdTbyKc has been rewritten to use
the Gstd and S functions directly removing the need for the miss-named dGdT
function and hence removing the bugs in the implementation of that function for
some of the thermo models.  Additionally the Hc() function has been renamed
Hf() (heat of formation) which is more commonly used terminology and consistent
with the internals of the thermo models.
2020-05-05 20:33:45 +01:00
c45bc02d00 phaseCompressibleMomentumTransportModels: Updated R() -> sigma() 2020-05-05 18:37:11 +01:00
fe89082f73 thermophysicalModels: Centralised instantiation macros
All models that require templating on the thermodynamic model, including
the thermodynamic models themselves, are now instantiated using a
centralised set of variadic macros. Seven macros exist to instantiate
models for different classes of thermodynamics model. These are:

   forGases:          All model combinations valid for gases

   forCommonGases:    The most commonly used gas models

   forAbsoluteGases:  A limited selection of gas models with absolute
                      forms of energy, for use with Xi-combustion models

   forLiquids:        All model combinations valid for liquids

   forCommonLiquids:  The most commonly used liquid models

   forPolynomials:    Model combinations with properties fitted to
                      polynomials

   forSolids:         All model combinations valid for solids

All the *ThermoPhysics typedefs have been removed, as this system was
fundamentally not extensible. The enormous lists of thermodynamic
instantiations that existed for reaction thermos, chemistry models,
tabulation methods, etc..., were extremely difficult to read and reason
about what combinations are valid under what circumstances. This change
centralises those decisions, makes them concise and readable, and makes
them consistent across the entire codebase.

Soot model selection has now been brought up to date in line with
chemistry, combustion, and others. The angle-bracketed part of the name
is no longer necessary; this information is determined directly from the
existing thermo model. So, now to select a mixture-fraction soot model,
the entry is simply:

    sootModel   mixtureFraction;

Rather than:

    sootModel   mixtureFraction<rhoReactionThermo,gasHThermoPhysics>;

The only place in which *ThermoPhysics typedefs are still required in
the selection name is in the thermalBaffle1D boundary condition. Here
there is no thermo model from which to determine a name. This eventually
needs resolving either by adding a selection mechanism similar to that
of the thermo packages themselves, or by removing this boundary
condition in favour of the (non-1D) thermal baffle boundary condition
and region model.
2020-04-30 14:16:08 +01:00
86f2c6de00 thermophysicalTransportModels: Added nonUnityLewisEddyDiffusivity
This allows specification of a turbulent Schmidt number independent from
that of the turbulent Prandtl number. An example specification in
constant/thermophysicalTransport is as follows:

    RAS
    {
        model           nonUnityLewisEddyDiffusivity;
        Prt             0.85;
        Sct             0.7;
    }

The defaulting of the turbulent Prandtl number (Prt) to 1 has also been
removed from the eddyDiffusivity model. Now the value must be set
explicitly. The only exception is if the
constant/thermophysicalTransport dictionary is omitted entirely, in
which case eddyDiffusivity with a turbulent Prandtl number of 1 is
selected as before.
2020-04-21 11:57:26 +01:00
854daeab70 reactingEulerFoam: Instantiated PhaseThermophysicalTransportModel on rhoThermo and rhoReactionThermo
Now the PhaseThermophysicalTransportModel in reactingEulerFoam has access to
either rhoThermo or rhoReactionThermo depending on the choice of the thermo
package and provides necessary to structure to support multi-component diffusion
for reacting phases in the future.
2020-04-20 10:55:24 +01:00
d4207f56c5 psiReactionThermophysicalTransportModel: ThermophysicalTransportModel instantiated on psiReactionThermo
Updated reacting solvers to use psiReactionThermophysicalTransportModel or
rhoReactionThermophysicalTransportModel as appropriate to provide support for
interacting heat and specie transport.
2020-04-20 09:57:42 +01:00
f50c2bdb68 ThermophysicalTransportModel: Added ThermoModel argument
ThermophysicalTransportModel is now instantiated on both the
MomentmumTransportModel and also the particular thermo model model rather than
obtaining the fluidThermo from the MomentmumTransportModel.  This gives direct
access to the higher-level thermo model used in the solver, for example
rhoReactionThermo so that complex ThermophysicalTransportModels requiring access
to the composition for example are instantiated only for thermo models that
provide it and also avoiding run-time up-casting of the thermo model.
2020-04-19 22:08:10 +01:00
2bbe47cc75 ThermophysicalTransportModel::eddyDiffusivity: New common class for RAS and LES
eddyDiffusivity is a generic model for both RAS and LES to avoid the previous
code duplication.
2020-04-17 13:53:06 +01:00
ff22c54957 CompressibleMomentumTransportModel, PhaseCompressibleMomentumTransportModel: Generalised the access to the thermo model
This allowed as significant simplification of the phaseModel in
reactingEulerFoam.
2020-04-16 13:16:12 +01:00
0405176670 reactingEulerFoam: Added divq and divj function to generalise the thermal and specie transport
These function map to the corresponding functions in the
PhaseThermophysicalTransportModel to allow run-time selection and extensibility
of the phase thermophysical transport.
2020-04-15 18:48:42 +01:00
b4cf4042d1 ThermophysicalTransportModels: Added j and divj functions for specie mass-fraction transport
Provides an abstraction of specie transport to support run-times selectable and
extensible multi-component thermal and specie laminar and turbulent transport.
2020-04-15 11:24:11 +01:00
7c402dde4e Removed redundant library link statements 2020-04-15 11:17:16 +01:00
de66b1be68 MomentumTransportModels: Update of the TurbulenceModels library for all flow types
providing the shear-stress term in the momentum equation for incompressible and
compressible Newtonian, non-Newtonian and visco-elastic laminar flow as well as
Reynolds averaged and large-eddy simulation of turbulent flow.

The general deviatoric shear-stress term provided by the MomentumTransportModels
library is named divDevTau for compressible flow and divDevSigma (sigma =
tau/rho) for incompressible flow, the spherical part of the shear-stress is
assumed to be either included in the pressure or handled separately.  The
corresponding stress function sigma is also provided which in the case of
Reynolds stress closure returns the effective Reynolds stress (including the
laminar contribution) or for other Reynolds averaged or large-eddy turbulence
closures returns the modelled Reynolds stress or sub-grid stress respectively.
For visco-elastic flow the sigma function returns the effective total stress
including the visco-elastic and Newtonian contributions.

For thermal flow the heat-flux generated by thermal diffusion is now handled by
the separate ThermophysicalTransportModels library allowing independent run-time
selection of the heat-flux model.

During the development of the MomentumTransportModels library significant effort
has been put into rationalising the components and supporting libraries,
removing redundant code, updating names to provide a more logical, consistent
and extensible interface and aid further development and maintenance.  All
solvers and tutorials have been updated correspondingly and backward
compatibility of the input dictionaries provided.

Henry G. Weller
CFD Direct Ltd.
2020-04-14 20:44:22 +01:00
08e686eb18 TurbulenceModels: Refactored to transfer all heat and specie transport to the new ThermophysicalTransportModels library
This provides an extensible and run-time selectable framework to support complex
energy and specie transport models, in particular multi-component diffusion.
Currently only the Fourier for laminar and eddyDiffusivity for RAS and LES
turbulent flows are provided but the interface is general and the set of models
will be expanded in the near future.
2020-04-12 10:35:52 +01:00
25b34809c7 ThermophysicalTransportModels: New library to handle the transport of energy and species
The simplistic energy transport support in compressibleTurbulenceModels has been
abstracted and separated into the new ThermophysicalTransportModels library in
order to provide a more general interface to support complex energy and specie
transport models, in particular multi-component diffusion.  Currently only the
Fourier for laminar and eddyDiffusivity for RAS and LES turbulent flows are
provided but the interface is general and the set of models will be expanded in
the near future.

The ThermalDiffusivity and EddyDiffusivity modelling layers remain in
compressibleTurbulenceModels but will be removed shortly and the alphat boundary
conditions will be moved to ThermophysicalTransportModels.
2020-04-10 18:18:51 +01:00
7f5144312e Renamed turbulenceProperties -> momentumTransport
Following the generalisation of the TurbulenceModels library to support
non-Newtonian laminar flow including visco-elasticity and extensible to other
form of non-Newtonian behaviour the name TurbulenceModels is misleading and does
not properly represent how general the OpenFOAM solvers now are.  The
TurbulenceModels now provides an interface to momentum transport modelling in
general and the plan is to rename it MomentumTransportModels and in preparation
for this the turbulenceProperties dictionary has been renamed momentumTransport
to properly reflect its new more general purpose.

The old turbulenceProperties name is supported for backward-compatibility.
2020-04-10 17:17:37 +01:00
53ac3f223a reactingEulerFoam::phaseCompressibleTurbulenceModels: Added missing clone functions
Patch contributed by Timo Niemi, VTT.
Resolves bug-report https://bugs.openfoam.org/view.php?id=3478
2020-04-10 09:28:57 +01:00
3bd86e85e5 TurbulenceModels: Removed the redundant propertiesName constructor and selector argument 2020-04-08 11:46:24 +01:00