Commit Graph

2597 Commits

Author SHA1 Message Date
b49b1a2c37 functionObjects::totalEnthalpy: New functionObject to calculate, cache and write the total enthalpy
The total enthalpy is calculated as

    Ha = ha + K

where

    ha is absolute enthalpy
    K is the kinetic energy: 1/2*magSqr(U)

The total enthalpy or a particular phase can be calculated by specifying the
optional "phase" name, e.g.

    #includeFunc totalEnthalpy(phase = liquid)
2020-02-27 16:12:00 +00:00
670b158f17 functionObjects::shearStress: Updated phase support 2020-02-27 16:10:50 +00:00
7867ffce1b rhoThermos: Added missing gas instantiations 2020-02-26 13:22:14 +00:00
684191eadd adsorptionMassFractionFvPatchScalarField: Corrected header formatting 2020-02-25 11:16:13 +00:00
b559ef28ef functionObjects::moleFractions: Added phase support
Patch contributed by Timo Niemi, VTT.
Resolves patch request https://bugs.openfoam.org/view.php?id=3459
2020-02-24 17:49:50 +00:00
e01de98df0 functionObjects::volFieldValue: Added support for a list of weighting fields
This is particularly useful for multiphase simulations for which integrating the
density weighted phase properties also requires the phase fraction to be
including in the weighting.

A single weight field can be specified as before:

    weightField rho;

or a list specified by:

    weightFields (alpha.water rho.water);
2020-02-24 15:28:36 +00:00
b494e5a9c8 externalWallHeatFluxTemperature, turbulentTemperatureRadCoupledMixed, turbulentTemperatureCoupledBaffleMixed: Added phase support
External and coupled Heat transfer boundary conditions are now supported for
multiphase simulations and can be applied per-phase.
2020-02-24 12:07:37 +00:00
c57ffd2d07 functionObjects: Added shearStress
This function will output the volumetric shear stress as a symmetric
tensor field
2020-02-19 17:06:28 +00:00
f85edb01fe face, primitiveMesh: Corrected face-centre calculations
Face centres are calculated by area-weighting the centres of triangles
that are formed by connecting each edge to a common point. The common
point is taken to be the average of all the face vertices, though in
principle the choice is arbitrary.

The areas used to perform the weighting are now taken to be the
projected areas of the triangles in the direction of the face normal
(i.e., the dot product between the triangle area and the face normal).
Previously the triangle area-magnitudes were used.

The new approach results in a centre that for flat faces is independent
of the choice of common point. It also means that concave faces have
contributions to the weighted sum from reversed triangles correctly
subtracted from the total. The centre of warped faces still changes with
the choice of common point, but that variation is now reduced to be
only in the direction of the face normal.

Preliminary results suggest a positive effect of this change on the
convergence of simulations on meshes with significantly distorted faces
and cells. The simpleFoam motorBike tutorial now converges with
residuals approximately half that previously observed.

Resolves bug report https://bugs.openfoam.org/view.php?id=1993
2020-02-19 15:44:35 +00:00
7010a8ec24 cyclicTransform: Improved automatic calculation of rotational transforms
Rotational transforms can now be automatically calculated from the
coupled patch geometries even when a) the patches are non-planar, b)
the patch normals are not perpendicular to the rotation axis, and/or c)
the rotation angle is 180 degrees.
2020-02-18 08:38:39 +00:00
fe13ba9fac functionObjects::forces: Corrected coordinate system example in header
Resolves bug-report https://bugs.openfoam.org/view.php?id=3455
2020-02-17 09:53:31 +00:00
4deaba90f7 cylinderAnnulusToFace, cylinderToFace: Corrected setType
Resolves bug-report https://bugs.openfoam.org/view.php?id=3453
2020-02-14 17:06:22 +00:00
2d3b02c130 primitiveMeshGeometry, polyMeshGeometry: Removed unused code
The utilised static parts of polyMeshGeometry are now part of a
polyMeshCheck namespace. Everything else has been removed, as they were
unused, out of date, and/or duplicated elsewhere.
2020-02-13 14:33:18 +00:00
ba52c4047c transformer: Removed &= operator
This operator was defined with an incorrect (or at least
counter-intuitive) ordering. Given the possibility for ambiguity
associated with transformation ordering it is considered preferable for
the transformer class not to have compound assigment operators. Forcing
the full syntax (e.g., "a = a & b" or "a = b & a") makes it clear in
which order the transformations are intended to be applied.
2020-02-11 12:01:29 +00:00
a283130301 coupledPolyPatch: Removed unecessary calcGeometry overload 2020-02-11 09:23:44 +00:00
ba8e1ecd2d cyclicPolyPatch: Optionally deduce ordering transformation from temporary primativePatch
Resolves bug report https://bugs.openfoam.org/view.php?id=3447
2020-02-11 09:22:12 +00:00
e659b2e7ab PrimitivePatch: Added faceAreas method 2020-02-11 08:32:23 +00:00
3d70311c21 filmViscosityModel::thixotropicViscosity: Added optional Bingham plastic yield stress support
There is now an optional tauy entry in the thixotropicCoeffs to specify the
Bingham yield stress.
2020-02-10 08:57:00 +00:00
ab9b5eae92 Revert "filmViscosityModel::thixotropicViscosity: Added optional Bingham plastic yield stress support"
This reverts commit fc5d0c7dee.
2020-02-10 08:55:52 +00:00
972af235a0 List: Corrected construction from SLList
Resolves bug-report https://bugs.openfoam.org/view.php?id=3448
2020-02-09 12:05:42 +00:00
d8cf7788eb CodedBase: Changed construction of static words to avoid construction order problems with Clang 2020-02-07 22:09:09 +00:00
04a3f9f237 CodedFunction1: Moved the static data member definitions to makeFunction1s.C 2020-02-07 15:42:13 +00:00
fc5d0c7dee filmViscosityModel::thixotropicViscosity: Added optional Bingham plastic yield stress support
There is now an optional tauy entry in the thixotropicCoeffs to specify the
Bingham yield stress, e.g.:

    filmViscosityModel thixotropic;
    thixotropicCoeffs
    {
        mu0             100;
        muInf           0.1;
        a               0.1;
        b               3;
        c               0.005;
        d               0.9;
        tauy            1.1;   // Yield stress in Pa
    }
2020-02-07 15:14:52 +00:00
a728a69c59 codedMixedFvPatchField, codedFixedValuePointPatchField: Updated and simplified using the new CodedBase class
reducing code duplication and maintenance overhead.
2020-02-07 00:05:27 +00:00
6a2ecb4d04 nutkAtmRoughWallFunction: Updated calcNut -> nut
Resolves bug-report https://bugs.openfoam.org/view.php?id=3443
2020-02-06 21:40:20 +00:00
4cbb849eda codedFixedValueFvPatchField: Updated and simplified using the new CodedBase class
reducing code duplication and maintenance overhead.
2020-02-06 16:04:21 +00:00
cdf95fa6ef reactingEulerFoam::phaseSystems: Ensure the sum of phase fractions of the moving phases has calculated BCs 2020-02-06 14:38:46 +00:00
082a3c3ff3 General maintenance: Replaced convertToRad with degToRad 2020-02-05 17:30:39 +00:00
d728b23427 codedFunctionObject: Updated and simplified using the new CodedBase 2020-02-03 21:44:44 +00:00
7a717a6929 reactingEulerFoam/phaseCompressibleTurbulenceModels: New turbulence library for both two and multiphase reactingEulerFoam solvers
combining the multiphaseCompressibleTurbulenceModels and derivedFvPatchFields
libraries with the generic multiphase turbulence models from the
twoPhaseCompressibleTurbulenceModels library, kineticTheoryModels and
phasePressureModel into a single common library compiled and linked into both
reactingTwoPhaseEulerFoam and reactingMultiphaseEulerFoam.
2020-02-03 18:33:11 +00:00
963392e86c CodedBase: New template wrapper to provide most of the members needed by codedBase
This significantly simplifies the creation and maintenance of coded classes and
used in CodedFunction1 to provide an example of its use; the other coded classes
will be refactored and simplified in this manner in the future.
2020-02-02 18:17:31 +00:00
617695fef4 CodedFunction1: Resolved problem with operator order in the description string construction 2020-02-01 17:50:01 +00:00
dbdc119309 CodedFunction1: Updated documentation 2020-02-01 17:00:35 +00:00
0dd2e97bd8 CodedFunction1: New Function1 which uses codeStream to dynamically compile the value function code
For example in the new tutorial case:
tutorials/incompressible/pimpleFoam/laminar/pitzDailyPulse
a cosine bell velocity pulse is specified at the inlet by directly defining the
code for it:

    inlet
    {
        type            uniformFixedValue;
        uniformValue    coded;

        name            pulse;

        codeInclude
        #{
            #include "mathematicalConstants.H"
        #};

        code
        #{
            return vector
            (
                0.5*(1 - cos(constant::mathematical::twoPi*min(x/0.3, 1))),
                0,
                0
            );
        #};
    }

which is then compiled automatically and linked into the running pimpleFoam
dynamically and executed to set the inlet velocity.
2020-01-31 23:39:59 +00:00
aff00a2e7e dlLibraryTable: Simplified and rationalised the handling of dynamic library loading
Rather than being tied to the Time class the dlLibraryTable libs is now a global
variable in the Foam namespace which is accessable by any class needing to load
dynamic libraries, in particular argList, Time and codeStream.
2020-01-31 08:18:10 +00:00
6dc3b30017 functionObjects::randomise: Resolved problem with construction order 2020-01-29 19:22:39 +00:00
1dc0b8fc88 sampledSurface::foamSurfaceWriter: Added support for writing sampled surfaces in binary OpenFOAM format 2020-01-29 17:37:00 +00:00
acdbf45534 Moved OBJstream into src/fileFormats/obj 2020-01-29 17:17:36 +00:00
b55bc28698 sampledSurface::writers: Added writeFormat option to select ascii or binary
e.g. in tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/cuttingPlane

    surfaceFormat   vtk;
    writeFormat     binary;
    fields          (p U);

selects writing the VTK surface files in binary format which significantly
speeds-up reading of the files in paraview.

Currently binary writing is supported in VTK and EnSight formats.
2020-01-29 14:59:31 +00:00
ccc8a78ec1 lagrangian/.../*LookupTableInjection: Use GlobalIOList
Resolves bug report https://bugs.openfoam.org/view.php?id=3438
2020-01-29 14:29:27 +00:00
50fab006c6 sampledSurface/writers: Resolved write function calling itself 2020-01-29 12:46:20 +00:00
84759ee0b8 sampledSurface: Added support for writing surfaces in binary format
by specifying

    writeFormat binary;

in the sampledSurface dictionary.
2020-01-29 12:42:05 +00:00
3631f13a98 sampledSurface/writers: Removed unnecessary "verbose" argument 2020-01-28 22:46:00 +00:00
ac22da9499 sampledSurface/writers: Rationally renamed writeTemplate -> write 2020-01-28 20:24:22 +00:00
622f472283 vtkSurfaceWriter: Rationalised writing to use vtkWriteOps
avoiding code duplication and providing support for writing binary.
2020-01-28 17:33:29 +00:00
9ff1e2e168 foamToVTK: Rationalised the low-level write function to avoid 3x duplication
Moved the writeFuns into the vtkWriteOps namespace which is extensible, see the
the write functions in setSet as an example of this.
2020-01-28 16:12:57 +00:00
a296733a76 hashedWordList: Removed the "contains" member function
the same functionality is provided by the standard HashTable "found" function.
2020-01-28 16:09:03 +00:00
6e32ca010a globalIndexAndTransform: Correction to handle rotation around a non-zero centre 2020-01-27 17:06:39 +00:00
55b982eeea transformer: Generalised to permit scaling and improved abstraction
Transformer now supports scaling matrices. The number of ways in which
transformer can be constructed has also been reduced to null (i.e.,
identity), pure translation, pure scaling and pure rotation. Compound
translations must be constructed by combining transformers with the
dot-product (&) operator. In this way, the details of in what order the
different parts of the transformation are applied have been abstracted.
2020-01-27 16:35:52 +00:00
f4e47fccbc Corrected typos in comments
Patch contributed by Timo Niemi, VTT.
Resolves patch request https://bugs.openfoam.org/view.php?id=3437
2020-01-26 13:40:14 +00:00