Commit Graph

6193 Commits

Author SHA1 Message Date
5c09a84508 tutorials/modules/multicomponentFluid/counterFlowFlame.*: Renamed thermo.compressibleGasGRI thermo
to avoid further confusion concerning the origin of the thermo and transport
data which is not that supplied with the GRI mechanism as the these simple test
cases is to demonstrate the integration of a complex mechanism with or without
TDAC and ISAT, not complex transport modelling.
2022-10-04 09:29:07 +01:00
2fec74888d Revert "tutorials/modules/multicomponentFluid/counterFlow.*: Updated thermophysical properties for GRI 3.0 mechanism"
The proposed change does not change the mixing rules and the default coefficient mixing approach does not
provide mixed properties consistent with the GRI specification.  The purpose of these simple test cases
is to demonstrate the integration of a complex mechanism with or without TDAC and ISAT, not complex transport modelling.

A new tutorial is required to demonstrate the GRI 3.0 mechanism with complex transport properties.

This reverts commit 53f3bc6fdd.
2022-10-04 09:17:01 +01:00
562925476b fvModels::waveForcing: New fvModel to generate VoF surface by region forcing
With waveForcing waves can be generated with a domain by applying forcing to
both the phase-fraction and velocity fields rather than requiring that the waves
are introduced at an inlet.  This provides much greater flexibility as waves can
be generated in any direction relative to the mean flow, obliquely or even
against the flow.  isotropicDamping or verticalDamping can be used in
conjunction with waveForcing to damp the waves before they reach an outlet,
alternatively waveForcing can be used in regions surrounding a hull for example
to maintain far-field waves everywhere.

The tutorials/multiphase/interFoam/laminar/forcedWave tutorial case is provided
to demonstrate the waveForcing fvModel as an alternative to the wave inlet
boundary conditions used in the tutorials/multiphase/interFoam/laminar/wave
case.

Class
    Foam::fv::waveForcing

Description
    This fvModel applies forcing to the liquid phase-fraction field and all
    components of the vector field to relax the fields towards those
    calculated from the current wave distribution.

    The forcing force coefficient \f$\lambda\f$ should be set based on the
    desired level of forcing and the residence time the waves through the
    forcing zone.  For example, if waves moving at 2 [m/s] are travelling
    through a forcing zone 8 [m] in length, then the residence time is 4 [s]. If
    it is deemed necessary to force for 5 time-scales, then \f$\lambda\f$ should
    be set to equal 5/(4 [s]) = 1.2 [1/s].

Usage
    Example usage:
    \verbatim
    waveForcing1
    {
        type            waveForcing;

        libs            ("libwaves.so");

        liquidPhase     water;

        // Define the line along which to apply the graduation
        origin          (600 0 0);
        direction       (-1 0 0);

        // // Or, define multiple lines
        // origins         ((600 0 0) (600 -300 0) (600 300 0));
        // directions      ((-1 0 0) (0 1 0) (0 -1 0));

        scale
        {
            type        halfCosineRamp;
            start       0;
            duration    300;
        }

        lambda          0.5; // Forcing coefficient
    }
    \endverbatim
2022-10-03 20:30:02 +01:00
9dc91eb479 compressibleVoF: Replaced twoPhaseChangeModel with the VoFCavitation fvModel
Replacing the specific twoPhaseChangeModel with a consistent and general fvModel
interface will support not just cavitation using the new compressible
VoFCavitation fvModel but also other phase-change and interface manipulation
models in the future and is easier to use for case-specific and other user
customisation.

Class
    Foam::fv::compressible::VoFCavitation

Description
    Cavitation fvModel

Usage
    Example usage:
    \verbatim
    VoFCavitation
    {
        type    VoFCavitation;

        libs    ("libcompressibleVoFCavitation.so");

        model   SchnerrSauer;

        KunzCoeffs
        {
            pSat    2300;   // Saturation pressure

            UInf    20.0;
            tInf    0.005; // L = 0.1 m
            Cc      1000;
            Cv      1000;
        }

        MerkleCoeffs
        {
            pSat    2300;   // Saturation pressure

            UInf    20.0;
            tInf    0.005;  // L = 0.1 m
            Cc      80;
            Cv      1e-03;
        }

        SchnerrSauerCoeffs
        {
            pSat    2300;   // Saturation pressure

            n       1.6e+13;
            dNuc    2.0e-06;
            Cc      1;
            Cv      1;
        }
    }
    \endverbatim

The cavitating ballValve tutorial has been updated to use the new VoFCavitation
fvModel.
2022-09-28 13:02:47 +01:00
d3df91a5eb interFoam: Replaced twoPhaseChangeModel with the VoFCavitation fvModel
Replacing the specific twoPhaseChangeModel with a consistent and general fvModel
interface will support not just cavitation using the new VoFCavitation fvModel
but also other phase-change and interface manipulation models in the future and
is easier to use for case-specific and other user customisation.
2022-09-27 19:28:11 +01:00
f412d39174 kineticTheoryModel: The frictional contribution nuFric is separated from the turbulent viscosity of the granular phase
Corrects granular phase heat transfer in cases where eddy diffusivity based
thermophysical transport models are used.

Patch contributed by VTT Technical Research Centre of Finland.
2022-09-25 21:49:37 +01:00
6106bd3fd1 porousBafflePressureFvPatchField: Added optional relaxation
The implementation of the porous baffle pressure-drop is explicit which can
cause instability and even negative pressure if there is rapid variation is flow
in conjunction with high porosity drag coefficients.  This instability may be
moderated or eliminated by the application of sufficient relaxation of the
pressure-drop using the new optional relaxation factor:

Description
    This boundary condition provides a jump condition, using the \c cyclic
    condition as a base.

    The porous baffle introduces a pressure jump defined by:

        \f[
            \Delta p = -(D \mu U + 0.5 I \rho |U|^2 )L
        \f]

    where

    \vartable
        p      | pressure [Pa]
        \rho   | density [kg/m^3]
        \mu    | laminar viscosity [Pa s]
        D      | Darcy coefficient
        I      | inertial coefficient
        L      | porous media length in the flow direction
    \endvartable

Usage
    \table
        Property     | Description             | Required    | Default value
        patchType    | underlying patch type should be \c cyclic| yes |
        phi          | flux field name         | no          | phi
        rho          | density field name      | no          | rho
        D            | Darcy coefficient       | yes         |
        I            | inertial coefficient    | yes         |
        length       | porous media length in the flow direction | yes |
        relaxation   | Relaxation factor for pressure jump       | no  | 1
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            porousBafflePressure;
        patchType       cyclic;
        jump            uniform 0;
        D               0.001;
        I               1000000;
        length          0.1;
        relaxation      0.2;
        value           uniform 0;
    }
    \endverbatim

    Note:
        The underlying \c patchType should be set to \c cyclic
2022-09-25 21:45:53 +01:00
17ab812441 patchToPatches::nearest: Parallelisation fix 2022-09-23 10:08:02 +01:00
bf21eb151e nonConformalCyclicPointPatch: Inherit from cyclicPointPatch
Resolves bug report https://bugs.openfoam.org/view.php?id=3892
2022-09-22 20:51:52 +01:00
53f3bc6fdd tutorials/modules/multicomponentFluid/counterFlow.*: Updated thermophysical properties for GRI 3.0 mechanism
Patch contributed by Ilya Morev, VTT.
2022-09-22 16:14:52 +01:00
39b1717b11 multiphaseEulerFoam: Added multiphaseReactions library to clean script 2022-09-22 15:43:14 +01:00
c22a5a7aa6 isothermalFluid::correctBuoyantPressure: Relax the net force momentum equation source
rather than p_rgh which introduces an imbalance between the pressure and
buoyancy forces.  The relaxation factor for p_rgh specified in fvSolution is
used to relax the net force as the intent is to relax the pressure and this
provides convenient usage and backwards-compatibility.

Optional relaxation for the thermodynamic pressure p is also available for case
this provides convergence benefit for steady cases by relaxing the pressure work
term is the energy equation.

Note these changes only relate to the operation of the isothermalFluid solver
module for buoyant cases.
2022-09-22 15:05:33 +01:00
f4ac5f8748 AMIInterpolation, cyclicAMI: Removed
AMIInterpolation and cyclicAMI have been superseded by patchToPatch and
nonConformalCoupled, respectively.

The motivation behind this change is explained in the following article:

    https://cfd.direct/openfoam/free-software/non-conformal-coupling/

Information about how to convert a case which uses cyclicAMI to
nonConformalCoupled can be found here:

    https://cfd.direct/openfoam/free-software/using-non-conformal-coupling/
2022-09-22 10:05:41 +01:00
aa25763e14 tutorials: Cleanup of mapFields usage
Unused mapFieldsDict files have been deleted, and the throttle3D
now maps from the corresponding 2D case if results are available.
2022-09-22 10:04:02 +01:00
8f7ae7226f lagrangian: Added support for mesh distribution
This change makes particles distribute between processors along with
their containing cells. This might be necessary, for example, if the
chemistry solution is being load balanced, or the cells are being
continually re-decomposed due to dynamic refinement.

Whilst this adds load balancing *with* lagrangian, it does not
facilitate load balancing *of* lagrangian. That would also require the
implementation of a lagranian CPU load that the distributor would then
attempt to balance.
2022-09-22 08:37:56 +01:00
4c223b8aee particle: Removed polyMesh reference
This reference represents unnecessary storage. The mesh can be obtained
from tracking data or passed to the particle evolution functions by
argument.

In addition, removing the mesh reference makes it possible to construct
as particle from an Istream without the need for an iNew class. This
simplifies stream-based transfer, and makes it possible for particles to
be communicated by a polyDistributionMap.
2022-09-21 16:31:40 +01:00
3719f7d9de VoFClouds: Forward mesh changes to the parcelClouds 2022-09-21 14:36:22 +01:00
6cf099fd40 lagrangian: Mesh change hooks and usability improvements
The clouds fvModel and all the clouds it creates now contain a full set
of mesh change hooks. Some of these ultimately result in
"NotImplemented" errors, but this is an area under active development
and support may be added in the near future.

In addition, the list of cloud names is now specified from within the
fvModel, using a "clouds" entry. If this entry is omitted then a single
cloud named "cloud" is assumed as before. An example fvModel
specification for multiple clouds might be as follows:

    clouds
    {
        type    clouds;

        libs    ("liblagrangianParcel.so" "liblagrangianParcelTurbulence.so");

        clouds  (coalCloud limestoneCloud); // <-- New entry. Replaces
                                            //     the constant/clouds
                                            //     file.
    }

Lagrangian solvers that construct clouds explicitly now do so via a new
"parcelClouds" mesh object. This ensures that they, too, are correctly
modified as a result of mesh changes.

Neither mechanism now permits no clouds. If there is not a "clouds"
entry (clouds fvModel), or a constant/clouds file (lagrangian solvers),
and there is not a constant/cloudProperties file for the default cloud,
then an error will be generated. Previously the code executed the solver
with no clouds. Intentional usage of the fvModel or lagrangian solvers
without clouds is considered highly unlikely.
2022-09-21 14:07:05 +01:00
c90671c8b7 actuationDiskSource: Corrected error messages
Resolves bug-report https://bugs.openfoam.org/view.php?id=3891

Patch contributed by Timo Niemi, VTT.
2022-09-21 13:54:16 +01:00
df35a112aa Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-09-21 13:04:43 +01:00
c0a2c5f4f9 isothermalFluid: Reverted the handling of the compressibility flux
to regain the behaviour of rhoPimpleFoam in OpenFOAM-9 which is more robust than
the potentially more consistent and accurate flux correction approach in
OpenFOAM-10.
2022-09-21 13:03:39 +01:00
50aac13df5 typeGlobal, typeGlobalFile: Changed to trait structure
This allows for partial specialisation, so the different variants of the
global IO containers do not need the function to be overloaded for each
contained type. This also fixes an ommission in providing overloads of
these functions for some of the global IO containers.

Resolves bug report https://bugs.openfoam.org/view.php?id=3890
2022-09-20 16:39:05 +01:00
8b557d128c functionObjectList: Added automatic timeControl wrapping when either writeControl or executeControl entries are present
timeControl functionality is supported for both execution and writing but
previously only instantiated if the writeControl entry is present in the
functionObject dictionary, now it is also instantiated if only the
executeControl entry is present as the functionObject might only have execute
functionality.
2022-09-20 10:25:55 +01:00
a12bb3f446 functionObjects::readFields: Revert read without type-checking
to avoid unimportant warnings from typeIOobject.

Patch contributed by Timo Niemi, VTT.
2022-09-20 10:19:03 +01:00
a23937d86e alphatJayatillekeWallFunction: More robust stabilisation
Resolves bug report https://bugs.openfoam.org/view.php?id=3888
2022-09-20 08:50:30 +01:00
34d8167f94 fvMeshDistribute: Corrected values on cyclics
Resolves bug report https://bugs.openfoam.org/view.php?id=3884
2022-09-16 10:24:41 +01:00
fef0206bdb IOList, GlobalIOList, CompactIOList: Templated on container type
This reduces duplication and inconsistency between the List, Field, Map,
and PtrList variants. It also allows for future extension to other
container types such as DynamicList.
2022-09-16 09:16:58 +01:00
b0450ccd25 DynamicList, DynamicField: Add Fwd.H headers
The Fwd.H headers define the default template arguments. This means the
dynamic list/field can be forward declared without there being any
confusion with regards to the specification of these arguments.
2022-09-16 08:36:14 +01:00
70ae051511 surfaceMeshConvertTesting: Removed
This is a leftover piece of unnecessary test code. Use surfaceConvert
for triangulated surfaces or surfaceMeshConvert for polygonal surfaces.
2022-09-16 08:24:04 +01:00
68d7dd92d0 tutorials/mesh: Removed unused files 2022-09-16 08:17:21 +01:00
109d9449f1 paraFoam: Removed requirement for fvSolution and fvSchemes files to be present
It is no longer necessary for fvSolution and fvSchemes files to be present
during meshing, they are only needed when solving.
2022-09-16 08:14:58 +01:00
a1e0b1efa9 tutorials/compressible/rhoCentralFoam/movingCone: Set farFieldMoving patch to fixed velocity
to improve the mesh motion.
2022-09-15 21:01:44 +01:00
f5cf1d8020 foamDictionary: Added -case option to investigate usefulness and if there are problems 2022-09-15 19:21:08 +01:00
f8bb763b29 tutorials/modules/incompressibleFluid/movingCone: Corrected mesh and improved motion 2022-09-15 18:48:24 +01:00
c5f1480994 typeInfo: Changed typedName to use the type() virtual function
so that the name of the most derived class is used when constructing named
fields within the model.
2022-09-15 18:13:19 +01:00
5a71e390f2 foamRun: Execute from backwards-compatibility redirection scripts using 'exec env'
to ensure proper clean-up of the foamRun child process if executed from mpirun
and mpirun is killed.
2022-09-15 13:58:40 +01:00
fb8e61fbc6 tutorials/modules/incompressibleFluid/motorBike/motorBike/Allclean: Removed redundant cp 2022-09-15 11:59:04 +01:00
2c15cce459 tutorials/mesh/snappyHexMesh: Updated links 2022-09-15 11:58:47 +01:00
020ec8b14d incompressibleFluid: Completed the update of tutorial and template cases
to use the incompressibleFluid solver module rather than simpleFoam, pimpleFoam
or pisoFoam.
2022-09-15 10:58:28 +01:00
2372cbdb8d isoSurface: Added size and compute time to debugging messages 2022-09-14 14:33:38 +01:00
e8ac5f424e mergePoints: Removed unused point merging code 2022-09-14 08:21:08 +01:00
e84f3d110c externalWallHeatFluxTemperature: Corrected definition of Q
Resolves bug report https://bugs.openfoam.org/view.php?id=3882
2022-09-13 12:45:41 +01:00
792ed625bc meshToMesh: Use patchToPatch rather than AMIInterpolation 2022-09-13 08:28:09 +01:00
251f549a24 patchDistWave: Fix construction of changed face info
Resolves bug report https://bugs.openfoam.org/view.php?id=3881
2022-09-13 08:23:32 +01:00
0214138e6a Test-mappedPatch: Updated following changes to mappedPatchBase 2022-09-09 13:52:20 +01:00
8d229041dd mappedPatchBase: Separated into mapped and mappedInternal
The mappedPatchBase has been separated into a type which maps from
another patch (still called mappedPatchBase) and one that maps from
internal cell values (mappedInternalPatchBase). This prevents the user
needing to specify settings for mapping procedures that are not being
used, and potentially don't even make sense given the context in which
they are being applied. It also removes a lot of fragile logic and error
states in the mapping engine and its derivatives regarding the mode of
operation. Mapping from any face in the boundary is no longer supported.

Most region-coupling mapping patches are generated automatically by
utilities like splitMeshRegions and extrudeToRegionMesh. Cases which
create region-coupling mapped patches in this way will likely require no
modification.

Explicitly user-specified mapping will need modifying, however. For
example, where an inlet boundary is mapped to a downstream position in
order to evolve a developed profile. Or if a multi-region simulation is
constructed manually, without using one of the region-generating
utilities.

The available mapped patch types are now as follows:

  - mapped: Maps values from one patch to another. Typically used for
    inlets and outlets; to map values from an outlet patch to an inlet
    patch in order to evolve a developed inlet profile, or to permit
    flow between regions. Example specification in blockMesh:

        inlet
        {
            type    mapped;
            neighbourRegion region0;  // Optional. Defaults to the same
                                      // region as the patch.
            neighbourPatch outlet;
            faces   ( ... );
        }

    Note that any transformation between the patches is now determined
    automatically. Alternatively, it can be explicitly specified using
    the same syntax as for cyclic patches. The "offset" and "distance"
    keywords are no longer used.

  - mappedWall: As mapped, but treated as a wall for the purposes of
    modelling (wall distance). No transformation. Typically used for
    thermally coupling different regions. Usually created automatically
    by meshing utilities. Example:

        fluid_to_solid
        {
            type    mappedWall;
            neighbourRegion solid;
            neighbourPatch solid_to_fluid;
            method  intersection;     // The patchToPatch method. See
                                      // below.
            faces   ( ... );
        }

  - mappedExtrudedWall: As mapped wall, but with corrections to account
    for the thickness of an extruded mesh. Used for region coupling
    involving film and thermal baffle models. Almost always generated
    automatically by extrudeToRegionMesh (so no example given).

  - mappedInternal: Map values from internal cells to a patch. Typically
    used for inlets; to map values from internal cells to the inlet in
    order to evolve a developed inlet profile. Example:

        inlet
        {
            type    mappedInternal;
            distance 0.05;            // Normal distance from the patch
                                      // from which to map cell values
            //offset  (0.05 0 0);     // Offset from the patch from
                                      // which to map cell values
            faces   ( ... );
        }

    Note that an "offsetMode" entry is no longer necessary. The mode
    will be inferred from the presence of the distance or offset
    entries. If both are provided, then offsetMode will also be required
    to choose which setting applies.

The mapped, mappedWall and mappedExtrudedWall patches now permit
specification of a "method". This selects a patchToPatch object and
therefore determines how values are transferred or interpolated between
the patches. Valid options are:

  - nearest: Copy the value from the nearest face in the neighbouring
    patch.

  - matching: As nearest, but with checking to make sure that the
    mapping is one-to-one. This is appropriate for patches that are
    identically meshed.

  - inverseDistance: Inverse distance weighting from a small stencil of
    nearby faces in the neighbouring patch.

  - intersection: Weighting based on the overlapping areas with faces in
    the neighbouring patch. Equivalent to the previous AMI-based mapping
    mode.

If a method is not specfied, then the pre-existing approach will apply.
This should be equivalent to the "nearest" method (though in most such
cases, "matching" is probably more appropriate). This fallback may be
removed in the future once the patchToPatch methods have been proven
robust.

The important mapped boundary conditions are now as follows:

  - mappedValue: Maps values from one patch to another, and optionally
    modify the mapped values to recover a specified average. Example:

        inlet
        {
            type    mappedValue;
            field   U;                // Optional. Defaults to the same
                                      // as this field.
            average (10 0 0);         // The presence of this entry now
                                      // enables setting of the average,
                                      // so "setAverage" is not needed
            value   uniform 0.1;
        }

  - mappedInternalValue: Map values from cells to a patch, and
    optionally specify the average as in mappedValue. Example:

        inlet
        {
            type    mappedValue;
            field   k;                // Optional. Defaults to the same
                                      // as this field.
            interpolationScheme cell;
            value   uniform 0.1;
        }

  - mappedFlowRateVelocity: Maps the flow rate from one patch to
    another, and use this to set a patch-normal velocity. Example:

        inlet
        {
            type    mappedFlowRate;
            value   uniform (0 0 0);
        }

Of these, mappedValue and mappedInternalValue can override the
underlying mapped patch's settings by additionally specifying mapping
information (i.e., the neighbourPatch, offset, etc... settings usually
supplied for the patch). This also means these boundary condtions can be
applied to non-mapped patches. This functionality used to be provided
with a separate "mappedField" boundary condition, which has been removed
as it is no longer necessary.

Other mapped boundary conditions are either extremely niche (e.g.,
mappedVelocityFlux), are always automatically generated (e.g.,
mappedValueAndPatchInternalValue), or their usage has not changed (e.g.,
compressible::turbulentTemperatureCoupledBaffleMixed and
compressible::turbulentTemperatureRadCoupledMixed). Use foamInfo to
obtain further details about these conditions.
2022-09-09 10:03:58 +01:00
dc557e16d4 tutorials: hotRoomComfort: Restored bounded schemes for work term 2022-09-08 16:21:08 +01:00
f2b6c550fa compressible::alphatJayatillekeWallFunction: Removed lagging
The calculation of alphat no longer depends upon the previous value of
alphat, so there is no longer any lagging, and iteration is not
necessary to recover the exact value specified by the wall function.
2022-09-08 12:09:38 +01:00
6d563efec1 fluidThermo: Moved kappaEff and alphaEff into ThermophysicalTransportModels
This completes the separation between thermodynamics and thermophysical
transport modelling and all models and boundary conditions involving heat
transfer now obtain the transport coefficients from the appropriate
ThermophysicalTransportModels rather than from fluidThermo.
20220907
2022-09-07 18:31:04 +01:00
461075725d fvMeshDistribute: Fix to distribution of processorCyclic patch fields
Resolves bug report https://bugs.openfoam.org/view.php?id=3879
2022-09-06 13:03:14 +01:00