Commit Graph

2142 Commits

Author SHA1 Message Date
f67445212d multiphaseEuler: Adjust the drag coefficients for the continuous phase in partialElimination
so that the residualAlpha applied to stabilised the dispersed phase does not
affect the continuous phase in the limit of it becoming pure with or without
partial-elimination.
2023-03-27 10:55:55 +01:00
8590a7ea97 multiphaseEuler::MomentumTransferPhaseSystem: Improved the face drag coefficient adjustment for the continuous phase 2023-03-25 23:16:17 +00:00
f4eee20b97 multiphaseEuler: Adjust the drag and heat transfer coefficients for the continuous phase
so that the residualAlpha applied to stabilised the dispersed phase does not
affect the continuous phase in the limit of it becoming pure.
2023-03-25 16:51:07 +00:00
7b4002fec2 solvers::*:moveMesh: rationalised the application of correctPhi
Flux correction is now applied if either the topology changed or the mesh is
moving and correctPhi is true.  This strategy allows moving mesh cases without
topology change to be run without any change to the fluxes which is appropriate
for solid-body motion of the entire domain or a rotating sub-domain with NCC.
2023-03-25 15:36:09 +00:00
7142917d06 solvers::functions: Added optional subSolverTime controlDict entry
Class
    Foam::solvers::functions

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.

    When restarting from a time directory which does contain the \c subSolver
    fields the optional \c controlDict entry \c subSolverTime may be provided to
    specify which time the \c subSolver should be instantiated for, after which
    time is reset to \c startTime for the restart.
2023-03-25 14:49:58 +00:00
b228cc539f multiphaseEuler::MovingPhaseModel: Read alphaRhoPhi if present and auto write
Needed by the phaseScalarTransport functionObject and other phase
post-processing tools.
2023-03-24 19:52:02 +00:00
e98dcc5aa8 solvers: Added ddtCorr support in MRF regions by extending the use of Uf and rhoUf
to provide the old-time absolute flux.  This avoids possible
pressure-velocity-flux decoupling (staggering) within the MRF region using
ddtCorr to better couple the velocity and flux fields.
2023-03-24 17:23:14 +00:00
ede5ec4830 multiphaseEuler: Create the drag and virtual mass tables on demand
reduces storage and unnecessary evaluation of unused tables.
2023-03-18 14:50:19 +00:00
6c19e3dc17 incompressibleFluid: Provide protected access to member functions
to allow the derivation of specialised versions.
2023-03-18 14:49:32 +00:00
e62ddc2f62 multiphaseEuler::dragModels: Refactored to remove the need for the residualRe entry 2023-03-16 15:51:59 +00:00
6ff9a04dd2 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-03-15 11:12:42 +00:00
72b876e566 fvModels::filmToVoFTransfer,VoFtoFilmTransfer: New collaborating fvModels to transfer phase between VoF and film
These two new fvModels operate between a film and a VoF region to transfer film
to the corresponding VoF phase when the film is thick enough to be resolved by
the VoF solver or from the VoF phase to the film when the near-wall resolution
is too low and it is better to treat it as a wall film.

This functionality is equivalent to the VoFPatchTransfer fvModel developed for
the old film implementation but coded in a much more general manner with
implicit treatment of the mass loss from the film or VoF region for better
numerical stability and robustness.

The simple tutorials/modules/CHT/VoFToFilm case is provided to demonstrate a
film being deposited on a surface as the plate is withdrawn from a liquid.  It
is an updated version of the tutorials/modules/compressibleVoF/plateFilm case.
2023-03-15 11:05:00 +00:00
89931bab6c solver modules: Started adding const access to physical state for fvModels 2023-03-15 11:03:02 +00:00
efdcfa9cc8 fvModels::interfaceTurbulenceDamping: Corrected documentation 2023-03-15 09:18:49 +00:00
87b606c45e foamDictionary.C: fixed typo 2023-03-14 11:33:17 +00:00
c5107bc42f surfaceCheck: make the -verbose option do something 2023-03-10 23:05:50 +00:00
b3231229f4 mappedPatchBase: Rationalised the names of mapping functions
to improve code comprehensibility:

    distribute -> fromNeigbour
    reverseDistribute -> toNeigbour
2023-03-10 15:10:12 +00:00
5b9fe57c23 VoFPatchTransfer: Rationalised the names of the cached fields and their origin
required rationalisation of the names of variables and functions in
surfaceFilmModels to clarify which relate to the film region.
2023-03-09 13:58:08 +00:00
0b0957f03d filmSurfaceVelocityFvPatchVectorField: Added option to use the fluid viscous shear stress rather than the simple drag model
Class
    Foam::filmSurfaceVelocityFvPatchVectorField

Description
    Film surface velocity boundary condition

    Evaluates the surface velocity from the shear imposed by the neighbouring
    fluid velocity using either a simple drag model based on the difference
    between the fluid and film velocities multiplied by the coefficient \c Cs or
    if \c Cs is not specified or set to 0 the fluid viscous shear stress.

    The simple model might be used in preference to the fluid viscous shear
    stress model in order to provide some means to include the drag enhancing
    effect of surface ripples, rivulets etc. in the film surface.

Usage
    \table
        Property     | Description             | Required    | Default value
        Cs           | Fluid-film drag coefficient | no | 0
    \endtable

    Example of the boundary condition specification using the simple drag model:
    \verbatim
    <patchName>
    {
        type            filmSurfaceVelocity;
        Cs              0.005;
        value           $internalField;
    }
    \endverbatim

    Example of the boundary condition specification using the fluid stress:
    \verbatim
    <patchName>
    {
        type            filmSurfaceVelocity;
        value           $internalField;
    }
    \endverbatim

See also
    Foam::mixedFvPatchField

SourceFiles
    filmSurfaceVelocityFvPatchVectorField.C
2023-03-08 13:12:08 +00:00
4d63b39e3e foamMultiRun: Added automatic region prefixing to the Info statements in the log
e.g. for the rivuletBox case the output for a time-step now looks like:

film  Courant Number mean: 0.0003701330848 max: 0.1862204919
panel Diffusion Number mean: 0.007352456305 max: 0.1276468109
box   Courant Number mean: 0.006324172752 max: 0.09030825997
      deltaT = 0.001550908752
      Time = 0.08294s

film  diagonal:  Solving for alpha, Initial residual = 0, Final residual = 0, No Iterations 0
film  diagonal:  Solving for alpha, Initial residual = 0, Final residual = 0, No Iterations 0
box   diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
film  DILUPBiCGStab:  Solving for Ux, Initial residual = 0.009869417958, Final residual = 2.132619614e-11, No Iterations 2
film  DILUPBiCGStab:  Solving for Uy, Initial residual = 0.0002799662756, Final residual = 6.101011285e-12, No Iterations 1
film  DILUPBiCGStab:  Solving for Uz, Initial residual = 1, Final residual = 1.854120599e-12, No Iterations 2
box   DILUPBiCGStab:  Solving for Ux, Initial residual = 0.004071057403, Final residual = 4.79249226e-07, No Iterations 1
box   DILUPBiCGStab:  Solving for Uy, Initial residual = 0.006370817152, Final residual = 9.606673696e-07, No Iterations 1
box   DILUPBiCGStab:  Solving for Uz, Initial residual = 0.0158299327, Final residual = 2.104129791e-06, No Iterations 1
film  DILUPBiCGStab:  Solving for e, Initial residual = 0.0002888908396, Final residual = 2.301587523e-11, No Iterations 1
panel GAMG:  Solving for e, Initial residual = 0.00878508958, Final residual = 7.807579738e-12, No Iterations 1
box   DILUPBiCGStab:  Solving for h, Initial residual = 0.004403989559, Final residual = 1.334113552e-06, No Iterations 1
film  DILUPBiCGStab:  Solving for alpha, Initial residual = 0.0002760406755, Final residual = 2.267583256e-14, No Iterations 1
film  time step continuity errors : sum local = 9.01334987e-12, global = 2.296671859e-13, cumulative = 1.907846466e-08
box   GAMG:  Solving for p_rgh, Initial residual = 0.002842335602, Final residual = 1.036572819e-05, No Iterations 4
box   diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
box   time step continuity errors : sum local = 4.538744531e-07, global = 1.922637799e-08, cumulative = -6.612579497e-09
box   GAMG:  Solving for p_rgh, Initial residual = 1.283128787e-05, Final residual = 7.063185653e-07, No Iterations 2
box   diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
box   time step continuity errors : sum local = 3.069629869e-08, global = 3.780547824e-10, cumulative = -6.234524715e-09
      ExecutionTime = 19.382601 s  ClockTime = 20 s

film  Courant Number mean: 0.0003684434169 max: 0.1840342756
panel Diffusion Number mean: 0.007352456305 max: 0.1276468109
box   Courant Number mean: 0.006292704463 max: 0.09016861809
      deltaT = 0.001550908752
      Time = 0.0844909s

where each line printed by each region solver is prefixed by the region name.
Global messages for the time-step and time are just prefixed with spaces to
align them with the region output.
2023-03-08 10:59:13 +00:00
9621cbf704 regionSolvers: Added #include "solver.H" 2023-03-07 15:37:55 +00:00
a0264c98e8 isothermalFilm: write value entry for film-specific BCs
to allow post-processing without loading the isothermalFilm library.
2023-03-07 13:27:41 +00:00
67e692b5a8 foamRun, foamMultiRun: Pre-load the solver libraries before the mesh/meshes are constructed
to ensure that any solver-specific patch types are available before mesh construction.
2023-03-07 13:18:33 +00:00
cbd9903de4 filmSurfaceVelocityFvPatchVectorField: Updated for clang 2023-03-07 08:18:25 +00:00
423fa5ba55 filmSurfaceVelocityFvPatchVectorField: New film surface boundary condition
Class
    Foam::filmSurfaceVelocityFvPatchVectorField

Description
    Film surface velocity boundary condition

    Evaluates the surface velocity from the shear imposed by the neighbouring
    fluid velocity using a simple drag model based on the difference between the
    fluid and film velocities multiplied by the coefficient \c Cs.  This simple
    model is used in preference to the standard viscous shear stress model in
    order to provide some means to include the drag enhancing effect
    of surface ripples, rivulets etc. in the film surface.

Usage
    \table
        Property     | Description             | Required    | Default value
        Cs           | Fluid-film drag coefficient | yes |
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            filmSurfaceVelocity;
        Cs              0.005;
    }
    \endverbatim
2023-03-06 21:19:20 +00:00
3d61e9aebe Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-03-03 22:29:00 +00:00
12decc028d mappedFilmPressureFvPatchScalarField: New film BC to map the neighbouring fluid pressure to the film
mappedFilmPressureFvPatchScalarField is derived from the new mappedFvPatchField
base-class for mapped patch fields including mappedValueFvPatchField.

Class
    Foam::mappedFilmPressureFvPatchScalarField

Description
    Film pressure boundary condition which maps the neighbouring fluid patch
    pressure to both the surface patch and internal film pressure field.
2023-03-03 22:26:58 +00:00
f50ff139fc Test-rigidBodyDynamics: Corrected and improved visualisation of pendulumAndSpring 2023-03-03 15:53:30 +00:00
32edc48db2 solvers: multiphaseEuler: Boiling on the surface of a stationary phase
A new wallBoiling heat transfer model has been added for use with the
thermalPhaseChangeMultiphaseSystem. This model operates similarly to the
alphatWallBoilingWallFunction. The difference is that the boiling generated by
the wallBoiling heat transfer model occurs on the surface of a third stationary
phase, within the volume of the simulation, rather than on a wall patch. This
can be used to model boiling within a packed bed or similar.

The wallBoiling heat transfer model and the alphatWallBoilingWallFunction share
underlying sub-models, so their specification is very similar. For example, in
constant/phaseProperties:

heatTransfer
{
    ...

    bed_dispersedIn_liquid_inThe_liquid
    {
        type            wallBoiling;

        liquidPhase     liquid;
        vapourPhase     gas;

        heatTransferModel
        {
            type            Gunn;
        }

        partitioningModel
        {
            type            Lavieville; // phaseFraction, linear, cosine
            alphaCrit       0.2;
        }
        nucleationSiteModel
        {
            type            LemmertChawla; // KocamustafaogullariIshii
        }
        departureDiameterModel
        {
            type            TolubinskiKostanchuk; // KocamustafaogullariIshii
        }
        departureFrequencyModel
        {
            type            KocamustafaogullariIshii; // Cole
            Cf              1.18;
        }
    }

    bed_dispersedIn_liquid_inThe_bed
    {
        type            spherical;
    }

    ...
}

Based on a patch contributed by Juho Peltola, VTT.
2023-03-03 14:23:51 +00:00
25dd524c84 generic.*Patch: Moved to new genericPatches library
genericPatches is linked into mesh generation and manipulation utilities but not
solvers so that the solvers now check for the availability of the specified
patch types.  Bugs in the tutorials exposed by this check have been corrected.
2023-03-03 09:03:47 +00:00
46e312679e mappedFilmSurface patches: New patch types to map between the film surface and fluid region 2023-03-02 21:49:10 +00:00
390c588cd4 mappedExtrudedPatchBase: New base class for extruded patches
mappedExtrudedPolyPatch and mappedExtrudedWallPolyPatch are now derived from mappedExtrudedPatchBase
2023-03-02 20:25:22 +00:00
b2e7f66820 applications/solvers/modules/Allwmake: added film 2023-03-01 10:39:37 +00:00
796cfb3b3a solvers::film: new solver module to simulate thermal liquid films and CHT
Class
    Foam::solvers::film

Description
    Solver module for flow of compressible liquid films

    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,
    radiation, surface film etc. and constraining or limiting the solution.

solvers::film is derived from solvers::isothermalFilm adding an energy equation
and temperature update with support for heat transfer to the wall using the
standard ThermophysicalTransportModels library utilising the filmWall patch type
or mappedFilmWall for CHT heat transfer to the adjacent solid region.  A huge
advantage of this consistency with the rest of OpenFOAM is that the standard
thermal coupled boundary conditions can be used without modification, e.g.
temperatureCoupled.

Two variants of the rivuletPanel tutorial case are provided,
tutorials/modules/film/rivuletPanel demonstrates heat transfer to a fixed
temperature wall and tutorials/modules/CHT/rivuletPanel demonstrates conjugate
heat transfer to a thin aluminium panel simulated in a region using the
solvers::solid solver executed with solvers::film using foamMultiRun.

More functionality will be added through the power of fvModels.
2023-02-28 19:33:12 +00:00
dcbd54c131 solvers::isothermalFilm: New solver module to simulate isothermal liquid films
Class
    Foam::solvers::isothermalFilm

Description
    Solver module for flow of compressible isothermal liquid films

    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.

The implementation of this new film solver is in fully conservative form,
solving for the film volume-fraction rather film thickness which ensures
conservation on curved and irregular surfaces and even around corners.

Also the formulation is consistent with standard FV solvers in other fundamental
respects using boundary conditions rather than volume forces to apply surface
stresses and transfers.  This hugely advantageous approach, which allows the
reuse of many of the standard OpenFOAM libraries, in particular standard
compressibleMomentumTransportModels for the wall and internal film stresses, is
achieved using the special patch types filmWall and filmSurface to handle the
difference between the film thickness and the film cell layer height.

The specification of physical properties, boundary conditions, optional models
etc. etc. is handled in the same manner as all the other solver modules, making
much easier to use and to maintain the code.

Currently only coupling to the wall is supported with laminar transport, surface
tension, a new and more accurate contact angle algorithm and gravity which is
sufficient to demonstrate rivulet flow for example as in the tutorial case
provided: tutorials/modules/isothermalFilm/rivuletPanel

Support for coupling to an adjacent fluid region, Lagrangian impingement and
ejection, transfer to and from a VoF phase etc. will be added in the future via
the standard fvModels interface.
2023-02-28 19:16:49 +00:00
c7c8c0fa46 extrudeToRegionMesh: Added options to set the name and type of the generated patches
e.g. in extrudeToRegionMeshDict:

// Generate the region named film
region          film;

// from the patch extrudeWall
patches         (extrudeWall);

// generating mapped patches for the extruded region
adaptMesh       yes;

// New options:

// Set the type of the mapped patch on the existing mesh to mappedWall ...
patchTypes      (mappedWall);

// ... and name to wall
patchNames      (wall);

// Set the type of the mapped patch on the region mesh to mappedFilmWall ...
regionPatchTypes   (mappedFilmWall);

// ... and name to wall
regionPatchNames   (wall);

// Set the type of the opposite patch on the region mesh to empty ...
regionOppositePatchTypes    (empty);

// ... and name to empty
regionOppositePatchNames    (empty);

All the above entries are optional and if not present the previous behaviour is
reproduced.
2023-02-28 15:43:37 +00:00
2177ce50dd applications/solvers/modules: Replaced include compressibleMomentumTransportModel.H rather than compressibleMomentumTransportModels.H 2023-02-26 11:59:24 +00:00
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
cd5acd5ed2 foamToVtk: Changed -poly option to -polyhedra
The new option takes a value indicating which cell types should be
written out as polyhedra. The values are as follows:

      none: No polyhedral cells are written. Cells which match specific
            shapes (hex, pyramid, prism, ...) are written as their
            corresponding VTK cell types. Arbitrary polyhedral cells
            that do not match a specific shape are decomposed into
            tetrahedra.

 polyhedra: Only arbitrary polyhedral cells are written as a VTK
            polyhedron. Cells that match specific shapes are written as
            their corresponding VTK cell types.

       all: All cells are written as a VTK polyhedron.

The default is 'none', which retains the previous default behaviour.
2023-02-17 15:11:20 +00:00
c802985a2d Test-patchToPatch: Added -region and -sourceRegion options 2023-02-16 15:15:30 +00:00
2c247c3e8f meshTools/algorithms/PatchEdgeFaceWave: Added point object with data 2023-02-16 11:12:36 +00:00
f95eb5fd11 meshToMesh, mapFieldsPar: Rationalisation
Cell-to-cell interpolation has been moved to a hierarchy separate from
meshToMesh, called cellsToCells. The meshToMesh class is now a
combination of a cellsToCells object and multiple patchToPatch objects.
This means that when only cell-to-cell interpolation is needed a basic
cellsToCells object can be selected.

Cell-to-cell and vol-field-to-vol-field interpolation now has two well
defined sets of functions, with a clear distinction in how weights that
do not sum to unity are handled. Non-unity weights are either
normalised, or a left-over field is provided with which to complete the
weighted sum.

The left-over approach is now consistently applied in mapFieldsPar,
across both the internal and patch fields, if mapping onto an existing
field in the target case. Warning are now generated for invalid
combinations of settings, such as mapping between inconsistent meshes
without a pre-existing target field.

All mapping functions now take fields as const references and return tmp
fields. This avoids the pattern in which non-const fields are provided
which relate to the source, and at some point in the function transfer
to the target. This pattern is difficult to reason about and does not
provide any actual computational advantage, as the fields invariably get
re-allocated as part of the process anyway.

MeshToMesh no longer stores the cutting patches. The set of cutting
patches is not needed anywhere except at the point of mapping a field,
so it is now supplied to the mapping functions as an argument.

The meshToMesh topology changer no longer supports cutting patch
information. This did not previously work. Cutting patches either get
generated as calculated, or they require a pre-existing field to specify
their boundary condition. Neither of these options is suitable for a
run-time mesh change.

More code has been shared with patchToPatch, reducing duplication.
2023-02-16 11:12:36 +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