Commit Graph

1434 Commits

Author SHA1 Message Date
a63600620a applications/solvers/modules/Allwmake: Added solidDisplacement 2023-01-03 21:13:46 +00:00
55be8068d4 solvers::solidDisplacement: New solver module for solid stress analysis
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces solidDisplacementFoam and
solidEquilibriumDisplacementFoam and all the corresponding tutorials have been
updated and moved to tutorials/modules/solidDisplacement.

Class
    Foam::solvers::solidDisplacement

Description
    Solver module for steady or transient segregated finite-volume solution of
    linear-elastic, small-strain deformation of a solid body, with optional
    thermal diffusion and thermal stresses.

    Solves for the displacement vector field D, also generating the stress
    tensor field sigma, including the thermal stress contribution if selected.

SourceFiles
    solidDisplacement.C
2023-01-03 18:12:04 +00:00
20c7c7c21a Resolve warning messages generated by Clang-15 2023-01-03 11:26:15 +00:00
b082f06ac0 solidDisplacementFoam: Merged the solidEquilibriumDisplacementFoam functionality
The accelerationFactor option in solidEquilibriumDisplacementFoam is now
available in solidDisplacementFoam when running steady-state, providing a >5x
speed-up to convergence of the updated beamEndLoad case.  This makes
solidEquilibriumDisplacementFoam redundant and it has been removed.
2023-01-03 09:57:28 +00:00
c64996b207 solidEquilibriumDisplacementFoam: Combined the tractionDisplacement and tractionDisplacementCorrection BCs
so that the same BC can be used for both solidDisplacementFoam and
solidEquilibriumDisplacementFoam.  Also updated the beamEndLoad tutorial and
added a solidDisplacementFoam version to test the combined BC.
2023-01-02 22:30:25 +00:00
b7ea5fcc29 solvers::XiFluid: New solver module for compressible premixed/partially-premixed combustion
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces XiFoam and all the corresponding
tutorials have been updated and moved to tutorials/modules/XiFluid.

Class
    Foam::solvers::XiFluid

Description
    Solver module for compressible premixed/partially-premixed combustion with
    turbulence modelling.

    Combusting RANS code using the b-Xi two-equation model.
    Xi may be obtained by either the solution of the Xi transport
    equation or from an algebraic expression.  Both approaches are
    based on Gulder's flame speed correlation which has been shown
    to be appropriate by comparison with the results from the
    spectral model.

    Strain effects are encorporated directly into the Xi equation
    but not in the algebraic approximation.  Further work need to be
    done on this issue, particularly regarding the enhanced removal rate
    caused by flame compression.  Analysis using results of the spectral
    model will be required.

    For cases involving very lean Propane flames or other flames which are
    very strain-sensitive, a transport equation for the laminar flame
    speed is present.  This equation is derived using heuristic arguments
    involving the strain time scale and the strain-rate at extinction.
    the transport velocity is the same as that for the Xi equation.

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

    Reference:
    \verbatim
        Greenshields, C. J., & Weller, H. G. (2022).
        Notes on Computational Fluid Dynamics: General Principles.
        CFD Direct Ltd.: Reading, UK.
    \endverbatim

SourceFiles
    XiFluid.C

See also
    Foam::solvers::fluidSolver
    Foam::solvers::isothermalFluid
2022-12-29 23:53:33 +00:00
851c9391be solvers::incompressibleVoF: New solver module for incompressible two-phase flow with VoF
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces interFoam and all the corresponding
tutorials have been updated and moved to tutorials/modules/incompressibleVoF.

Both incompressibleVoF and compressibleVoF solver modules are derived from the
common two-phase VoF base-class solvers::VoFSolver which handles the
complexities of VoF interface-compression, boundedness and conservation with
2nd-order schemes in space and time using the semi-implicit MULES limiter and
solution proceedure.  This maximises code re-use, improves readability and
simplifies maintenance.

Class
    Foam::solvers::incompressibleVoF

Description
    Solver module for for 2 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.

    Either mixture or two-phase transport modelling may be selected.  In the
    mixture approach a single laminar, RAS or LES model is selected to model the
    momentum stress.  In the Euler-Euler two-phase approach separate laminar,
    RAS or LES selected models are selected for each of the phases.

    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
    incompressibleVoF.C

See also
    Foam::solvers::VoFSolver
    Foam::solvers::compressibleVoF
2022-12-25 11:38:36 +00:00
1a24f1e30c multiphaseEuler::predictThermophysicalTransport: Moved into the energyPredictor() loop
to support the update the alphat boundary condition within the energy corrector
loop which may be needed for wall-boiling simulations.
2022-12-22 23:20:14 +00:00
c1ab4fc165 multiphaseEuler::ThermalPhaseChangePhaseSystem: Corrected diagnostic messages when running in parallel
Patch contributed by Timo Niemi, VTT.
2022-12-22 23:11:41 +00:00
063ab567d4 solvers::solid: Changed the writing of the diffusion number for consistency with Courant number 2022-12-21 12:31:50 +00:00
1366eb20f3 multiphaseEuler::MomentumTransferPhaseSystem: Removed optional (1 - phase) prefactor from alphaDByAf
Tests have shown that the alphaDByAf phase-pressure diffusion coefficient
provides better stability without the optional (1 - phase) prefactor without
introducing excessive smearing of the solution.
2022-12-21 12:12:31 +00:00
74b302d6f8 solvers::compressibleVoF: Implemented new energy conservative temperature correction equation
In order to ensure temperature consistency between the phases it is necessary to
solve for the mixture temperature rather than the mixture energy or phase
energies which makes it very difficult to conserve energy.  The new temperature
equation is a temperature correction on the combined phase energy equations
which will conserve the phase and mixture energies at convergence.  The
heat-flux (Laplacian) term is maintained in mixture temperature form so
heat-transfer boundary conditions, in particular for CHT, remain in terms of the
mixture kappaEff.  The fvModels are applied to the phase energy equations and
the implicit part converted into an implicit term in the temperature correction
part of the equation to improve convergence and stability.

This development has required some change to the alphaEqn.H and interFoam has
been updated for consistency in preparation for conversion into the
solvers::incompressibleVoF modular module.

All compressibleVoF fvModels and tutorial cases have been updated for the above
change.  Note that two entries are now required for the convection terms in the
temperature equation, one for explicit phase energy terms and another for the
implicit phase temperature correction terms, e.g.

tutorials/modules/compressibleVoF/ballValve

    div(alphaRhoPhi,e) Gauss limitedLinear 1;
    div(alphaRhoPhi,T) Gauss upwind;

In the above the upwind scheme is selected for the phase temperature correction
terms as they are corrections and will converge to a zero contribution.  However
there may be cases which converge better if the same scheme is used for both the
energy and temperature terms, more testing is required.
2022-12-18 17:28:11 +00:00
d9ba28b427 momentumTransportModels: Added a new predict() function in addition to the existing correct() function
Some momentumTransportModels like the laminar Stokes and generalisedNewtonian
models do no solve transport equations and the transport coefficients they
provide can be predicted at the beginning of the time-step rather than corrected
at the end, after conservative fluxes are available.  A particular advantage of
this approach is that complex data cached in the momentumTransportModels
can now be deleted following mesh topology changes and recreated in the
predict() call which is more efficient than attempting to register and map the
data.

Currently the predict() function is only used for the Stokes and
generalisedNewtonian models but it will be extended in the future to cover many
LES models which also do not require the solution of transport equations.

All solvers and solver modules have been update to call the
momentumTransportModel::predict() function at the beginning of the time-step,
controlled by the new PIMPLE transportPredictionFirst control as appropriate.
2022-12-16 10:12:22 +00:00
ce42ebc5d7 thermophysicalTransportModel: added predict() function
None of the current thermophysicalTransportModels solve transport equations in
order to evaluate the thermophysical transport properties so it makes more sense
that the evaluation occurs at the beginning of the time-step rather than at the
end where conservative fluxes are available for transport solution.  To enable
this the correct() functions have been renamed predict() and called in the
prePredictor() step of foamRun and foamMultiRun and at the beginning of the
time-step in the legacy solvers.  A particular advantage of this approach is
that complex data cached in the thermophysicalTransportModels can now be deleted
following mesh topology changes and recreated in the predict() call which is
more efficient than attempting to register and map the data.

An empty correct() function is included in addition to the new predict()
function in thermophysicalTransportModel to support scalar flux transport
closure in the future if needed.

Additionally the two transport model corrector function calls in foamRun and
foamMultiRun have been combined into a single postCorrector() call to allow
greater flexibility in transport property prediction and correction in the
modular solvers.
2022-12-15 14:59:44 +00:00
9a1ef56fdb specieReactionRates: Prevent excessive re-evaluation of reactions 2022-12-14 16:39:07 +00:00
a3681c3428 DemandDrivenMeshObject: Templated abstract base-class for demand-driven mesh objects
Replaces MeshObject, providing a formalised method for creating demand-driven
mesh objects, optionally supporting update functions called by the mesh
following mesh changes.

Class
    Foam::DemandDrivenMeshObject

Description
    Templated abstract base-class for demand-driven mesh objects used to
    automate their allocation to the mesh database and the mesh-modifier
    event-loop.

    DemandDrivenMeshObject is templated on the type of mesh it is allocated
    to, the type of the mesh object (TopologicalMeshObject, GeometricMeshObject,
    MoveableMeshObject, DistributeableMeshObject, UpdateableMeshObject) and the
    type of the actual object it is created for example:

    \verbatim
    class leastSquaresVectors
    :
        public DemandDrivenMeshObject
        <
            fvMesh,
            MoveableMeshObject,
            leastSquaresVectors
        >
    {
    .
    .
    .
        //- Delete the least square vectors when the mesh moves
        virtual bool movePoints();
    };
    \endverbatim

    MeshObject types:

    - TopologicalMeshObject: mesh object to be deleted on topology change
    - GeometricMeshObject: mesh object to be deleted on geometry change
    - MoveableMeshObject: mesh object to be updated in movePoints
    - UpdateableMeshObject: mesh object to be updated in topoChange or
        movePoints
    - PatchMeshObject: mesh object to be additionally updated patch changes

    DemandDrivenMeshObject should always be constructed and accessed via the New
    methods provided so that they are held and maintained by the objectRegistry.
    To ensure this use constructors of the concrete derived types should be
    private or protected and friendship with the DemandDrivenMeshObject
    base-class declared so that the New functions can call the the constructors.

Additionally the mesh-object types (TopologicalMeshObject, GeometricMeshObject,
MoveableMeshObject, DistributeableMeshObject, UpdateableMeshObject) can now be
used as mix-in types for normally allocated objects providing the same interface
to mesh-change update functions, see the Fickian fluid
thermophysicalTransportModel or anisotropic solid thermophysicalTransportModel.
This new approach to adding mesh-update functions to classes will be applied to
other existing classes and future developments to simplify the support and
maintenance of run-time mesh changes, in particular mesh refinement/unrefinement
and mesh-to-mesh mapping.
2022-12-13 18:29:20 +00:00
7822dbe467 solvers::multicomponentFluid: Corrected typo 2022-12-11 22:51:43 +00:00
a59143e8c8 solvers::isothermalFluid: Removed temporary diagnostic messages 2022-12-09 08:31:41 +00:00
a00cf16bd7 solvers::isothermalFluid: Updated for mesh-motion with NCC and mesh-to-mesh mapping 2022-12-08 17:37:37 +00:00
1fce6acf01 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-12-07 14:48:30 +00:00
a6456cdd73 solvers/modules: turbulence -> momentumTransport
Momentum transport in the modular solvers is generalised and run-time
selectable, supporting laminar, generalised laminar or non-Newtonian as well LES
or RAS turbulence modelling so it is clearer to name the momentum transport
model instance 'momentumTransport' rather than 'turbulence'.
2022-12-07 14:45:49 +00:00
844b4d8e7f rhoParticleFoam: Permit use with thermo clouds 2022-12-07 14:21:31 +00:00
a733a2f6c4 compressibleInterPhaseThermophysicalTransportModel: Added q() function for post-processing tools 2022-12-07 12:29:21 +00:00
9cde5a0c5d compressibleVoF::compressibleInterPhaseThermophysicalTransportModel: Added to support CHT
With the addition of the compressibleInterPhaseThermophysicalTransportModel
thermophysicalTransportModel the compressibleVoF modular solver now support
conjugate heat transfer (CHT).

Th new tutorials/modules/CHT/VoFcoolingCylinder2D tutorial case is provided to
demonstrate this functionality and shows a heated ceramic rod with air flowing
over the top and water underneath.
2022-12-07 11:56:34 +00:00
be844f8340 MomentumTransferPhaseSystem: Name the interpolation of pPrime consistently between face and cell momentum forms
Simplifies the setting of the scheme for the phase pressure, e.g. choosing localMax

interpolationSchemes
{
    default     linear;
    pPrime      localMax;
}

improves stability and reduces chequerboarding in the solution at higher Courant
numbers.
2022-12-04 15:51:37 +00:00
2f4dd4fe27 Code simplification: GeometricField<Type, fvPatchField, volMesh> -> VolField<Type>
Using the VolField<Type> partial specialisation of
GeometricField<Type, fvPatchField, volMesh>
simplifies the code and improves readability.
2022-12-02 22:04:45 +00:00
fe368d5332 Code simplification: GeometricField<Type, fvsPatchField, surfaceMesh> -> SurfaceField<Type>
Using the SurfaceField<Type> partial specialisation of
GeometricField<Type, fvsPatchField, surfaceMesh>
simplifies the code and improves readability.
2022-12-02 19:02:15 +00:00
e8078ca235 multiphaseEuler::MomentumTransferPhaseSystem:alphaDByAf: multiphase consistent replacement for DByAfs
In order that the phase-fractions sum to 1 it is necessary that the same
diffusivity is used for ALL phases in the implicitPhasePressure option.  This is
guaranteed by the new alphaDByAf function which returns a single
surfaceScalarField diffusivity to be used when forming the Laplacian term in the
implicit phase-fraction diffusion correction equation in phaseSystemSolve.

The phase-pressure and turbulent dispersion interface terms are summed over all
phases and interfaces in alphaDByAf to form a single diffusivity.
2022-12-01 21:12:04 +00:00
ed7e703040 Time::timeName(): no longer needed, calls replaced by name()
The timeName() function simply returns the dimensionedScalar::name() which holds
the user-time name of the current time and now that timeName() is no longer
virtual the dimensionedScalar::name() can be called directly.  The timeName()
function implementation is maintained for backward-compatibility.
2022-11-30 15:53:51 +00:00
a25f99dba3 constSolidThermo: Added support for properties to be specified per-zone
Description
    Uniform or non-uniform constant solid thermodynamic properties

    Each physical property can specified as either \c uniform in which case the
    value entry is read, \c zonal in which case the value entry and zone list
    are read or \c file in which case the field file in read from the constant
    directory.

Usage
    Example of uniform constant solid properties specification:
    \verbatim
        thermoType          constSolidThermo;

        rho
        {
            type        uniform;
            value       8940;
        }

        Cv
        {
            type        uniform;
            value       385;
        }

        kappa
        {
            type        uniform;
            value       380;
        }
    \endverbatim

    Example of zonal constant solid properties specification where kappa is
    different in different zones:
    \verbatim
        thermoType          constSolidThermo;

        rho
        {
            type        uniform;
            value       8940;
        }

        Cv
        {
            type        uniform;
            value       385;
        }

        kappa
        {
            type        zonal;
            value       380;

            zones
            {
                heater      560;
                insulation  100;
            }
        }
    \endverbatim

    Example of non-uniform constant solid properties specification:
    \verbatim
        thermoType          constSolidThermo;

        rho
        {
            type        file;
        }

        Cv
        {
            type        file;
        }

        kappa
        {
            type        file;
        }
    \endverbatim
    where each of the field files are read from the constant directory.
2022-11-28 17:50:34 +00:00
3aea199ebe multiphaseEuler::IATEsources::IATEturbulentBreakUp: Corrected turbulent Weber number and source expression
Resolves bug-reports:
https://bugs.openfoam.org/view.php?id=3936
https://bugs.openfoam.org/view.php?id=3935
2022-11-28 08:44:56 +00:00
2d8537759f driftFluxFoam: Added drift velocity to Courant number test
to aid stability in cases where the drift velocity is comparable to the mean
velocity.
2022-11-24 08:43:09 +00:00
df22313066 Renamed surfaceFilmSubModels -> surfaceFilmModels 2022-11-23 15:28:51 +00:00
d693c17b3d singleLayerRegionModel: renamed regionMesh() -> mesh()
in the context of the region model the mesh is the region mesh and so there is
no need to name the access function with the prefix "region".
2022-11-23 14:52:33 +00:00
052a4803f0 regionModels: Refactored to remove the now redundant regionModel base class 2022-11-23 14:23:12 +00:00
619f015bcc alphatWallBoilingWallFunctionFvPatchScalarField: Corrected convergence check in parallel 2022-11-21 11:46:06 +00:00
57379321f8 coupledMultiphaseTemperatureFvPatchScalarField: Added support for kappaLayers 2022-11-21 11:42:57 +00:00
084097bab9 solvers/modules: Updated correctPhi logic so that it is not required following topology change
Now fluxes are updated from the mapped fields following mesh topology change
with or without implicit continuity correction enabled by the optional
correctPhi switch.
2022-11-20 20:22:59 +00:00
691866d782 solvers::isothermalFluid,fluid,multicomponentFluid: Improved the enthalpy pressure-work on moving meshes
also simplified the implementation to improve maintainability
2022-11-19 20:32:27 +00:00
091852f66c coupledMultiphaseTemperatureFvPatchScalarField: Updated for Clang 2022-11-18 16:37:22 +00:00
b718817164 multiphaseEuler: interfaceSaturationTemperatureModel: Remove left over debugging message
Resolves bug report https://bugs.openfoam.org/view.php?id=3933
2022-11-18 08:44:58 +00:00
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