Commit Graph

5533 Commits

Author SHA1 Message Date
8cc05a479e MULES: Removed use of slicing and syncTools
MULES no longer synchronises the limiter field using syncTools. Surface
boundary field synchronisation is now done with a surface-field-specific
communication procedure that should result in scaling benefits relative
to syncTools. This change also means that the limiter does not need to
be continuous face field which is then sliced; it can be a standard
surface field.
2021-10-28 13:10:48 +01:00
49bf52b469 Removed redundant files 2021-10-27 16:32:21 +01:00
40e072670e constAnIsoSolidTransport: Updated typeName
Resolves bug-report https://bugs.openfoam.org/view.php?id=3747
2021-10-27 16:31:40 +01:00
a90b60e57d Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-10-27 16:04:11 +01:00
aa6c04a43a functionObjects::scalarTransport: Added support for MULES with sub-cycling and semi-implicit options
Description
    Evolves a passive scalar transport equation.

    - To specify the field name set the \c field entry
    - To employ the same numerical schemes as another field set
      the \c schemesField entry,
    - The \c diffusivity entry can be set to \c none, \c constant, \c viscosity
    - A constant diffusivity is specified with the \c D entry,
    - If a momentum transport model is available and the \c viscosity
      diffusivety option specified an effective diffusivity may be constructed
      from the laminar and turbulent viscosities using the diffusivity
      coefficients \c alphal and \c alphat:
      \verbatim
          D = alphal*nu + alphat*nut
      \endverbatim

    Example:
    \verbatim
        #includeFunc scalarTransport(T, alphaD=1, alphaDt=1)
    \endverbatim

    For incompressible flow the passive scalar may optionally be solved with the
    MULES limiter and sub-cycling or semi-implicit in order to maintain
    boundedness, particularly if a compressive, PLIC or MPLIC convection
    scheme is used.

    Example:
    \verbatim
        #includeFunc scalarTransport(tracer, diffusion=none)

    with scheme specification:
        div(phi,tracer)     Gauss interfaceCompression vanLeer 1;

    and solver specification:
        tracer
        {
            nCorr      1;
            nSubCycles 3;

            MULESCorr       no;
            nLimiterIter    5;
            applyPrevCorr   yes;

            solver          smoothSolver;
            smoother        symGaussSeidel;
            tolerance       1e-8;
            relTol          0;

            diffusion
            {
                solver          smoothSolver;
                smoother        symGaussSeidel;
                tolerance       1e-8;
                relTol          0;
            }
        }
    \endverbatim
2021-10-27 16:01:46 +01:00
7266aa8728 GeometricFieldFunctions: Added cmptMag function 2021-10-27 13:01:58 +01:00
c8c015ddb8 fvMesh: Standardised names of non-const geometry access methods 2021-10-27 13:01:58 +01:00
cd80831261 string: Added const replace and replaceAll
which return the replaced string rather than modify the string the function is
called for.
2021-10-25 10:15:44 +01:00
ad28cb49b5 codedBase: Added support for '-' in entry names
by mapping '-' to '_' in the generation of the code name.

Resolves bug-report https://bugs.openfoam.org/view.php?id=3744
2021-10-24 11:38:55 +01:00
cdefd71521 fieldCoordinateSystemTransform: Updated coordinateSystem construction and documentation
Resolves bug-report http://bugs.openfoam.org/view.php?id=3746
2021-10-24 11:33:56 +01:00
c515e74e00 unityLewisFourier: Corrected unityLewisFourier::j for FickianFourier which inherits it
Resolves bug-report https://bugs.openfoam.org/view.php?id=3743
2021-10-22 22:31:25 +01:00
c01118589f functionObjects: Added fields() function to provide list of required fields to postProcess
With this change each functionObject provides the list of fields required so
that the postProcess utility can pre-load them before executing the list of
functionObjects.  This provides a more convenient interface than using the
-field or -fields command-line options to postProcess which are now redundant.
2021-10-21 09:23:34 +01:00
777e5aeece functionObjects::probes: Ensure selected fields are loaded in postProcess mode 2021-10-19 13:13:53 +01:00
71b5714fad coldEngineFoam: Updated for changes in XiEngineFoam 2021-10-19 12:05:57 +01:00
d8dbe3101c engineTime: Avoid clash with the new userTimes::engine 2021-10-19 10:14:09 +01:00
3ef3e96c3f Time: Added run-time selectable userTime option
replacing the virtual functions overridden in engineTime.

Now the userTime conversion function in Time is specified in system/controlDict
such that the solver as well as all pre- and post-processing tools also operate
correctly with the chosen user-time.

For example the user-time and rpm in the tutorials/combustion/XiEngineFoam/kivaTest case are
now specified in system/controlDict:

userTime
{
    type     engine;
    rpm      1500;
}

The default specification is real-time:

userTime
{
    type     real;
}

but this entry can be omitted as the real-time class is instantiated
automatically if the userTime entry is not present in system/controlDict.
2021-10-19 09:09:01 +01:00
0a54efe189 XiEngineFoam: Updated handling of ddtCorr 2021-10-18 22:09:55 +01:00
686f7fb21a Time: Simplification and rationalisation of userTime
First step towards merging userTime into Time so that post-processing tools
operate with the same userTime mode as the solvers.
2021-10-14 15:05:14 +01:00
45c8a4695a functionObjects::comfort: Corrected warning message
Resolves bug-report https://bugs.openfoam.org/view.php?id=3739
2021-10-14 14:36:37 +01:00
cd1f69599e constTransport: Added the option to specify kappa
The "const" transport model now supports the following input where the
thermal condiuctivity is explicitly specified:

    transport
    {
        mu          1.82e-05;
        kappa       0.0258;
    }

The input in which Prandtl number is specified is also still available:

    transport
    {
        mu          1.82e-05;
        Pr          0.71;
    }

If both kappa and Pr are specified then an error will be generated.
2021-10-12 13:36:41 +01:00
fb53b915b2 fvConstraints::limitTemperature: Added options energy/temperature field name
The energy field limited to limit the temperature is obtained automatically from
the thermo package for the phase except for compressibleInterFoam which uniquely
solves for mixture temperature directly rather than energy.  To limit this
temperature rather than the energy the optional 'field' entry should be set to
'T', e.g.:

    limitT
    {
        type limitTemperature;
        selectionMode all;
        field T;
        min 310;
        max 500;
    }
2021-10-12 12:28:27 +01:00
12dc41d0fb compressibleInterFoam::TEqn: Added internal energy formulation option
The temperature equation in compressibleInterFoam is derived from the phase
total internal energy equations including the kinetic energy source terms.
While this formulation handles pressure loss more accurately the kinetic energy
source terms can cause numerical problems and more likely to induce negative
temperatures in regions where the pressure drops rapidly.  For such cases it may
be beneficial to solve a temperature equation derived from the phase internal
energy equations, i.e. without the kinetic energy source terms which is now
selectable by setting the optional totalInternalEnergy entry in
constant/phaseProperties to false:

    totalInternalEnergy false;

When this entry is omitted the total energy form is used providing
backward-compatibility.
2021-10-11 14:22:29 +01:00
2fe74a5bd2 twoPhaseMixture: Updated support for re-reading of phaseProperties 2021-10-11 14:21:56 +01:00
1a6b662b41 surfaceInterpolate: Made consistent with other function objects
The surfaceInterpolate function object is now a field expression. This
means it works in the same way as mag, grad, etc... It also now has a
packaged configuration and has been included into the postProcessing
test case.

It can be used in the following ways. On the command line:

   postProcess -func "surfaceInterpolate(rho, result=rhof)"

   rhoPimpleFoam -postProcess -func "surfaceInterpolate(thermo:rho, result=rhof)"

In the controlDict:

   functions
   {
       #includeFunc surfaceInterpolate(rho, result=rhof)
   }

By running:

   foamGet surfaceInterpolate

Then editing the resulting system/surfaceInterpolate file and then
running postProcess or adding an #includeFunc entry without arguments.
2021-10-08 09:10:27 +01:00
3a1897d0d8 foamInfo: improved handling of fvModels 2021-10-07 15:54:02 +01:00
51446a76df fvModels: Standardised directory structure
All library-specific fvModels are now in an fvModels/<modelName>
sub-directory of the library
2021-10-07 12:12:07 +01:00
4e445a8dec thermophysicalModels/specie/thermo: Corrected documentation
Resolves bug-report https://bugs.openfoam.org/view.php?id=3735
2021-10-06 08:20:29 +01:00
14f68613ec hConstThermo, eConstThermo: Corrected documentation
Resolves bug-report https://bugs.openfoam.org/view.php?id=3735
2021-10-05 09:19:10 +01:00
d1e6971bea fvMesh: Completed the mover and topoChanger logic in the new update function 2021-10-04 08:48:55 +01:00
905eea9115 etc/templates: Renamed thermophysicalProperties -> physicalProperties 2021-10-01 20:53:17 +01:00
10f67e994f fluxLimitedLangmuirHinshelwoodReactionRate: Corrected loop range 2021-10-01 20:47:23 +01:00
cf3d6cd1e9 fvMeshMovers, fvMeshTopoChangers: General mesh motion and topology change replacement for dynamicFvMesh
Mesh motion and topology change are now combinable run-time selectable options
within fvMesh, replacing the restrictive dynamicFvMesh which supported only
motion OR topology change.

All solvers which instantiated a dynamicFvMesh now instantiate an fvMesh which
reads the optional constant/dynamicFvMeshDict to construct an fvMeshMover and/or
an fvMeshTopoChanger.  These two are specified within the optional mover and
topoChanger sub-dictionaries of dynamicFvMeshDict.

When the fvMesh is updated the fvMeshTopoChanger is first executed which can
change the mesh topology in anyway, adding or removing points as required, for
example for automatic mesh refinement/unrefinement, and all registered fields
are mapped onto the updated mesh.  The fvMeshMover is then executed which moved
the points only and calculates the cell volume change and corresponding
mesh-fluxes for conservative moving mesh transport.  If multiple topological
changes or movements are required these would be combined into special
fvMeshMovers and fvMeshTopoChangers which handle the processing of a list of
changes, e.g. solidBodyMotionFunctions:multiMotion.

The tutorials/multiphase/interFoam/laminar/sloshingTank3D3DoF case has been
updated to demonstrate this new functionality by combining solid-body motion
with mesh refinement/unrefinement:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  dev
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant";
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

mover
{
    type    motionSolver;

    libs    ("libfvMeshMovers.so" "libfvMotionSolvers.so");

    motionSolver    solidBody;

    solidBodyMotionFunction SDA;

    CofG            (0 0 0);
    lamda           50;
    rollAmax        0.2;
    rollAmin        0.1;
    heaveA          4;
    swayA           2.4;
    Q               2;
    Tp              14;
    Tpn             12;
    dTi             0.06;
    dTp             -0.001;
}

topoChanger
{
    type    refiner;

    libs    ("libfvMeshTopoChangers.so");

    // How often to refine
    refineInterval  1;

    // Field to be refinement on
    field           alpha.water;

    // Refine field in between lower..upper
    lowerRefineLevel 0.001;
    upperRefineLevel 0.999;

    // Have slower than 2:1 refinement
    nBufferLayers   1;

    // Refine cells only up to maxRefinement levels
    maxRefinement   1;

    // Stop refinement if maxCells reached
    maxCells        200000;

    // Flux field and corresponding velocity field. Fluxes on changed
    // faces get recalculated by interpolating the velocity. Use 'none'
    // on surfaceScalarFields that do not need to be reinterpolated.
    correctFluxes
    (
        (phi none)
        (nHatf none)
        (rhoPhi none)
        (alphaPhi.water none)
        (meshPhi none)
        (meshPhi_0 none)
        (ghf none)
    );

    // Write the refinement level as a volScalarField
    dumpLevel       true;
}

// ************************************************************************* //

Note that currently this is the only working combination of mesh-motion with
topology change within the new framework and further development is required to
update the set of topology changers so that topology changes with mapping are
separated from the mesh-motion so that they can be combined with any of the
other movements or topology changes in any manner.

All of the solvers and tutorials have been updated to use the new form of
dynamicMeshDict but backward-compatibility was not practical due to the complete
reorganisation of the mesh change structure.
2021-10-01 15:50:06 +01:00
167ad7442c snappyHexMesh: Renamed locationInMesh -> insidePoint
for consistency with the regionToCell topo set source and splitMeshRegions and
provides more logical extension to the multiple and outside point variants insidePoints,
outsidePoint and outsidePoints.
2021-09-28 16:40:44 +01:00
2b57e77d91 snappyHexMesh: Generalised selection of multiple cell regions
Within the snappyHexMeshDict castellatedMeshControls:

    To select the cells outside a surface region:
        outsidePoint <point>;

    To select the cells outside a number of surface regions:
        outsidePoints: (<point> <point>...);

    To select the cells within a single surface region:
        insidePoint <point>;

    To select the cells within a number of surface regions:
        insidePoints (<point> <point>...);

If the outside options are specified all cells are initially selected and those
within the surface regions selected by the points are deselected.  Subsequently
the cells within the surface regions selected by the inside points are selected.
2021-09-28 14:42:47 +01:00
e5892377d8 snappyHexMesh::refinementParameters: Rationalised handling of cell region selection parameters 2021-09-27 14:25:58 +01:00
b39d6b224f snappyHexMesh: Added locationsInMesh specification
In order to select to keep the cells in multiple disconnected regions it is
necessary to specify a location in each of those regions as a list of points,
e.g.

castellatedMeshControls
{
.
.
.
    locationsInMesh
    (
        (-0.18 0.003 0.05 )
        (-0.09 0.003 0.05)
        (0.09  0.003 0.05)
        (0.18  0.003 0.05)
    );
.
.
.
}

The locationInMesh control is still available for backward compatibility and to
specify a point when meshing a single region.
2021-09-27 11:43:01 +01:00
98686ae760 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField: Corrected handling of qs 2021-09-23 22:37:05 +01:00
96a86fac56 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField: Improved the error message
when both qs and Qs are specified.
2021-09-23 22:28:38 +01:00
5fa7c72d95 tutorials::circuitBoardCooling: Updated 1DTemperatureMasterBafflePatches 2021-09-23 17:39:35 +01:00
185b718499 dimensionedType: Generalise the read function
to support re-reading with or without name or dimensions.
2021-09-23 17:20:29 +01:00
f1b862390f turbulentTemperatureCoupledBaffleMixedFvPatchScalarField: Added support for a heat source
Description
    Mixed boundary condition for temperature, to be used for heat-transfer
    on back-to-back baffles. Optional thin thermal layer resistances can be
    specified through thicknessLayers and kappaLayers entries.

    Specifies gradient and temperature such that the equations are the same
    on both sides:
      - refGradient = (qs_ + qsNbr)/kappa
      - refValue = neighbour value
      - mixFraction = nbrKDelta / (nbrKDelta + myKDelta())

    where KDelta is heat-transfer coefficient K*deltaCoeffs
    and qs is the optional source heat flux.

    The thermal conductivity \c kappa can either be retrieved from various
    possible sources, as detailed in the class temperatureCoupledBase.

Usage
    \table
        Property     | Description             | Required    | Default value
        Tnbr         | name of the field       | no          | T
        thicknessLayers | list of thicknesses per layer [m] | no |
        kappaLayers  | list of thermal conductivities per layer [W/m/K] | no |
        qs           | Optional source heat flux [W/m^2] | no | 0
        Qs           | Optional heat source [W]          | no | 0
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            compressible::turbulentTemperatureCoupledBaffleMixed;
        Tnbr            T;
        thicknessLayers (0.1 0.2 0.3 0.4);
        kappaLayers     (1 2 3 4);
        qs              uniform 100;    // Optional source heat flux [W/m^2]
        value           uniform 300;
    }
    \endverbatim

    Needs to be on underlying mapped(Wall)FvPatch.

    Note that in order to provide an optional heat source either qs or Qs
    should be specified, not both.
2021-09-23 16:10:38 +01:00
e627c7e98f thermalBaffle1DFvPatchScalarField: Changed name of source heat flux Qs -> qs for consistency
Qs is used for total heat source (W) and qs is used for heat flux (W/m^2)

Backward compatibility is provided.
2021-09-23 14:13:26 +01:00
fdb118878b solidSpecie/transport: Reverted consistency change to write
in order to support the current implementation of
thermalBaffle1DFvPatchScalarField
2021-09-23 14:11:31 +01:00
285a4502c3 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-09-22 19:25:46 +01:00
3466d8f58c tabulatedSolidTransport: New tabulated solid thermal conductivity model
Description
    Transport properties package using non-uniformly-spaced tabulated data for
    thermal conductivity vs temperature.

Usage
    \table
        Property        | Description
        kappa           | Thermal conductivity vs temperature table
    \endtable

    Example of the specification of the transport properties:
    \verbatim
    transport
    {
        kappa
        {
            values
            (
                (200 380)
                (350 400)
                (400 450)
            );
        }
    }
    \endverbatim
2021-09-22 19:23:50 +01:00
af3769dc4e foamInfo: added character classes to bracket expressions 20210922 2021-09-22 16:31:36 +01:00
1ca8ff74a9 solidThermo: Added support for run-time compilation
This required standardisation of the mapping between the class and selection
names of the solid transport models:

constIso -> constIsoSolid
exponential -> exponentialSolid
polynomial -> polynomialSolid
2021-09-22 14:39:18 +01:00
59a91e28f1 Function1, Function2: Added ';' to TypeName statements for consistency
This is not strictly necessary but it makes the code look more regular.
2021-09-22 10:04:52 +01:00
280251ca55 error::notImplemented: Added Foam scope to FatalError
so that notImplemented can be used outside the Foam namespace
2021-09-21 12:50:08 +01:00
d7133914fc regIOobject::rename: Only rename the object if the name is different avoiding the checkOut/checkIn 2021-09-20 16:23:18 +01:00