Commit Graph

3785 Commits

Author SHA1 Message Date
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
08ccbdcad6 coupledTemperatureFvPatchScalarField: Corrected handling of the kappa tmp field 2022-11-16 15:44:42 +00:00
affc88e7bf noSlipFvPatchVectorField: Added mesh-motion correction to ensure continuity
Class
    Foam::noSlipFvPatchVectorField

Description
    This boundary condition fixes the velocity to zero at walls and assumes
    the walls are stationary.

    For stationary walls with sliding vertices, e.g. engine liners, the normal
    component of the velocity is set from the wall face-flux to ensure
    continuity.

Usage
    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            noSlip;
    }
    \endverbatim
2022-11-16 12:27:07 +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
41931e264c flowRateInletVelocityFvPatchVectorField: Map y_ in mapping constructor if ptf.y_ is set
Avoids recalculating y_ in the reset function for mesh-to-mesh mapping.
2022-11-14 09:40:36 +00:00
74f4f14f6c flowRateInletVelocityFvPatchVectorField: Added setWallDist call in reset function
to reset the wallDist following mesh-to-mesh mapping.
2022-11-13 17:09:59 +00:00
ef9566259a MRFslipFvPatchVectorField: New MRF/SRF boundary condition for slip-walls
Class
    Foam::MRFslipFvPatchVectorField

Description
    Rotating wall-velocity condition to be used for a slip-wall rotating with
    the moving frame in an MRF (multi-reference frame) or SRF (single reference
    frame) case.

    SRF cases are simply MRF cases with a single MRF zone which covers the
    entire domain.

Usage
    Example of the boundary condition specification for an SRF case or MRF
    case with a single zone:
    \verbatim
    <patchName>
    {
        type            MRFslip;
    }
    \endverbatim
    or if the case has several MRF zones the particular zone this patch is in
    must be named explicitly, e.g.:
    \verbatim
    <patchName>
    {
        type            MRFslip;
        MRFZoneName     rotor;
    }

See also
    Foam::MRFPatchField
    Foam::MRFZone
2022-11-12 16:39:32 +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
0203618a91 patchToPatch: Improve robustness of non-intersection methods
The nearest, matching and inverseDistance methods are now based on a
shared "nearby" method. This method creates, for each face, a local
stencil of opposing faces for which the bounding spheres overlap. This
has proven far more robust on cases with both conformal and
non-conformal interfaces.
2022-11-09 11:18:46 +00:00
6d74f70637 fvMeshTopoChangers::refiner: Added changedSinceWrite_
which is set true if the mesh refinement changed since the last time the
refinement history was written so that it can be written only at the following
write time.

Resolves bug-report https://bugs.openfoam.org/view.php?id=3928
2022-11-08 16:27:18 +00:00
94152725a8 fvMesh: added move constructor and disallowed construction
This support efficient return of fvMesh from functions which generate region
meshes without allowing risky copy construction.
2022-11-06 17:16:25 +00:00
d26e0f8c6b solidThermophysicalTransportModels::anisotropic: Added optional boundaryAligned switch
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.

    If the coordinate transformed kappa does not align exactly with the boundary
    because the patch face orientations do not conform to the coordinate system
    exactly it may be beneficial for convergence and accuracy to enforce
    alignment at the boundary by setting the optional \c boundaryAligned to
    true.

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

    \verbatim
    model anisotropic;

    // Force aligned handling of kappa irrespective
    // of the calculated patch alignment factors.
    boundaryAligned true;

    // 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
2022-11-05 19:39:40 +00:00
f22e6f0fb8 solidThermophysicalTransportModels: Improved error messages
when solidThermophysicalTransportModels::isotropic is selected for an
anisotropic solidThermo.
2022-11-05 17:39:38 +00:00
b1dea63437 setDeltaT: Rationalised and standardised for both modular and standard solvers 2022-11-03 20:59:43 +00:00
ee4f05411d functionObjects::fieldAverage: Print warning if used with foamPostProcess
Field averaging can only be performed during the run as the averaging is
performed every time-step.

Resolves bug-report https://bugs.openfoam.org/view.php?id=3922
2022-11-03 15:54:50 +00:00
488ffd9fd1 Deleted multiphaseEulerFoam: Replaced by the multiphaseEuler solver module 2022-11-03 15:01:38 +00:00
1a7da6391e fvcDdt: Added missing one-field overloads 2022-11-03 14:05:12 +00:00
82847ebbaf plane: Raise errors only during dictionary construction
This change prevents fatal errors occurring during programmatic
construction of a plane object. If an invalid plane is constructed then
this can be tested for using a new plane::valid() method.

Errors are still generated from dictionary construction as before, and
they have been improved to better identify where in the file the
erroneous specification is.

This change fixes some issues associated with meshToMesh mapping. The
cell overlap calculation now detects and skips over degenerate
tetrahedra. Previously, it was generating errors as it tried to
construct planes from the faces of these degenerate tetrahedra.
2022-11-03 11:55:39 +00:00
e6c59650de fluidThermo: Moved psi_ and mu_ from rhoThermo and psiThermo into fluidThermo
to avoid unnecessary code duplication
2022-11-01 14:14:37 +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
7d045de80a Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-11-01 11:04:12 +00:00
d7501da34c ThermophysicalTransportModels: Removed alphaEff(patchi)
Boundary conditions should use kappaEff with Cp or Cpv as appropriate
2022-11-01 11:03:07 +00:00
65b7f62857 fieldAverage: Made restart work with mesh topology change and NCC 2022-11-01 10:42:14 +00:00
6e4f192281 snappyHexMesh: Fixed bug in merging of boundary faces 2022-11-01 10:42:14 +00:00
5bdc95055d decomposePar: Fixed bug in decomposition of face sets 2022-11-01 10:42:14 +00:00
095f4b03f1 checkMesh: Added writing of NCC coverage
If checkMesh is executed with the -allGeometry option, then surface
files containing the NCC coverage will now be written out. Coverage is
the ratio between coupled area magnitude and total area magnitude. This
is useful for locating parts of the boundary mesh that are in error.
Errors (such as folds and pinches) typically manifest as a coverage
value that deviates significantly from a value of one.

This is comparable to the writing of AMI patches's weight sums, which
also used to occur when the -allGeometry option was selected.
2022-11-01 10:42:13 +00:00
1c2f614b6c fvSchemes: Added optional group/phase extension filtering
After direct and regular expression matching the scheme name is now filtered to
remove and group/phase extensions in the name and matched again with the schemes
dictionary.

This significantly simplifies the specification of schemes in multiphase
simulations, instead of the rather messy regular expressions the new method
allows schemes to be specified without the group/phase name extension and the
scheme is then used for all groups/phases.  For example in the bubbleColumn
tutorials the schemes can now be specified thus:

divSchemes
{
    default                     none;

    div(phi,alpha)              Gauss vanLeer;
    div(phir,alpha,alpha)       Gauss vanLeer;

    div(alphaRhoPhi,U)          Gauss limitedLinearV 1;
    div(phi,U)                  Gauss limitedLinearV 1;

    div(alphaRhoPhi,e)          Gauss limitedLinear 1;
    div(alphaRhoPhi,K)          Gauss limitedLinear 1;
    div(alphaRhoPhi,(p|rho))    Gauss limitedLinear 1;

    div((((alpha*rho)*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

rather than using complex regular expressions as done previously:

divSchemes
{
    default                         none;

    div(phi,alpha.air)              Gauss vanLeer;
    div(phi,alpha.water)            Gauss vanLeer;
    div(phir,alpha.water,alpha.air) Gauss vanLeer;
    div(phir,alpha.air,alpha.water) Gauss vanLeer;

    "div\(alphaRhoPhi.*,U.*\)"      Gauss limitedLinearV 1;
    "div\(phi.*,U.*\)"              Gauss limitedLinearV 1;

    "div\(alphaRhoPhi.*,(h|e).*\)"  Gauss limitedLinear 1;
    "div\(alphaRhoPhi.*,K.*\)"      Gauss limitedLinear 1;
    "div\(alphaRhoPhi.*,\(p\|rho.*\)\)" Gauss limitedLinear 1;
    "div\(alphaRhoPhi.*,\(p\|rho.*\)\)" Gauss limitedLinear 1;

    "div\(\(\(\(alpha.*\*rho.*\)*nuEff.*\)\*dev2\(T\(grad\(U.*\)\)\)\)\)" Gauss linear;
}
2022-10-31 12:37:53 +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
0661fbb433 basicThermo, heThermo: Simplified by removing alphahe
Now that kappa, Cp and Cv fields are cached and Cpv returns either the Cp or Cv
field reference depending on the energy solved and thermal transport is now
fundamentally based on temperature rather energy gradients it is no longer
necessary or useful to provide an abstract function returning alphahe.
2022-10-30 06:29:06 +00:00
2835a5423b rhoThermo: Standardised the renaming of rho -> rhoThermo:rho using the typedName function
This renaming only occurs for single-phase compressible solvers instantiating a
rhoThermo, e.g. for liquids, and usually the rhoThermo:rho is not looked-up by
sub-models or boundary conditions and if needed is better obtained from the
thermo package directly.
2022-10-28 12:16:26 +01: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
704b65f8de triangle, tetrahedron: Consolidate circumCircle/Sphere functions 2022-10-27 08:52:14 +01:00
df178284fd constSolidThermo: Corrected field file reading option 2022-10-27 03:00:23 +01:00
3152df4299 Resolved problems with Clang compilation 2022-10-26 17:36:24 +01:00
1e399aac05 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-10-26 16:32:18 +01:00
714e13a970 constSolidThermo: New solidThermo supporting uniform and non-uniform constant property specification
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 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 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-10-26 16:29:45 +01:00
bd414b822e tetrahedron: Removed unused code 2022-10-26 16:09:37 +01:00
f9d607f270 fvMeshStitcher: Prevent "not found" error when launching old cases 2022-10-25 15:46:29 +01:00
28658b94a6 solidThermophysicalTransportModels::anisotropic: Added patch name to Kappa alignment message 2022-10-25 08:46:42 +01:00
25bdd58284 solidThermophysicalTransportModels::anisotropic: Added better diagnostics for Kappa alignment 2022-10-24 20:38:27 +01:00
59e6d57a17 solidThermophysicalTransportModel::anisotropic: Corrected test for Kappa patch alignment 2022-10-24 20:25:41 +01:00
01d2c6ec52 solidThermophysicalTransportModel::anisotropic: Added heat-flux correction qCorr
to handle the wall heat-flux generated by the tangential components of the
temperature gradient when the thermal conductivity tensor Kappa does not align
with the boundary.  This is an uncommon situation but for cases where it is
important it must be handled correctly; previously this term was ignored.

For efficiency the temperature gradient field is automatically cached so that it
is not evaluated for every patch for which Kappa is not aligned with the
boundary, and the correction is evaluated and applied only for those patches.

The heat-flux correction qCorr is used in the coupled and external heat-flux
boundary conditions coupledTemperature and externalTemperature.
2022-10-24 19:01:52 +01:00
d551993e89 integratedNonUniformTable1: Corrected offsets
Resolves bug-report https://bugs.openfoam.org/view.php?id=3915
2022-10-24 10:09:29 +01:00
e8325bbcec combustionModels::EDC: Corrected handling of limits in the v2016 variant
Resolves bug-report https://bugs.openfoam.org/view.php?id=3905
2022-10-23 10:13:04 +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
1f06731e37 patchKappa: Moved the currently limited handling of anisotropic patch kappa into solidThermophysicalTransportModels 2022-10-21 15:14:48 +01:00
9cabc5aa2f Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-10-21 12:10:08 +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