Commit Graph

1443 Commits

Author SHA1 Message Date
b36d8fca44 solvers::isothermalFluid: Improved the consistency, accuracy and stability of the pressure-work term
for moving mesh cases, in both the internal energy and enthalpy equations
2022-11-17 18:08:59 +00:00
29b82422d7 applications/solvers/modules: Reorganised to match the structure of tutorials/modules
Given that the number of solid solver modules is currently 1 and unlikely to
exceed 3 it is not very useful to maintain solid and fluid sub-directories and
easier to see the correspondence between the solver modules and tutorial cases
without.
2022-11-16 23:28:59 +00:00
1df33f58c9 multiphaseEuler: Cavitation phaseTransfer model
This adds cavitation modelling to the multiphaseEuler solver module as a
phaseTransfer model. The underlying cavitation modelling is the same as
for the compressibleVoF module.

An example specification in constant/phaseProperties is shown below:

    phaseTransfer
    {
        gas_liquid
        {
            type        cavitation;

            model       Kunz;

            liquid      water;

            pSat        80000;

            UInf        5.33;
            tInf        0.028142589;
            Cc          100;
            Cv          100;
        }
    }

Based on code contributed by Petteri Peltonen, VTT.
2022-11-16 21:36:13 +00:00
721bf7b41a compressible::cavitationModels: Use temperature dependent saturation pressure model
The cavitation models used by the compressibleVoF module can now have a
temperature-dependent saturation pressure model specified. For example,
in the constant/fvModels file of a compressibleVoF case:

    VoFCavitation
    {
        type    VoFCavitation;

        libs    ("libcompressibleVoFCavitation.so");

        model   SchnerrSauer;

        liquid  water;

        // Constant saturation pressure
        //pSat    2300;

        // Antoine equation for temperature-dependent saturation pressure
        pSat
        {
            type    Antoine;
            A       22;
            B      -3000;
            C      -500;
        }

        n       1.6e+13;
        dNuc    2.0e-06;
        Cc      1;
        Cv      1;
    }
2022-11-16 21:36:13 +00:00
9567bc0d4b cavitationModels: Made insensitive to phase order
The cavitation models used by the interFoam solver and the
compressibleVoF solver module can now be applied regardless of the
ordering of the liquid and vapour phases. A "liquid" keyword is now
required in the model specification in order to control which phase is
considered to be the condensed liquid state. Previously the liquid phase
was assumed to be the first of the two phases.
2022-11-16 21:36:13 +00:00
9b373b2950 multiphaseEuler: Use saturation models from the thermo library
The multiphaseEuler module now uses saturation models from the
centralised thermophysical properties library.

The control of these models is slightly different than for the previous
multiphaseEuler-specific saturation models. Where previously a
"saturationPressure" or "saturationTemperature" sub-dictionary was
employed, now "pSat" and "Tsat" entries are used which can be specified
flexibly in a similar manner to function1-s. See the previous commit for
details.
2022-11-16 21:36:13 +00:00
366e38d34a compressibleVoF: Consolidated library functionality 2022-11-16 20:54:40 +00:00
21983bbbb6 solvers::isothermalFluid: Added support fixedFluxExtrapolatedPressure with the transonic option
For high-speed flow cases benefiting from extrapolated pressure, e.g. IC engine
piston motion the fixedFluxExtrapolatedPressure pressure BC can now be used with
the transonic pressure solution option.
2022-11-16 18:22:09 +00:00
a7d40a4fe5 coupledMultiphaseTemperatureFvPatchScalarField: New BC for multiphase CHT cases
Class
    Foam::coupledMultiphaseTemperatureFvPatchScalarField

Description
    Mixed boundary condition for the phase temperature of a phase in an
    Euler-Euler multiphase simulation, to be used for heat-transfer with another
    region in a CHT case.  Optional thin wall material layer resistances can be
    specified through thicknessLayers and kappaLayers entries.

See also
    Foam::coupledTemperatureFvPatchScalarField

The new tutorial case tutorials/modules/CHT/multiphaseCoolingCylinder2D is a
variant of the coolingCylinder2D case in which a 10% oil droplets in water
mixture flows over and cools a hot cylinder.  The case in run with the
foamMultiRun multi-solver executor.
2022-11-15 16:56:56 +00:00
12422f2944 solvers::multiphaseEuler: Updated fixedMultiPhaseHeatFlux -> fixedMultiphaseHeatFlux 2022-11-11 16:15:16 +00:00
f3e4ba553a solvers::multiphaseEuler::multiphaseThermophysicalTransportModels: new library for thermophysical transport models and BCs
The thermophysical boundary conditions have be moved from the
multiphaseCompressibleMomentumTransportModels library into the new
multiphaseThermophysicalTransportModels library.
2022-11-11 14:25:09 +00:00
01b4bf55ef multiphaseEuler: Improved mass transfer linearisation w.r.t pressure
Mass transfer rates are now updated following a change in the pressure
if the mass transfer modelling provides a pressure coefficient. This
means that pimple correctors can be used to improve the behaviour of
mass transfer processes that coupled closely to the pressure field.
2022-11-11 09:24:06 +00:00
f088d89127 pplications/solvers::*CourantNo: Removed unnecessary nInternalFaces() test
Resolves bug-report https://bugs.openfoam.org/view.php?id=3929
2022-11-10 14:49:50 +00:00
e1c0207695 solvers::compressibleVoF,compressibleVoF::correctCoNum(): Removed unnecessary nInternalFaces() test
Resolves bug-report https://bugs.openfoam.org/view.php?id=3929
2022-11-10 14:30:21 +00:00
7976bf30b5 solvers: twoLiquidMixingFoam: Removed
Simulating the mixing of two miscible liquids is possible my considering
them as different species of a multicomponent fluid. This approach also
supports an arbitrary number of liquids. The twoLiquidMixingFoam solver
has therefore been removed and its tutorials converted to use the
multicomponentFluid solver module.
2022-11-09 16:48:09 +00:00
aa21d36278 alphatWallBoilingWallFunction: Usability improvements
Bubble waiting time ratio has been made a user adjustable parameter, and
the names of the fields reported by the wallBoilingProperties function
have been rationalised.
2022-11-08 10:32:31 +00:00
4bdfeea66d solvers::multiphaseEuler: Updated for clang 2022-11-06 22:00:45 +00:00
731b741b51 solvers::isothermalFluid: Added support for backward time scheme with topology change
Now cases with mesh refinement/unrefinement can be run with the 2nd-order
backward time scheme.  However this is for static meshes only, 2nd-order in time
with topology change AND mesh-motion is not currently supported.
2022-11-06 19:04:06 +00:00
3d7b110a15 solvers::multiphaseEuler: Updated and tested LTS support 2022-11-04 16:08:24 +00:00
ef84772312 applications/solvers/modules/fluid/multiphaseEuler/Make: Redundant, deleted 2022-11-04 10:46:37 +00:00
2180ed5c6c multiphaseEuler/functionObjects/Make/options: Removed duplicate entry
Resolves bug-report https://bugs.openfoam.org/view.php?id=3926
2022-11-04 10:12:51 +00:00
c5a2f486b5 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-11-03 21:00:29 +00:00
b1dea63437 setDeltaT: Rationalised and standardised for both modular and standard solvers 2022-11-03 20:59:43 +00:00
0da49126b4 multiphaseEuler: Function to extract wall boiling model properties
This function looks up wall boiling wall functions and collects and
writes out the following data:

  - Bubble departure diameter
  - Bubble departure frequency
  - Nucleation site density
  - Effective liquid fraction at the wall
  - Quenching heat flux
  - Evaporative heat flux

Example of function object specification:

    \verbatim
    writeWallBoilingProperties
    {
        type            wallBoilingProperties;
        functionObjectLibs ( "libmultiphaseEulerFoamFunctionObjects.so" );
        writeControl    writeTime;
        phase           liquid;
    }
    \endverbatim

Patch contributed by Juho Peltola, VTT.
2022-11-03 19:27:01 +00:00
488ffd9fd1 Deleted multiphaseEulerFoam: Replaced by the multiphaseEuler solver module 2022-11-03 15:01:38 +00:00
cec0359871 solvers::multiphaseEuler: New solver module for Euler-Euler multiphase simulations
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces multiphaseEulerFoam and all the
corresponding tutorials have been updated and moved to
tutorials/modules/multiphaseEuler.

Class
    Foam::solvers::multiphaseEuler

Description
    Solver module for a system of any number of compressible fluid phases with a
    common pressure, but otherwise separate properties. The type of phase model
    is run time selectable and can optionally represent multiple species and
    in-phase reactions. The phase system is also run time selectable and can
    optionally represent different types of momentum, heat and mass transfer.

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

    Optional fvModels and fvConstraints are provided to enhance the simulation
    in many ways including adding various sources, Lagrangian
    particles, surface film etc. and constraining or limiting the solution.

SourceFiles
    multiphaseEuler.C

See also
    Foam::solvers::compressibleVoF
    Foam::solvers::fluidSolver
    Foam::solvers::incompressibleFluid
2022-11-03 14:49:56 +00:00
879f852b80 multiphaseEulerFoam: Use Cp instead of Cpv in for calculation of Prandtl number 2022-11-01 16:21:41 +00:00
63feb9ad33 fluidThermophysicalTransportModel: Removed alphaEff from the public interface
alphaEff is now an internal field used only for the implicit energy correction
term, kappaEff, q and divq are the general and rational interface to thermal
transport.

XiFoam and PDRFoam now explicitly instantiate a unityLewisEddyDiffusivity
fluidThermophysicalTransportModel as the the unity Lewis number approximation is
hard-coded into the formulation of the energy/composition system.
2022-11-01 12:43:25 +00:00
f2cd716dec fvmLaplacian: Added laplacianCorrection functions and updated all thermal transport implementations
Now that thermal transport is implemented as an energy implicit correction on an
explicit temperature gradient formulation it is more efficient if the implicit
correction contains only the implicit terms of the matrix and not the explicit
non-orthogonal or anisotropic correction terms which are cancelled anyway when
the evaluation of the matrix for the current state is subtracted.  The new
fvm::laplacianCorrection functions provide a convenient mechanism to efficiently
evaluate only the implicit correction to the laplacian and is now used in all
the thermophysicalTransportModels.
2022-10-30 06:34:26 +00:00
4bd90bc969 rhoThermo: Renamed thermo:rho -> rho
The thermodynamic density field is now named "rho" by default and only renamed
"thermo:rho" by solvers that create and maintain a separate continuity density
field which is named "rho".  This change significantly simplifies and
standardises the specification of schemes and boundary conditions requiring
density as it is now always named "rho" or "rho.<phase>" unless under some very
unusual circumstances the thermodynamic rather than continuity density is
required for a solver maintaining both.

The advantage of this change is particularly noticeable for multiphase
simulations in which each phase has its own density now named "rho.<phase>"
rather than "thermo:rho.<phase>" as separate phase continuity density fields are
not required so for multiphaseEulerFoam the scheme specification:

    "div\(alphaRhoPhi.*,\(p\|thermo:rho.*\)\)" Gauss limitedLinear 1;

is now written:

    "div\(alphaRhoPhi.*,\(p\|rho.*\)\)" Gauss limitedLinear 1;
2022-10-28 02:19:13 +01:00
87a0b8a515 basicThermo: Renamed thermo:psi -> psi, thermo:mu -> mu and thermo:kappa -> kappa
The basic thermophysical properties are now considered fundamental and complex
models like kineticTheoryModel using these names for some other purpose must
disambiguate using typedName to prepend the model name to the field name.

This change standardises, rationalises and simplifies the specification of
fvSchemes and boundary conditions.

thermo:rho will also be renamed rho in a subsequent commit to complete this
rationalisation.
2022-10-27 20:27:56 +01:00
3152df4299 Resolved problems with Clang compilation 2022-10-26 17:36:24 +01:00
f05bcb541c solidDisplacementFoam: Updated to solve for the solid temperature in energy conservative form
consistent with the solid solver module and solidThermo.
2022-10-26 16:31:25 +01:00
5af5413542 thermophysicalTransportModel: New abstract base-class for all thermophysical transport
the new fluidThermophysicalTransportModel and solidThermophysicalTransportModel
are derived from thermophysicalTransportModel providing a consistent and unified
interface for heat transport within and between regions.  Coupled and external
heat-transfer boundary conditions can now be written independent of the
thermophysical properties or transport modelling of the regions providing
greater flexibility, simpler code and reduces the maintenance overhead.
2022-10-23 04:13:52 +01:00
3521ab03a2 ThermophysicalTransportModels: Reorganisation to support a new abstract base-class fluidThermophysicalTransportModel
The previous fluidThermophysicalTransportModel typedef has been renamed
fluidThermoThermophysicalTransportModel as it is instantiated on fluidThermo,
freeing the name fluidThermophysicalTransportModel for the new base-class.
2022-10-21 19:45:26 +01:00
8d33ad6dda mixedFvPatchField: Added optional 'valuesRequired' argument to the dictionary constructor
so that derived classes can call the dictionary constructor without reading the
refValue, refGradient or valueFraction entries.  This ensures that the
fvPatchField dictionary constructor is called, setting optional entries like
'libs' as required.
2022-10-21 12:07:50 +01:00
b1de509a77 fvModels: surfaceFilms: Support for multiple films
The surfaceFilm fvModel has been renamed surfaceFilms, and can now have
a number of independent film models specified.

For example, the hotBoxes tutorial could be modified to have separate
film regions for the boxes and for the floor. In which case, the names
of the separate films would need specifying as shown below.

    surfaceFilms
    {
        type    surfaceFilms;
        surfaceFilms (boxesFilm floorFilm); // <-- new entry
        libs    ("libsurfaceFilmModels.so");
    }

The old fvModel name, surfaceFilm, has been maintained for backwards
compatibility.

The Lagrangian surface film model now also requires the coupled
surfaceFilms to be specified when there is not just a single
default-named film. For example, in constant/cloudProperties:

    subModels
    {
        surfaceFilmModel thermoSurfaceFilm;

        thermoSurfaceFilmCoeffs
        {
            surfaceFilms    (boxesFilm floorFilm); // <-- new entry
            interactionType splashBai;
            deltaWet        0.0005;
            Adry            2630;
            Awet            1320;
            Cf              0.6;
        }

        ...
    }
2022-10-20 19:26:48 +01:00
fd2e8f1f4d solvers/modules/fluid/isothermalFluid/correctPressure: Corrected transonic option for moving meshes
This change resolves a mass-conservation issue caused by the handling of
absolute and relative fluxes in the construction of the transonic pressure
equation.
2022-10-20 13:14:56 +01:00
cdaaa61987 solidThermophysicalTransportModel: new thermophysical transport model for solids
to handle isotropic and anisotropic is a consistent, general and extensible
manner, replacing the horrible hacks which were in solidThermo.

This is entirely consistent with thermophysicalTransportModel for fluids and
provides the q() and divq() for the solid energy conservation equations.  The
transport model and properties are specified in the optional
thermophysicalTransport dictionary, the default model being isotropic if this
dictionary file is not present, thus providing complete backward-compatibility
for the common isotropic cases.

Anisotropic thermal conductivity is now handled in a much more general manner by
the anisotropic model:

Class
    Foam::solidThermophysicalTransportModels::anisotropic

Description
    Solid thermophysical transport model for anisotropic thermal conductivity

    The anisotropic thermal conductivity field is evaluated from the solid
    material anisotropic kappa specified in the physicalProperties dictionary
    transformed into the global coordinate system using default
    coordinate system and optionally additional coordinate systems specified
    per-zone in the thermophysicalProperties dictionary.

Usage
    Example of the anisotropic thermal conductivity specification in
    thermophysicalProperties with two zone-based coordinate systems in
    addition to the default:

    \verbatim
    model anisotropic;

    // Default coordinate system
    coordinateSystem
    {
        type        cartesian;
        origin      (0 0 0);
        coordinateRotation
        {
            type        cylindrical;
            e3          (1 0 0);
        }
    }

    // Optional zone coordinate systems
    zones
    {
        coil1
        {
            type        cartesian;
            origin      (0.1 0.2 0.7);
            coordinateRotation
            {
                type        cylindrical;
                e3          (0.5 0.866 0);
            }
        }

        coil2
        {
            type        cartesian;
            origin      (0.4 0.5 1);
            coordinateRotation
            {
                type        cylindrical;
                e3          (0.866 0.5 0);
            }
        }
    }
    \endverbatim

This development required substantial rationalisation of solidThermo,
coordinateSystems and updates to the solid solver module, solidDisplacementFoam,
the wallHeatFlux functionObject, thermalBaffle and all coupled thermal boundary
conditions.
2022-10-19 16:45:00 +01:00
8976585b76 waveSurfacePressureFvPatchScalarField: Updated to operate with p_rgh
so that it can now be used with either the isothermalFluid or fluid solver
modules, thus supporting non-uniform fluid properties, compressibility and
thermal effect.  This development makes the special potentialFreeSurfaceFoam
solver redundant as both the isothermalFluid and fluid solver modules are more
general and has been removed and replaced with a user redirection script.

The tutorials/multiphase/potentialFreeSurfaceFoam cases have been updated to run
with the isothermalFluid solver module:

    tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox
    tutorials/multiphase/potentialFreeSurfaceFoam/movingOscillatingBox

which demonstrate how to upgrade potentialFreeSurfaceFoam cases to
isothermalFluid.
2022-10-11 21:58:36 +01:00
778ea7bf89 waveSurfacePressureFvPatchScalarField: Moved zeta field construction from potentialFreeSurfaceFoam
The zeta field is cached on the database thus simplifying potentialFreeSurfaceFoam.
2022-10-11 15:43:38 +01:00
73ac8575eb multiphaseEulerFoam: Corrected typos
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-10-04 08:17:58 +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
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
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