Commit Graph

5749 Commits

Author SHA1 Message Date
adf6f25c0e compressibleMultiphaseInterFoam: Added missing fvModels.correct() 2022-02-15 18:34:16 +00:00
a6cee0edbc dimensionSets: Reformatted so the .C and .H files match 2022-02-15 18:33:52 +00:00
3b037cd6c3 multiphaseEulerFoam::phaseSystem: Added access to deltaN 2022-02-14 12:50:53 +00:00
dbc4b4b20b tutorials::wingMotion_snappyHexMesh::blockMeshDict: replaced symmetryPlane with patch
to ensure createPatch removes the original front and back patches after
extrusion.
2022-02-10 19:54:58 +00:00
5e8439aab1 setRDeltaT: Added support for optional minDeltaT
For some cases, in particular those with very small cells created by snapping in
corners for example, it may be beneficial to convergence rate to limit the
minimum LTS time-step, the new minDeltaT control provides this.
2022-02-10 15:57:46 +00:00
0eca1c697a hexRef8.H: Corrected function documentation formatting 2022-02-10 14:48:56 +00:00
989cf27554 snappyHexMesh, createPatch: Keep all constraint patches even if zero size
This change ensures that special constraint type patches, like internal used for
load-balancing, are not deleted by snappyHexMesh or createPatch.
2022-02-10 14:47:07 +00:00
a82f5a6fe2 GeometricField: Move sub-classes outside of the field
This permits forward declaration of the boundary and internal fields.
References and pointers to boundary fields and sliced internal fields
can now be used in situations where full instantiation of the geometric
field is not possible due to cyclic dependencies.

It has been possible as a result of this change to type the pointer to
the cell volumes field in fvMesh. Previously this was done with a void
pointer and explicit casting.
2022-02-10 09:45:41 +00:00
a2bfa0e911 multiphaseEulerFoam: noSintering: Corrected dimensions 2022-02-09 11:59:28 +00:00
c468a63830 compressibleInterFoam::VoFSurfaceFilm: Added maxDeltaT
to limit the time-step by comparing the film Courant number with the maximum
Courant number obtain from the optional maxCo entry in the system/<film
region>/fvSolution file.  If maxCo is not provided the film model does not limit
the time-step.

See tutorials/multiphase/compressibleInterFoam/laminar/cylinder as an example
demonstrating this functionality.
2022-02-09 11:45:42 +00:00
3ec5bf9257 setDeltaT: Simplified implementation 2022-02-09 11:44:20 +00:00
e478bb9b09 fvModels: Added maxDeltaT() function to provide a time-step limiter
fvModels.maxDeltaT() calls are now included in the setDeltaT.H files to
additionally limit the time-step if any fvModel require it.
2022-02-08 16:27:06 +00:00
e22870f508 compressibleMultiphaseInterFoam: Added contErr to avoid unboundedness in U and T 2022-02-08 16:25:44 +00:00
13b78294ff compressibleMultiphaseInterFoam: Added support for fvModels and fvConstraints 2022-02-08 16:25:10 +00:00
83f0335151 totalPressureFvPatchScalarField: Updated documentation 2022-02-07 23:44:33 +00:00
5a31b3bf44 dynamicPressureFvPatchScalarField: Simplified the handling of the external kinetic energy 2022-02-07 21:03:41 +00:00
c45f189750 dynamicPressureFvPatchScalarField: Updated to use the patch density
when evaluating the external total pressure from the static pressure and
tangential velocity.  This improves numerical stability and solution smoothness
for compressible cases.
2022-02-07 18:48:15 +00:00
a36082e62f totalPressureFvPatchScalarField: Formalised the handling of external tangential flow
The external pressure p0 is now formally the static pressure in the presence of
tangential flow and the corresponding total pressure is calculated from this
static pressure using the tangential velocity obtained from the
pressureInletOutletVelocity boundary condition if available.  In the case that
there is no external tangential flow the external total pressure is equal to the
static pressure p0 as before.

Description
    Inflow, outflow and entrainment pressure boundary condition based on a
    constant total pressure assumption.

    For outflow the patch pressure is set to the external static pressure.

    For inflow the patch pressure is evaluated from the patch velocity and the
    external total pressure obtained from the external static pressure \c p_0
    and external velocity \c U_0 which is looked-up from the the optional \c
    tangentialVelocity entry in the \c pressureInletOutletVelocity velocity
    boundary condition for the patch if that boundary condition is used,
    otherwise \c U_0 is assumed zero and the external total pressure is equal to
    the external static pressure.

    The patch pressure is evaluated from the external conditions using one of
    the following expressions depending on the flow conditions and
    specification of compressibility:

    1. incompressible subsonic:
        \f[
            p_p = p_0 + 0.5 |U_0|^2 - 0.5 |U|^2
        \f]
        where
        \vartable
            p_p     | pressure at patch [m^2/s^2]
            p_0     | external static pressure [m^2/s^2]
            U       | velocity [m/s]
            U_0     | external velocity [m/s]
        \endvartable

    2. compressible subsonic:
        \f[
            p_p = p_0 + 0.5 \rho |U_0|^2 - 0.5 \rho |U|^2
        \f]
        where
        \vartable
            p_p     | pressure at patch [Pa]
            p_0     | external static pressure [Pa]
            \rho    | density [kg/m^3]
            U       | velocity [m/s]
            U_0     | external velocity [m/s]
        \endvartable

    3. compressible transonic (\f$\gamma = 1\f$):
        \f[
            p_p = \frac{p_0 + 0.5 \rho |U_0|^2}{1 + 0.5 \psi |U|^2}
        \f]
        where
        \vartable
            p_p     | pressure at patch [Pa]
            p_0     | external static pressure [Pa]
            \psi    | compressibility [m^2/s^2]
            \rho    | density [kg/m^3]
            U       | velocity [m/s]
            U_0     | external velocity [m/s]
        \endvartable

    4. compressible supersonic (\f$\gamma > 1\f$):
        \f[
            p_p = \frac{p_0 + 0.5 \rho |U_0|^2}
                       {(1 + 0.5 \psi G |U|^2)^{\frac{1}{G}}}
        \f]
        where
        \vartable
            p_p     | pressure at patch [Pa]
            p_0     | external static pressure [Pa]
            \psi    | compressibility [m^2/s^2]
            \rho    | density [kg/m^3]
            G       | coefficient given by \f$\frac{\gamma}{1-\gamma}\f$ []
            \gamma  | ratio of specific heats (Cp/Cv) []
            U       | velocity [m/s]
            U_0     | external velocity [m/s]
        \endvartable

    The modes of operation are set by the dimensions of the pressure field
    to which this boundary condition is applied, the \c psi entry and the value
    of \c gamma:
    \table
        Mode                    | dimensions | psi   | gamma
        incompressible subsonic | p/rho      |       |
        compressible subsonic   | p          | none  |
        compressible transonic  | p          | psi   | 1
        compressible supersonic | p          | psi   | > 1
    \endtable

Usage
    \table
        Property     | Description                | Required | Default value
        U            | Velocity field name        | no       | U
        phi          | Flux field name            | no       | phi
        rho          | Density field name         | no       | rho
        psi          | Compressibility field name | no       | none
        gamma        | (Cp/Cv)                    | no       | 1
        p0           | External pressure          | yes      |
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            totalPressure;
        p0              uniform 1e5;
    }
    \endverbatim
2022-02-07 12:59:25 +00:00
fec6837f8f tutorials/multiphase: totalPressure -> prghTotalPressure
For most multiphase flows it is more appropriate to evaluate the total pressure
from the static pressure obtained from p_rgh rather than from p_rgh directly.
2022-02-07 12:32:20 +00:00
f85f45fe4b tutorials/multiphase/interFoam/laminar/wave: Added tangentialVelocity to top boundary
to match the air flow in the domain.
2022-02-06 19:21:33 +00:00
5df9ec5b1e tutorials/heatTransfer/buoyantSimpleFoam: Updated solver settings to improve convergence
Also changed from internal energy to enthalpy which is preferable for
steady-state simulations.
2022-02-06 11:44:07 +00:00
3f2f3c8a43 totalPressureFvPatchScalarField: Improved handling of the pressureInletOutletVelocity tangential velocity 2022-02-04 22:09:13 +00:00
a7030ee97e CompactListList: Removed unnecessary templating and create unallocated base 2022-02-04 15:17:27 +00:00
05bb716bf8 totalPressureFvPatchScalarField: Updated handling of tangentialVelocity 2022-02-04 15:07:08 +00:00
66600b5497 chtMultiRegionFoam: Corrected multiple fluid region support for nEcorr
Resolves bug-report https://bugs.openfoam.org/view.php?id=3799
2022-02-04 15:05:53 +00:00
c8cecdfff4 fvPatchFields: Replaced 1 - pos0(phi) with the simpler neg(phi) 2022-02-04 14:14:34 +00:00
edce47e02c Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-02-03 21:08:56 +00:00
68cb2aef55 solidBodyMotionFunctions::sixDoFMotion: Corrected reading of translationRotation entry
following mesh change.

Resolves bug-report https://bugs.openfoam.org/view.php?id=3798
2022-02-03 21:07:40 +00:00
2fc40b7895 multiphaseEulerFoam: blending: Skip coefficient evaluation for constant case 2022-02-03 15:47:37 +00:00
f45ad46f37 sampling: Corrected the order of cell and face points in a line-cell-face sampled set 2022-02-03 14:44:58 +00:00
991489eeb8 fvModels::actuationDiskSource: Corrected handling of source orientation
The flow rate to the disk is now (dHat & U_o) and the momentum source
orientation dHat where dHat is the unit disk direction (orientation).

    Constant values for momentum source for actuation disk
    \f[
        T = 2 \rho A (\hat{d}\dot U_{o})^2 a (1-a) \hat{d}
    \f]

    where:
    \vartable
        A    | Disk area
        dHat | Unit disk direction
        U_o  | Upstream velocity
        a    | 1 - Cp/Ct
        Cp   | Power coefficient
        Ct   | Thrust coefficient
    \endvartable
2022-02-03 11:03:30 +00:00
e4277bedf5 pressureInletOutletVelocityFvPatchVectorField: Updated documentation 2022-02-02 21:37:17 +00:00
96de80cf4a fvModels::actuationDiskSource: Added phase support
actuationDiskSource can now be applied to a phase in multiphaseEulerFoam, this
is most likely to be useful in regions where a single phase is present.
2022-02-02 18:58:09 +00:00
39a8cb41a2 multiphaseEulerFoam: BlendedInterfacialModel: Fix for Clang 2022-02-01 15:09:55 +00:00
1f461cd53b fieldMapper: Use FOR_ALL_FIELD_TYPES to reduce duplication/boilerplate 2022-02-01 13:26:52 +00:00
6d91cb289c tutorials::counterFlowFlame2D_GRI, floatingObject: Added -cellDist
to write the cellDist processor distribution files for
decomposition/redistribution post-processing and diagnostics.
2022-02-01 11:33:02 +00:00
827be2d71d fvMeshDistributor::New: Only construct a real distributor when running in parallel
otherwise return a fvMeshDistributors::none
2022-02-01 11:32:27 +00:00
360fd3f804 tutorials/multiphase/interFoam/RAS/DTCHull: Improved LTS settings
Following a rationalisation of the Courant number used to set the LTS time-step
the LTS settings needed to be changed to improve convergence.
2022-01-29 09:10:39 +00:00
3c2fc7ca99 zeroDimensionalFvMesh: Centralised generation of zero-dimensional meshes 2022-01-28 17:25:22 +00:00
ba130ec083 multiphase: Rationalised alphaContactAngle handling
Alpha contact angle boundaries are now specified in the following way
for multiphase solvers (i.e., multiphaseInterFoam,
compressibleMultiphaseInterFoam, and multiphaseEulerFoam):

   boundaryField
   {
       wall
       {
           type            alphaContactAngle;
           contactAngleProperties
           {
               water
               {
                   // Constant contact angle
                   theta0 90;
               }
               oil
               {
                   // Dynamic contact angle
                   theta0 90;
                   uTheta 1;
                   thetaA 125;
                   thetaR 85;
               }
           }
           value           uniform 0;
       }
   }

All solvers now share the same implementation of the alphaContactAngle
boundary condition and the contact angle correction algorithm.

If alpha contact angle boundary conditions are used they must be
specified for all phases or an error will result. The consistency of the
input will also be checked. The angles given for water in the alpha.air
file must be 180 degrees minus the angles given for air in the
alpha.water file.
2022-01-28 17:25:22 +00:00
ba5612414a totalPressureFvPatchScalarField: Added support for tangential velocity in the free-stream
When the optional tangentialVelocity is specified for the
pressureInletOutletVelocity it typically relates to a translating coordinate
transformation, e.g. for a towing-tank simulation, and does not contribute to
the real free-stream total-pressure.  Thus in order to get better behaviour from
the totalPressure BC for reversing flow at an entrainment boundary with
tangentialVelocity specified this velocity is subtracted from the extrapolated
velocity when calculating the kinematic contribution to the total pressure.
2022-01-28 16:20:36 +00:00
fbe65c0865 tutorials/multiphase/multiphaseEulerFoam: Multiphase blending changes
Updated tutorials for the changes to the blending system. Cases using
"none" blending have been updated to use "continuous" or "segregated" as
appropriate.

The bed tutorial has been extended to include a proper switch to a bed
drag model (AttouFerschneider) when the solid phase displaces the
fluids. This change made the trickleBed case a subset of the bed case,
so the trickleBed has been removed.
2022-01-28 09:24:28 +00:00
428c541680 multiphaseEulerFoam: Multiphase blending
Blending of sub-models has been extended so that it provides the
necessary functionality for the simulation of three or more phases.

Models now, by default, blend within the two-phase subset. So, the
functions which specify blending coefficients are evaluated using
`alpha1/(alpha1 + alpha2)` and `alpha2/(alpha1 + alpha2)`, rather than
just `alpha1` and `alpha2`. This ensures that the functions behave
consistently in multiphase configurations as the combined fraction of
both phases reduces.

Additional "displaced" categories of model are now available. These
allow the interface modelling to change as a third phase fraction
becomes significant and displaces the phases associated with the
interface in question. These can be specified using displaced phase
interfaces. If they are not supplied then the non-displaced models apply
instead.

Additional "general" categories are also now available. These span the
entire range of the subset's phase fraction space and apply if models
for the more specific configurations (i.e., displaced and segregated)
are omitted.

For example, to specify standard SchillerNaumann droplet/bubble drag
modelling outside of a solid bed, and the bed-specific AttouFerschneider
drag model within the bed, the following specification could be used:

    drag
    {
        air_dispersedIn_water
        {
            type            SchillerNaumann;
            residualRe      1e-3;
        }

        water_dispersedIn_air
        {
            $air_dispersedIn_water;
        }

        air_water_displacedBy_solid
        {
            type            AttouFerschneider;
            gas             air;
            liquid          water;
            solid           solid;
            E1              280;
            E2              4.8;
        }

        solid_dispersedIn_air
        {
            $air_water_displacedBy_solid;
        }

        solid_dispersedIn_water
        {
            $air_water_displacedBy_solid;
        }
    }

The "air_water_displacedBy_solid" model shown above is a
"general-displaced" model, in that its application does not depend on
dispersal of the air-water system; it only depends on the level of
displacement by the solid. Alternatively, a set of three
"dispersed-displaced" and "segregated-displaced" models could have been
provided with the following syntax:

        air_dispersedIn_water_displacedBy_solid
        {
            ...
        }

        air_segregatedWith_water_displacedBy_solid
        {
            ...
        }

        water_dispersedIn_air_displacedBy_solid
        {
            ...
        }

The blending methods themselves have changed slightly. There are now two
new methods; "segregated" for churning configurations in which no phase
is ever considered dispersed in another, and "continuous" where a
specified phase is always considered to be continuous and all other
phases are considered dispersed. These models replace the "none" model.

The linear and hyperbolic blending methods now support a "none" entry,
which can be set for parameters for phases that cannot become
continuous. For example, in an air-water-particles simulation the air
and water may become continuous, but the particles may not. A suitable
linear blending specification for this scenario might be as follows:

    blending
    {
        default
        {
            type            linear;
            minFullyContinuousAlpha.air 0.8;
            minPartlyContinuousAlpha.air 0.2;
            minFullyContinuousAlpha.water 0.8;
            minPartlyContinuousAlpha.water 0.2;
            minFullyContinuousAlpha.solid none;
            minPartlyContinuousAlpha.solid none;
        }
    }

The blending now provides far more feedback in terms of warnings and
errors when invalid or inadvisable specifications are made.

It is now also possible to visualise the various models' utilisation of
the phase fraction space. If the keyword "format" is placed in the
blending section of constant/phaseProperties then a plot (1 or 2 phases)
or surface (3 or more phases) file will be written out which shows the
phase fractions and the coefficients with which various models are
combined.
2022-01-28 09:24:28 +00:00
64a6562a1e tutorials/multiphase/multiphaseEulerFoam: Backwards compatible changes
These changes are not required for the cases to run with the new
phaseInterface system. The syntax prior to this commit will be read in
the new phaseInterface system's backwards compatibility mode.
2022-01-28 09:24:28 +00:00
807e517274 tutorials/multiphase/multiphaseEulerFoam: Non-backwards compatible changes
These changes are required for the cases to run with the new
phaseInterface system.
2022-01-28 09:24:28 +00:00
6bd200d0b5 multiphaseEulerFoam: New phaseInterface system to replace phasePair
A new class, phaseInterface, has been added to represent interfacial
configurations between pairs of phases. This class and its derivations
explicitly represent different configurations (e.g., dispersal,
segregation, displacement) by type and provide a run-time selection
mechanism so that these configurations can be uniquely named and
intuitively selected for sub-models to apply to.

For example, drag models can be selected for an air-water system with
full phase inversion with the following syntax in
constant/phaseProperties:

    drag
    {
        air_dispersedIn_water
        {
            type            IshiiZuber;
        }

        air_segregatedWith_water
        {
            type            segregated;
            m               0.5;
            n               8;
        }

        steam_dispersedIn_water
        {
            type            SchillerNaumann;
            residualRe      1e-3;
        }
    }

As well as the entries now being underscore separated, note also that
the sub model sections are now dictionaries ("{ ... }"), rather than
lists ("( ... );"). If a list is provided instead, then the input will
be considered to be in the old syntax, and will be read in a backwards
compatibility mode.

The new dictionary syntax permits substitution and therefore reuse of
settings, reducing the workload associated with setting up a large case
with many model combinations. In future it may be possible to introduce
wildcards to further reduce the verbosity of the input.

The new phase-interface classes and keywords and the phase-pairs and
keywords that they replace are listed below:

    Default/General:            phaseInterface "<phase>_<phase>"
                            replaces phasePair "(<phase> and <phase>)"

          Dispersed:   dispersedPhaseInterface "<phase>_dispersedIn_<phase>"
                     replaces orderedPhasePair "(<phase> in <phase>)"

         Segregated:  segregatedPhaseInterface "<phase>_segregatedWith_<phase>"
                            replaces phasePair "(<phase> and <phase>)"

              Sided:       sidedPhaseInterface "<phase>_<phase>_inThe_<phase>"
                     replaces orderedPhasePair "(<phase> in <phase>)"

          Displaced:   displacedPhaseInterface "<phase>_<phase>_displacedBy_<phase>"
                                        is new

Interface combinations are also possible. There can be, for example, an
interface which is both dispersed and sided. This class is the
dispersedSidedPhaseInterface and can be selected with the keyword
"<phase>_dispersedIn_<phase>_inThe_<phase>". This is needed, for
example, in two-resistance heat transfer modelling, where a different
model can be selected to represent heat transfer within the fluids on
either side of an interface.

A full list of all available phase interface relationships can be
generated by specifying an incorrect name, and viewing the output of the
error message that results.

The "displaced" interface is not currently used, but will shortly be
utilised to allowing the user to control how models between phases
change as the fraction of a third phase becomes significant and
displaces the phases associated with the interface in question.

Notes for developers:

There is no centralised storage of phase interface relationships in the
phase system any more; the table of phasePairs has been removed, and
there is no correcponding table of phaseInterfaces. Models now locally
store their own phaseInterface objects, or a derivation thereof, rather
than a reference to a centrally stored object. These phaseInterface
classes hold only references so there is no cost associated with their
duplication in multiple sub models.

If a model requires an interface of a specific type, it has to down-cast
the interface provided to it. There is a `phaseSystem::modelCast` method
for this purpose which also provides meaningful error messages in the
event that an inappropriate interface was specified and the cast fails.

Model generation is now hierarchical. Wrapper models (blended and sided)
are constructed with the same interface as non-wrapper models (drag,
virtual mass, etc...). The wrapper model constructors call the
constructors of their sub-models directly, rather than requiring model
pointers to be passed in.

Sub-model lookup has been significantly generalised and simplified.
There is now just one `phaseSystem::lookupInterfacialModel` method which
takes a phaseInterface as its argument. Looking up a model for a
specific configuration just requires providing the appropriate
phaseInterface. E.g., this call will return the virtual mass model for
gas bubbles in liquid:

    lookupSubModel<virtualMassModel>(dispersedPhaseInterface(gas, liquid))

Whilst this call will return the drag model for the segregated regime:

    lookupSubModel<dragModel>(segregatedPhaseInterface(phase1, phase2))

And this call will return the complete blended heat transfer model:

    lookupSubModel<blendedHeatTransferModel>(phaseInterface(phase1, phase2))
2022-01-28 09:24:15 +00:00
27d2ec6d43 setWriters: Added "none" set writer to disable writing 2022-01-27 15:39:14 +00:00
b668052a76 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-01-27 11:14:59 +00:00
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