Commit Graph

1443 Commits

Author SHA1 Message Date
6cac79b47b Reorganised linkage to avoid link errors from foamToC -allLibs 2023-02-24 22:40:12 +00:00
83e5c45764 contactAngleModels: New contact angle models library
used in the alphaContactAngleFvPatchScalarField boundary condition to replace
the need to derive specialised versions for different contact angle evaluation
methods.  This simplifies the code and provides a reusable system which could be
applied to other multiphase contact angle boundary conditions.
2023-02-24 15:35:25 +00:00
a432c3f6df src/finiteVolume/cfdTools: Removed unused code
Solver modules have replaced code that was previously shared between
solvers by means of #include-ing header files. Some of these headers are
now unused and have been removed. Others are only now used in a single
solver and have been moved into that solver.
2023-02-22 16:28:53 +00:00
a35fed405e fluidSolver: Accumulate continuity errors on final iteration only
This prevents temporarily high errors relating to unconverged state from
being added to the total and reported
2023-02-22 15:47:49 +00:00
aeadea4377 Standardised name of area-per-unit-volume to Av
This change applies to diameter models within the multiphaseEuler
module, heat transfer fvModels, and the LopesdaCosta porosity and
turbulence models.

User input changes have been made backwards-compatible, so existing
AoV/a/Sigma/... entries and fields should continue to work.
2023-02-22 12:58:14 +00:00
1321112963 ThermalPhaseChangePhaseSystem: Changes to latent heat handling
Latent heat evaluation has been changed to calculate both sides' heats
similarly using the interface temperature, rather than using bulk
quantities on the "upwind" side of the mass transfer process
(latentHeatScheme::symmetric vs latentHeatScheme::upwind).

The transfer of heat has been changed so that it is calculated from the
mass transfer rate rather than the heat transfer coefficients and
temperatures (latentHeatTransfer::mass vs latentHeatTransfer::heat).

These changes were found to improve stability characteristics in some
boiling cases, and in general should be more energy conservative and
less dependent on the accuracy of the interfacial temeprature solution.

Patch contributed by Juho Peltola, VTT.
2023-02-17 15:18:13 +00:00
8374856d4f compressible::alphatWallBoilingWallFunction: Fix to Jakob number 2023-02-14 08:49:37 +00:00
f862b5142d solvers::multiphaseEuler: Reorganised thermophysicalPredictor
To ensure transport consistency between the composition and energy both must be
included in the optional energy corrector loop.
2023-02-10 12:49:35 +00:00
029f58f433 multiphaseEuler: sphericalDiffusiveMassTransfer: Removed unused Lewis number setting 2023-02-09 16:49:34 +00:00
d89d88f62e solvers::incompressibleVoF: Ensure pressure reference is set for closed domains 2023-02-07 17:04:52 +00:00
6ac8680e8c PDRFoamAutoRefine: Removed
The method to update phi in PDRFoamAutoRefine has been superseded by rhoUf in
all other compressible solvers and PDRFoam needs to be updated, requiring
funding.  PDRFoamAutoRefine is no longer maintained.
2023-02-07 14:58:02 +00:00
c4523d4147 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-02-07 14:23:36 +00:00
c41f303c30 solvers::twoPhaseVoFSolver: Register alphaPhiCorr0.<phase1> for redistribution 2023-02-07 14:23:06 +00:00
38e8e7916a fvPatchField, fvsPatchField, pointPatchField: Generalised in-place mapping
The patch field 'autoMap' and 'rmap' functions have been replaced with a
single 'map' function that can used to do any form of in-place
patch-to-patch mapping. The exact form of mapping is now controlled
entirely by the mapper object.

An example 'map' function is shown below:

    void nutkRoughWallFunctionFvPatchScalarField::map
    (
        const fvPatchScalarField& ptf,
        const fvPatchFieldMapper& mapper
    )
    {
        nutkWallFunctionFvPatchScalarField::map(ptf, mapper);

        const nutkRoughWallFunctionFvPatchScalarField& nrwfpsf =
            refCast<const nutkRoughWallFunctionFvPatchScalarField>(ptf);

        mapper(Ks_, nrwfpsf.Ks_);
        mapper(Cs_, nrwfpsf.Cs_);
    }

This single function replaces these two previous functions:

    void nutkRoughWallFunctionFvPatchScalarField::autoMap
    (
        const fvPatchFieldMapper& m
    )
    {
        nutkWallFunctionFvPatchScalarField::autoMap(m);
        m(Ks_, Ks_);
        m(Cs_, Cs_);
    }

    void nutkRoughWallFunctionFvPatchScalarField::rmap
    (
        const fvPatchScalarField& ptf,
        const labelList& addr
    )
    {
        nutkWallFunctionFvPatchScalarField::rmap(ptf, addr);

        const nutkRoughWallFunctionFvPatchScalarField& nrwfpsf =
            refCast<const nutkRoughWallFunctionFvPatchScalarField>(ptf);

        Ks_.rmap(nrwfpsf.Ks_, addr);
        Cs_.rmap(nrwfpsf.Cs_, addr);
    }

Calls to 'autoMap' should be replaced with calls to 'map' with the same
mapper object and the patch field itself provided as the source. Calls
to 'rmap' should be replaced with calls to 'map' by wrapping the
addressing in a 'reverseFvPatchFieldMapper' (or
'reversePointPatchFieldMapper') object.

This change simplifies the creation of new patch fields and hence
improves extensibility. It also provides more options regarding general
mapping strategies between patches. Previously, general abstracted
mapping was only possible in 'autoMap'; i.e., from a patch to itself.
Now, general mapping is possible between different patches.
2023-02-07 14:11:27 +00:00
3e012dd791 VoFSolidificationMeltingSource: Updated set_.cells() 2023-02-04 10:53:27 +00:00
e2c160462e functionObjects::volRegion: Replaced with fvCellSet
Replacing volRegion removes unnecessary functionality duplication and ensures
cell set selection is consistent between functionObjects, fvModels and
fvConstraints for user convenience and reducing the code maintenance overhead.

Description
    General cell set selection class for models that apply to sub-sets
    of the mesh.

    Currently supports cell selection from a set of points, a specified cellSet
    or cellZone or all of the cells.  The selection method can either be
    specified explicitly using the \c select entry or inferred from the
    presence of either a \c cellSet, \c cellZone or \c points entry.  The \c
    select entry is required to select \c all cells.

Usage
    Examples:
    \verbatim
        // Apply everywhere
        select   all;

        // Apply within a given cellSet
        select   cellSet; // Optional
        cellSet         rotor;

        // Apply within a given cellZone
        select   cellZone; // Optional
        cellZone        rotor;

        // Apply in cells containing a list of points
        select   points; // Optional
        points
        (
            (2.25 0.5 0)
            (2.75 0.5 0)
        );
    \endverbatim
2023-02-03 19:16:32 +00:00
4dbc23c141 ListOps::identity -> identityMap
to avoid confusion with the tensor identity.
2023-02-03 17:12:31 +00:00
efa8cae943 solver: Remove unused bool return from moveMesh method 2023-02-02 12:23:30 +00:00
df0f7f16be solvers::solid: Support mesh motion
Mesh motion is now supported in solid regions, but with the restriction
that it must be a solid-body-type motion. The mesh must not deform; all
cell volumes and face area magnitudes must remain constant. An error
will be generated if a motion strategy is selected that does not obey
this constraint.
2023-02-02 12:23:30 +00:00
295223624b Rationalised and standardised cell, face and point set selection controls
The keyword 'select' is now used to specify the cell, face or point set
selection method consistently across all classes requiring this functionality.

'select' replaces the inconsistently named 'regionType' and 'selectionMode'
keywords used previously but backwards-compatibility is provided for user
convenience.  All configuration files and tutorials have been updated.

Examples of 'select' from the tutorial cases:

functionObjects:

    cellZoneAverage
    {
        type            volFieldValue;
        libs            ("libfieldFunctionObjects.so");

        writeControl    writeTime;
        writeInterval   1;

        fields          (p);
        select          cellZone;
        cellZone        injection;

        operation       volAverage;
        writeFields     false;
    }

    #includeFunc populationBalanceSizeDistribution
    (
        name=numberDensity,
        populationBalance=aggregates,
        select=cellZone,
        cellZone=outlet,
        functionType=numberDensity,
        coordinateType=projectedAreaDiameter,
        allCoordinates=yes,
        normalise=yes,
        logTransform=yes
    )

fvModel:

    cylinderHeat
    {
        type            heatSource;

        select          all;

        q               5e7;
    }

fvConstraint:

    momentumForce
    {
        type            meanVelocityForce;

        select          all;

        Ubar            (0.1335 0 0);
    }
2023-02-01 16:17:16 +00:00
2971c5b8d1 Minor typo 2023-02-01 15:57:59 +00:00
189c52389f solver::deltaTFactor: renamed from maxIncreaseDeltaT to clarify that it is a multiplying factor 2023-02-01 11:54:17 +00:00
0543521992 solver: Make time-step fractional increase available externally 2023-01-31 15:01:01 +00:00
58a573ea42 Rationalised remaining legacy solvers 2023-01-28 21:05:39 +00:00
fbda1df996 particleFoam, rhoParticleFoam: Replaced by solvers::functions with the fvModel functionObject
particleFoam has been superseded and replaced by the more general functions
solver module executed by the foamRun application:

    foamRun -solver functions

The incompressibleFluid solver specified by either the subSolver or if not
present the solver entry in the controlDict is instantiated to provide the
physical fields needed by fvModel functionObject in which the clouds fvModel is
selected to evolve the Lagrangian particles.  See:

    tutorials/modules/incompressibleFluid/hopperParticles
    tutorials/modules/incompressibleFluid/mixerVessel2DParticles

rhoParticleFoam has been superseded and replaced by the more general functions
solver module executed by the foamRun application:

    foamRun -solver functions

The isothermalFluid solver specified by either the subSolver or if not present
the solver entry in the controlDict is instantiated to provide the physical
fields needed by fvModel functionObject in which the clouds fvModel is selected
to evolve the Lagrangian particles.
2023-01-28 21:02:23 +00:00
3d2cd9a3b2 fvModels, fvConstraints: Updated constructor argument order for consistency with functionObjects
Following the convention chosen for functionObjects the coefficients dictionary
argument is last in constructor argument list.
2023-01-28 10:28:29 +00:00
9d1fad9909 applications/solvers/modules/Allwmake: Added functions 2023-01-27 14:48:46 +00:00
8de6cd744e solvers::functions: New solver module to execute functionObjects in a time-loop
Description
    Solver module to execute the \c functionObjects for a specified solver

    The solver specified by either the \c subSolver or if not present the \c
    solver entry in the \c controlDict is instantiated to provide the physical
    fields needed by the \c functionObjects.  The \c functionObjects are then
    instantiated from the specifications are read from the \c functions entry in
    the \c controlDict and executed in a time-loop also controlled by entries in
    \c controlDict and the \c maxDeltaT() returned by the sub-solver.

    The fields and other objects registered by the sub-solver are set to
    NO_WRITE as they are not changed by the execution of the functionObjects and
    should not be written out each write-time.  Fields and other objects created
    and changed by the execution of the functionObjects are written out.

solvers::functions in conjunction with the scalarTransport functionObject
replaces scalarTransportFoam and provide more general handling of the scalar
diffusivity.
2023-01-27 14:31:58 +00:00
260a8502f0 solvers::movingMesh: New solver module to move the mesh
Executes the mover, topoChanger and distributor specified in the
dynamicMeshDict.

Replaces the moveMesh and earlier moveDynamicMesh utilities.
2023-01-27 14:27:52 +00:00
fcab778f57 solvers: Adjust time step even if Courant number is zero
This change means that even if the Courant number is zero, the time step
is adjusted based on maximum time step settings and/or constraints
specified by active fvModels. If none of these additional constraints
are present then adjustment is deactivated.
2023-01-26 08:34:07 +00:00
0f5f4ed62c solver: Registered to database
This change lets the solver be looked up from the region database, so
that aspects of the solution algorithm can be accessed by
functionObjects and fvModels and similar. For example, a fluid solver
could be looked up as follows:

    const solvers::fluid& s =
        mesh().lookupObject<solvers::fluid>(solver::typeName);
2023-01-26 08:31:02 +00:00
b34e17784a applications/solvers/modules/Allwmake: Added shockFluid 2023-01-25 19:24:18 +00:00
97c23eaa11 shockFluid: Updated includes 2023-01-25 11:00:34 +00:00
104be8eae9 Corrected typos 2023-01-24 22:01:34 +00:00
00ca8905a0 Minor typo corrections
Patch contributed by Timo Niemi, VTT.
2023-01-24 18:27:37 +00:00
9fadb7fccf solvers::shockFluid: Now solves for rho, U and e while conserving rho*U and rho*E
By solving for U and e rather than rhoU and rhoE the convection and stress
matrices can be combined and solved together avoiding the need for Strang
splitting.  Conservation of rho*U and rho*E is ensured by constructing and
solving the three equations in sequence, constructing each using the results of
the solution of the previous equations.
2023-01-24 18:17:46 +00:00
870f4e9dae compressible::alphatWallBoilingWallFunction: Naming consistency
Wall boiling properties and state have been named consistently through
the wall boiling boundary conditions and all of its related sub-models.
All changes are backwards compatible. Changes to tutorials will follow
in a separate commit.
2023-01-24 14:27:31 +00:00
c44a9d1097 populationBalanceModel: Stabilise dilatation error term
A small SuSp stabilisation has been added to the dilation error term to
prevent edge-cases in which the dilation correction exactly cancels out
all implicit transport terms and sources.
2023-01-24 14:10:59 +00:00
377080de52 compressible::alphatWallBoilingWallFunction: Improved solution procedure
This boundary condition now solves for the wall temperature by interval
bisection, which should be significantly more robust than the previous
fixed-point iteration procedure. There is a new non-dimensional
"tolerance" setting that controls how tightly this solution procedure
solves the wall temperature. The "relax" setting is no longer used.

The boundary condition no longer triggers re-evaluation of the
temperature condition in order to re-calculate the heat flux within the
solution iteration. Instead, it extracts physical coefficients from the
form of the boundary condition and uses these to form a linearised
approximation of the heat flux. This is a more general approach, and
will not trigger side-effects associated with re-evaluating the
temperature condition.

The fixedMultiphaseHeatFlux condition has been replaced by a
uniformFixedMultiphaseHeatFlux condition, which constructs a mixed
constraint which portions a specified heat flux between the phases in
such a way as to keep the boundary temperature uniform across all
phases. This can be applied to all phases. It is no longer necessary to
apply a heat flux model to one "master" phase, then map the resulting
temperature to the others. An example specification of this boundary
condition is as follows:

    wall
    {
        type            uniformFixedMultiphaseHeatFlux;
        q               1000;
        relax           0.3;
        value           $internalField;
    }

The wall boiling tutorials have been updated to use these new functions,
and time-varying heat input has been used to replace the
stop-modify-restart pattern present in the single-region cases.
2023-01-24 10:28:59 +00:00
022519fcf3 multiphaseEuler::populationBalanceModel: Make precomputation of diameter-independent expressions depend on the source term update interval
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
and VTT Technical Research Centre of Finland Ltd.
2023-01-18 14:52:44 +00:00
fe5a991ade solvers::shockFluid: New solver module for density-based solution of compressible flow
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces rhoCentralFoam and all the corresponding
tutorials have been updated and moved to tutorials/modules/shockFluid.

Unlike rhoCentralFoam shockFluid supports mesh refinement/unrefinement, topology
change, run-time mesh-to-mesh mapping, load-balancing in addition to general
mesh-motion.

The tutorials/modules/shockFluid/movingCone case has been updated to demonstrate
run-time mesh-to-mesh mapping mesh topology change based on the
tutorials/modules/incompressibleFluid/movingCone.  shockFluid s

Description
    Solver module for density-based solution of compressible flow

    Based on central-upwind schemes of Kurganov and Tadmor with support for
    mesh-motion and topology change.

    Reference:
    \verbatim
        Greenshields, C. J., Weller, H. G., Gasparini, L.,
        & Reese, J. M. (2010).
        Implementation of semi‐discrete, non‐staggered central schemes
        in a colocated, polyhedral, finite volume framework,
        for high‐speed viscous flows.
        International journal for numerical methods in fluids, 63(1), 1-21.
    \endverbatim

SourceFiles
    shockFluid.C

See also
    Foam::solvers::fluidSolver
    Foam::solvers::incompressibleFluid
2023-01-18 14:10:48 +00:00
fb405a3f0e chemistryModel: Consistent complilation of all reaction types 2023-01-17 15:36:02 +00:00
3055b16c90 rhoCentralFoam: Further reorganisation 2023-01-16 16:29:06 +00:00
ec7afd8386 alphatPhaseChangeWallFunctions: Clean up
The fixedDmdt phase change boundary condition has been removed as this
is not a physical model and was only ever needed for testing.

The phase change wall function interface has been simplified and made a
mix-in, rather than a derivation from a fixed value patch field. This
reduces forwarding and mapping code and permits wall functions to derive
from patch fields other than fixed value.

Minor style and consisteny improvements have been made to the wall
boiling wall function.
2023-01-13 14:25:56 +00:00
f6342ac8dd alphatWallBoilingWallFunction: Improvements for Low-Re operation
This change introduces a more physical limiter for the logarithmic
liquid temperature extrapolation employed in the model. It also adds an
operation to turn off extrapolation alltogether for cases with very low
y+ in which the extrapolation behaviour becomes unreliable.

Patch contributed by Juho Peltola, VTT.
2023-01-13 10:40:13 +00:00
35256e5280 rhoCentralFoam: Added 'const' to constant field declarations to improve readability 2023-01-10 18:48:41 +00:00
64e1e4e097 solvers::compressibleMultiphaseVoF: New solver module for compressible multiphase VoF simulations
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces compressibleMultiphaseInterFoam and all the
corresponding tutorials have been updated and moved to
tutorials/modules/compressibleMultiphaseVoF.

compressibleMultiphaseVoF is derived from the multiphaseVoFSolver which adds
compressible multiphase capability to the VoFSolver base-class used as the basis
of all two-phase and multiphase VoF solvers.

Class
    Foam::solvers::compressibleMultiphaseVoF

Description
    Solver module for the solution of multiple compressible, isothermal
    immiscible fluids using a VOF (volume of fluid) phase-fraction based
    interface capturing approach, with optional mesh motion and mesh topology
    changes including adaptive re-meshing.

    The momentum and other fluid properties are of the "mixture" and a single
    momentum equation is solved.

    A mixture approach for momentum transport is provided in which a single
    laminar, RAS or LES model is selected to model the momentum stress.

    Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
    pseudo-transient and steady simulations.

SourceFiles
    compressibleMultiphaseVoF.C

See also
    Foam::solvers::VoFSolver
    Foam::solvers::multiphaseVoFSolver
2023-01-10 16:01:49 +00:00
ffdb211bdc solvers::incompressibleMultiphaseVoF: New solver module for multiphase VoF simulations
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces multiphaseInterFoam and all the
corresponding tutorials have been updated and moved to
tutorials/modules/incompressibleMultiphaseVoF.

incompressibleMultiphaseVoF is derived from the multiphaseVoFSolver which adds
multiphase capability to the VoFSolver base-class used as the basis of all
two-phase and multiphase VoF solvers.

Class
    Foam::solvers::incompressibleMultiphaseVoF

Description
    Solver module for the solution of multiple incompressible, isothermal
    immiscible fluids using a VOF (volume of fluid) phase-fraction based
    interface capturing approach, with optional mesh motion and mesh topology
    changes including adaptive re-meshing.

    The momentum and other fluid properties are of the "mixture" and a single
    momentum equation is solved.

    A mixture approach for momentum transport is provided in which a single
    laminar, RAS or LES model is selected to model the momentum stress.

    Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
    pseudo-transient and steady simulations.

SourceFiles
    incompressibleMultiphaseVoF.C

See also
    Foam::solvers::VoFSolver
    Foam::solvers::multiphaseVoFSolver
2023-01-10 10:12:43 +00:00
7f1fb2fb11 PtrListDictionary: Added conversion to UPtrListDictionary with dynamic up-casting of pointers 2023-01-09 19:58:06 +00:00
ead885c508 incompressibleTwoPhaseMixture -> incompressibleTwoPhaseVoFMixture, compressibleTwoPhaseMixture -> compressibleTwoPhaseVoFMixture
to distinguish between mixtures specifically for VoF simulations
2023-01-09 19:54:41 +00:00