Commit Graph

6426 Commits

Author SHA1 Message Date
06217ffce0 MPPIC: IsotropyModel: Prevent null pointer access on copy construct 2022-12-13 16:05:04 +00:00
d122c32cd8 foamyHexMesh: Compile against CGAL-5.5 2022-12-13 15:04:16 +00:00
118f77e6a5 functionObjects: stopAtEmptyClouds: New function to end the run when clouds are empty
This function stops the run when all parcel clouds are empty.

Example of function object specification:

    stop
    {
        type            stopAtEmptyClouds;
        libs            ("liblagrangianFunctionObjects.so");

        executeControl  timeStep; // <-- Likely only to be needed if injection
        startTime       0.500001; // starts after time zero. In which case the
                                  // startTime should be slightly after the
                                  // injection start time.

        action          nextWrite;
    }

A packaged function object is also included, which permits the following
syntax to be used, either with #includeFunc in the system/controlDict,
or with the -func option to foamPostProcess:

   stopAtEmptyClouds(startTime=0.500001)
2022-12-13 15:04:16 +00:00
ee1a12015d tutorials: particleFoam/mixerVessel2D: Corrected injection locations 2022-12-13 15:04:16 +00:00
32834b8582 tutorials: injectionChannel: Added flux monitoring 2022-12-13 15:04:16 +00:00
ca0003fe35 MPPICCloud: Predictor corrector scheme
This change replaces the MPPIC cloud's approximate correcton tracks with
a formal predictor-corrector scheme. This reduces the parcels' memory
usage and prevents ad-hoc corrections to tracking time and associated
parcel properties.
2022-12-13 15:03:30 +00:00
06e29c44ab Lagrangian: Removed sub-cycling and improved injection behaviour
Support for mesh sub-cycling has been removed from Lagrangian. Various
Lagrangian processes already support sub-dividing the time-step. It is
easier and more efficient to extend that support all the way to the
high-level cloud objects, rather than to sub-cycle the mesh.

This has additional benefits. The cloud now no longer needs to reset the
step fraction at the start of every sub-motion. Injection can take
advantage of this by modifying particles' step fractions in order to
distribute them uniformly through the time-step. This is a simple and
efficient method. Previously, injection would track the particles some
distance after injection. This was more expensive to do, it resulted in
spatial artefacts in the injected Lagrangian field, and it did not
correctly handle interactions with patches or parallel transfers.

The lack of injection tracking also means that particles injected
through patches now start their simulation topologically connected to
the face on which they are created. This means that they correctly
trigger cloud functions associated with that face and/or patch.

The injection models now also return barycentric coordinates directly,
rather than the global position of injected particles. For methods that
initially generate locations naturally in terms of barycentric
coordinates, this prevents unnecessary and potentially fragile
conversion from barycentric to Cartesian and back again. These are
typically the methods that "fill" some sort of space; e.g., patch or
cell-zone injections.
2022-12-13 14:32:24 +00:00
d020df456c engineCompRatio: Corrected typo
Resolves bug-report https://bugs.openfoam.org/view.php?id=3942
2022-12-12 18:52:05 +00:00
a8eca31755 fvMeshTopoChangersMeshToMesh: Added support for mapping VolField<Type>::Internal 2022-12-12 18:49:25 +00:00
7822dbe467 solvers::multicomponentFluid: Corrected typo 2022-12-11 22:51:43 +00:00
1f728f4a4c chemistryModel: Use thermodynamic rather than continuity density
At the beginning of a time-step the predicted continuity density may not be
close to the thermodynamic density causing problems with the first chemistry
evaluation.  However the old-time thermodynamic and continuity densities are the
same for most solvers and so the old-time continuity density can be used.
2022-12-11 22:48:43 +00:00
a94eeaa576 MeshObject: separated meshObject into typeMeshObject and the meshObjects namespace
in preparation for generalising to multiple objects of the same type.
20221212
2022-12-09 16:13:06 +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
e113f66cf6 CloudFunctionObjects: Flux: Corrected flux definition 2022-12-08 15:37:41 +00:00
7efb6cc849 Removed deprecated calls to std::random_shuffle 2022-12-08 10:32:03 +00:00
364e402b5b Resolve warning messages generated by Clang-14 2022-12-08 08:35:47 +00:00
3d41f85a1c codeStream: Prevent unnecessary info and debug messaging 2022-12-07 16:21:48 +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
c397554043 thermophysicalTransportModel: Reinstated missing function 2022-12-07 13:17:39 +00:00
a733a2f6c4 compressibleInterPhaseThermophysicalTransportModel: Added q() function for post-processing tools 2022-12-07 12:29:21 +00:00
66193bd9c2 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2022-12-07 11:58:52 +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
456b7e31ee vtkPVFoamVolFields, semiImplicitSource: Use VolInternalField<Type> to simplify code 2022-12-07 11:55:53 +00:00
8208ca6cc7 functionObjects: Added patchCutLayerAverage
This function object writes graphs of patch face values, area-averaged in
planes perpendicular to a given direction. It adaptively grades the
distribution of graph points to match the resolution of the mesh.

Example of function object specification:

    patchCutLayerAverage1
    {
        type            patchCutLayerAverage;
        libs            ("libpatchCutLayerAverageFunctionObject.so");

        writeControl    writeTime;
        writeInterval   1;

        patch           lowerWall;
        direction       (1 0 0);
        nPoints         100;
        interpolate     no;

        fields          (p U);

        axis            x;
        setFormat       raw;
    }

A packaged function object is also included, which permits the following
syntax to be used, either with #includeFunc in the system/controlDict,
or with the -func option to foamPostProcess:

    graphPatchCutLayerAverage
    (
        funcName=aerofoilLowerPressure,
        patch=aerofoilLower,
        direction=(0.15 -0.016 0),
        nPoints=100,
        p
    )
2022-12-06 13:00:56 +00:00
2b9cfc1902 cutPoly: Fixed typo 2022-12-06 08:38:04 +00:00
818eed7a3d rigidBodyState, sixDoFRigidBodyState: Change angleFormat -> angleUnits with backwards-compatibility
angleUnits is a more logical name for the user-input as it specifies the units
of the angles written rather than the format of the numbers.  The previous name
angleFormat is supported for backwards-compatibility

Class
    Foam::functionObjects::rigidBodyState

Description
    Writes the rigid body motion state.

Usage
    \table
        Property     | Description                  | Required | Default value
        type         | type name: rigidBodyState    | yes      |
        angleUnits   | degrees or radians           | no       | radians
    \endtable

    Example of function object specification:
    \verbatim
    rigidBodyState
    {
        type           rigidBodyState;
        libs           ("librigidBodyState.so");
        angleUnits     degrees;
    }
    \endverbatim

Class
    Foam::functionObjects::sixDoFRigidBodyState

Description
    Writes the 6-DoF motion state.

    Example of function object specification:
    \verbatim
    sixDoFRigidBodyState
    {
        type           sixDoFRigidBodyState;
        libs           ("libsixDoFRigidBodyState.so");
        angleUnits     degrees;
    }
    \endverbatim

Usage
    \table
        Property     | Description                  | Required | Default value
        type         | type name: sixDoFRigidBodyState    | yes |
        angleUnits  | degrees or radians           | no       | radian
    \endtable
2022-12-05 19:57:12 +00:00
02c7257eb0 ZoltanDecomp: Check for no points on any processor during redistribution and throw a fatal error
Zoltan hangs if a processor has no points/cells during redistribution and
unfortunatel Zoltan can generate distributions in which one or processors has no
cells.
2022-12-05 19:54:39 +00:00
a140f7d653 indexedOctree::findNode: Return -i if the nodes are empty
Avoids unexpected segmentation fault during redistribution if a processor has no
cells.
2022-12-05 19:53:10 +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
df1fd09f63 Further code simplification: GeometricField<GType, fvsPatchField, surfaceMesh> -> SurfaceField<GType> 2022-12-03 13:51:48 +00:00
ba995e18fa Further code simplification: Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> -> VolField<Type>
and Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> -> SurfaceField<Type
2022-12-03 13:24:46 +00:00
966f015082 Further code simplification: Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> -> VolField<Type> 2022-12-02 22:31:21 +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
e84300d124 Code simplification: GeometricField<Type, pointPatchField, pointMesh> -> PointField<Type>
Using the PointField<Type> partial specialisation of GeometricField<Type,
pointPatchField, pointMesh> simplified the code and improves readability.
2022-12-02 15:24:50 +00:00
5f7993dab4 Replaced inconsistently named local typedefs with VolField, SurfaceField and PointField
making the code more consistent and readable.
2022-12-02 10:54:21 +00:00
73c5624acf functionObjects/field: Simplified code using the VolField and SurfaceField partial specialisations
replacing the inconsistently named local typedefs and direct use of the more
complex GeometricField template types.
2022-12-01 22:01:54 +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
e77a170b82 constSolidThermo: Updated to use VolField template partial specification 2022-12-01 09:53:56 +00:00
3e8b97fef6 functionObjects: fieldAverage: Corrected initialisation behaviour
The fieldAverage can now average fields that do not exist at
construction time, and it also supports restart on cases in which
the mesh topology is changing.
2022-12-01 09:28:19 +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
262672ec10 tutorials/combustion/XiFoam/RAS/moriyoshiHomogeneous: Created a sub-directory for the case and run scripts 2022-11-30 11:49:33 +00:00
7286789b40 functionObjects::fieldAverage: Corrected restart when running with user-time 2022-11-30 11:46:34 +00:00
8d1374b9b1 Time: Changed the "name" of beginTime, startTime and endTime to the user-time name of the corresponding time 2022-11-30 11:44:30 +00:00
a7c63e2a30 Time::timeName(): No longer necessary to be virtual
The user-times are no longer derived from Time but run-time plug-ins so Time
functions do not need to be virtual for this purpose.
2022-11-29 18:11:44 +00:00
303c016704 functionObjects::timeActivatedFileUpdate: Changed file read time specification to user-time
Also changed the keyword timeVsFile to the more logical fileVsTime with
backward-compatibility.

Class
    Foam::functionObjects::timeActivatedFileUpdate

Description
    Performs a file copy/replacement once a specified time has been reached.

Usage
    Example usage to update the fvSolution dictionary at 0.1, 0.2 and 0.3s
    during the run:
    \verbatim
    fileUpdate1
    {
        type            timeActivatedFileUpdate;

        libs            ("libutilityFunctionObjects.so");

        writeControl    timeStep;
        writeInterval   1;
        fileToUpdate    "$FOAM_CASE/system/fvSolution";
        fileVsTime
        (
            (-1 "$FOAM_CASE/system/fvSolution.0")
            (0.10 "$FOAM_CASE/system/fvSolution.10")
            (0.20 "$FOAM_CASE/system/fvSolution.20")
            (0.35 "$FOAM_CASE/system/fvSolution.35")
        );
    }
    \endverbatim

Resolves bug-report https://bugs.openfoam.org/view.php?id=3938
2022-11-29 14:33:31 +00:00
c0ce311444 Renamed constAnIsoSolidTransport -> constAnisoSolidTransport for consistency with standard OpenFOAM naming convention
and the new constAnisoSolidThermo class.
2022-11-28 17:53:24 +00:00