Commit Graph

2325 Commits

Author SHA1 Message Date
d82cc36c5a OpenFOAM: Added support for extended precision scalar
OpenFOAM can now be compiled with single, double or long double scalars by
setting the WM_PRECISION_OPTION environment variable to either SP, DP or LP
respectively.

On most 64bit systems long double is stored as 128bit but computed in the
floating point hardware to 80bit.  Due to the increased storage compared to
double precision cache and memory access is significantly more time consuming
causing a slow-down of floating point intensive operations by a factor of 2 to
3.
2018-01-29 15:03:13 +00:00
22bfee0e77 Time: Fix logical error in re-evaluation of running state
Fix for a problem introduced by 9a35ce69. See also commit 9ed84852.
2018-01-29 08:48:06 +00:00
883687dd27 doubleScalar: Adjusted vGreat to avoid overflow in some mesh generation operations
This is a temporary work-around while the algorithms are updated to use the
standard numeric_limits<double>::max() value for vGreat.
2018-01-28 10:27:47 +00:00
9ed84852a7 Time: Fix logical error in re-evaluation of running state
An unintended change in the running-state logic was introduced by commit
9a35ce69. The running state should only be re-evaluated when in the
simulation is not ending. The "execute/end" function object invocation
should not be permitted to change the running state. The simulation
should always end if this state is reached.
2018-01-26 16:36:05 +00:00
a4ca234215 StandardChemistryModel::calculateRR: Added specie stoichiometric coefficients to individual specie reaction rates
Used by specieReactionRates functionObject
2018-01-25 21:24:39 +00:00
fc2b2d0c05 OpenFOAM: Rationalized the naming of scalar limits
In early versions of OpenFOAM the scalar limits were simple macro replacements and the
names were capitalized to indicate this.  The scalar limits are now static
constants which is a huge improvement on the use of macros and for consistency
the names have been changed to camel-case to indicate this and improve
readability of the code:

    GREAT -> great
    ROOTGREAT -> rootGreat
    VGREAT -> vGreat
    ROOTVGREAT -> rootVGreat
    SMALL -> small
    ROOTSMALL -> rootSmall
    VSMALL -> vSmall
    ROOTVSMALL -> rootVSmall

The original capitalized are still currently supported but their use is
deprecated.
2018-01-25 09:46:37 +00:00
6e143e5ab0 reactingEulerFoam: Added wall-boiling and phase change capability to populationBalance functionality
Introduced thermalPhaseChangePopulationBalanceTwo- and MultiphaseSystem as
user-selectable phaseSystems which are the first to actually use multiple mass
transfer mechanisms enabled by

commit d3a237f560.

The functionality is demonstrated using the reactingTwoPhaseEulerFoam
wallBoilingPolydisperse tutorial.

Patch contributed by VTT Technical Research Centre of Finland Ltd and Institute
of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR).
2018-01-24 14:57:14 +00:00
c902c7a396 OpenFOAM: Replaced hard-coded scalar limits with C++11 numeric_limits
This change simplifies maintenance and improved portability
2018-01-24 14:43:32 +00:00
0222535462 label: Added error.H for FULLDEBUG
Resolves bug-report https://bugs.openfoam.org/view.php?id=2816
2018-01-24 14:40:28 +00:00
d008fe4468 timeFunctionObject: New functionObject which writes run, CPU and clock time
and optionally the CPU and clock times per time step.

Example of function object specification:
time
{
    type            time;

    libs            ("libutilityFunctionObjects.so");

    writeControl    timeStep;
    writeInterval   1;

    perTimeStep     no;
}

Adding

    #includeFunc time

to the functions list in the controlDict of the motorBike tutorial generates

0               1.190000e+00    1
1               1.640000e+00    1
2               1.940000e+00    2

Enabling the optional writing of the CPU and clock time per time step is
straight forward:

    #includeFunc time(perTimeStep=yes)
2018-01-23 10:10:10 +00:00
16d9dd6183 label: corrected debug logic for factorial
Resolves bug-report https://bugs.openfoam.org/view.php?id=2814
2018-01-22 22:31:29 +00:00
907bb58e9f jobInfo: Write jobInfo files into the case/jobInfo directory
With the writeJobInfo option in OpenFOAM-dev/etc/controlDict::InfoSwitches set
to 1 each OpenFOAM executable writes a <executable>.<pid> file containing the
job summary into the <case>/jobInfo directory, e.g. after running the
tutorials/incompressible/pisoFoam/RAS/cavity tutorials

tutorials/incompressible/pisoFoam/RAS/cavity/jobInfo contains
blockMesh.20169  pisoFoam.20170
2018-01-21 12:22:30 +00:00
0309a2c7cf jobInfo: changed writeJobInfo control to write the jobInfo.<pid> file in the case directory
When etc/controlDict::writeJobInfo is set to 1 jobInfo.<pid> files are written
to the case directory containing a summary of the execution of the job containing

startDate
startTime
userName
foamVersion
code
argList
currentDir
PPID
PGID
foamBuild
root
case
nProcs

When the job completes the following additional entries are written:

cpuTime
endDate
endTime
termination

The original etc/controlDict::writeJobInfo control has been renamed writeJobControl and when set
to 1 writes the ~/OpenFOAM/jobControl/runningJobs and finishedJobs files for job control.
2018-01-19 20:09:32 +00:00
4ebf84e6dd fvOptions: verticalDamping: Allow multiple directions of ramping
The ramp function used to graduate the vertical damping force can now be
applied along a number of paths, rather than just one. The keywords
"origins" and "directions" can be used to define a list of paths.

    verticalDamping1
    {
        type            verticalDamping;

        origins         ((1200 0 0) (1200 100 0) (1200 -100 0));
        directions      ((1 0 0) (0 1 0) (0 -1 0));

        // ...
    }

The ramping function will be calculated along each of the paths defined
by the origin-direction pair, and the maximum of the calculated values
will be used.

The "origin" and "direction" keywords can still be used with non-list
values.

This work was supported by Jan Kaufmann and Jan Oberhagemann at DNV GL.
2018-01-15 10:10:40 +00:00
3e761d6a41 foamyHexMesh: Added cell sizing based on local surface closeness
First run the surfaceFeatureExtract with the "closeness" option enabled in the
surfaceFeatureExtractDict to extract the surface closeness point field

    // Out put the closeness of surface elements to other surface elements.
    closeness               yes;

Then enable cell sizing based on local surface closeness by specifying the
"internalCloseness" options in the foamyHexMeshDict e.g.

motionControl
{
    defaultCellSize             4;

    minimumCellSizeCoeff        0.1;
    maxSmoothingIterations      100;
    maxRefinementIterations     2;

    shapeControlFunctions
    {
        geometry
        {
            type                        searchableSurfaceControl;
            priority                    1;
            mode                        inside;

            surfaceCellSizeFunction     nonUniformField;

            cellSizeCalculationType     automatic;

            curvature                   false;
            curvatureFile               dummy;
            featureProximity            false;
            featureProximityFile        dummy;
            internalCloseness           true;
            internalClosenessFile       geometry.internalPointCloseness;
            internalClosenessCellSizeCoeff 25;
            curvatureCellSizeCoeff      0;
            maximumCellSizeCoeff        1;
            cellSizeFunction            uniform;
        }
    }
}
2018-01-14 12:05:38 +00:00
a5a034a1d2 functionObjectList::findDict: Added support for region-specific functionObject specification
e.g.

postProcess -func sample -region bottomWater

will now search for the system/bottomWater/sample dictionary before searching
for system/sample so that the fields and type of sampling can optionally be
specified differently for the particular region.

Resolves feature request https://bugs.openfoam.org/view.php?id=2807
2018-01-11 12:19:13 +00:00
ed87738735 CrankNicolsonDdtScheme: Syntax fix for Clang 5.0.1 2018-01-11 09:53:19 +00:00
a44e95d119 ParticleFunctionObjects: Added PatchCollisionDensity object
This function object will write a paraview-viewable field showing the
area-density of parcel collisions on every patch face. It also outputs
the rate of collisions hitting each patch face, calculated over an
interval equal to the time elapsed since the last output. It has an
optional entry to specify a minimum incident speed below which a
collision is not counted.

It can be enabled in the cloud properties file as follows:

    cloudFunctions
    {
        patchCollisionDensity1
        {
            type        patchCollisionDensity;
            minSpeed    1e-3; // (optional)
        }
    }

This work was supported by Anton Kidess, at Hilti
2018-01-11 09:18:50 +00:00
352c6bf62f CloudFunctionObjects: ParticleTrap: Corrected example usage
Resolves bug report https://bugs.openfoam.org/view.php?id=2805
2018-01-11 08:52:21 +00:00
d2175f8fe0 fvOptions: verticalDamping: Added spatial ramping
The onset of vertical damping can now be graduated over a distance. The
user specifies an origin and a direction along which the graduation
occurs, and a ramping function to specify the form of the graduation. An
example specification for the fvOption is:

    verticalDamping1
    {
        type            verticalDamping;

        selectionMode   all;

        origin          (1200 0 0);
        direction       (1 0 0);
        ramp
        {
            type        halfCosineRamp;
            start       0;
            duration    600;
        }

        lambda          [0 0 -1 0 0 0 0] 1; // Damping coefficient

        timeStart       0;
        duration        1e6;
    }

If the origin, direction or ramp entries are omitted then the fvOption
functions as before; applying the damping to the entire volume or the
specified cell set.

This work was supported by Jan Kaufmann and Jan Oberhagemann at DNV GL.
2018-01-09 08:47:37 +00:00
139523c17e Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-01-08 21:39:44 +00:00
da787200a6 ddtScheme::fvcDdtPhiCoeff: Improved formulation providing better stability/accuracy balance
Resolves problem with pressure "staggering" when running with a very Courant
number.
2018-01-08 21:35:00 +00:00
a80da1a489 Added ramping functionality for multiphase simulations
The outletPhaseMeanVelocity and waveVelocity boundary conditions now
support a "ramp" keyword, for which a function can be supplied to
gradually increase the input velocity. The following is an example
specification for an outlet patch:

    outlet
    {
        type            outletPhaseMeanVelocity;
        Umean           2;
        ramp
        {
            type            quarterSineRamp;
            start           0;
            duration        5;
        }
        alpha           alpha.water;
    }

There is also a new velocityRamping function object, which provides a
matching force within the volume of the domain, so that the entire flow
is smoothly accelerated up to the operating condition. An example
specification is as follows:

    velocityRamping
    {
        type        velocityRamping;
        active      on;
        selectionMode all;
        U           U;
        velocity    (-2 0 0);
        ramp
        {
            type        quarterSineRamp;
            start       0;
            duration    5;
        }
    }

These additions have been designed to facilitate a smoother startup of
ship simulations by avoiding the slamming transients associated with
initialising a uniform velocity field.

This work was supported by Jan Kaufmann and Jan Oberhagemann at DNV GL.
2018-01-08 09:20:28 +00:00
9a35ce69a3 Time: Added running method to check running state without side effects
chtMultiRegionSimpleFoam needs to check whether or not the simulation is
at the end. To facilitate this, a Time::running method has been added.
The Time::run method was being used for this purpose, but this lead to
function objects being executed multiple times.

This resolves bug report https://bugs.openfoam.org/view.php?id=2804
2018-01-08 09:20:28 +00:00
8b44230384 MRF tutorials: Change rotor velocity boundary condition to fixedValue
Using the noSlip boundary condition for rotating wall in an MRF region
interferes with post-processing by resetting the wall velocity to 0 rather than
preserving the value set by the MRF zone.
2018-01-05 15:13:46 +00:00
1273b9fbf6 writeFile: Increased the number of value characters
The number of characters needed to print a double in scientific format
is 8 plus the number of decimal places; e.g., -6.453452e-231 (6 decimal
places, 14 characters). This has been set in writeFile.C, replacing a
value of 7. Presumably, the case of three digits in the exponent was not
considered when this was first implemented. This change ensures at least
one character of whitespace between tabulated numbers.

This resolves bug report https://bugs.openfoam.org/view.php?id=2801
2018-01-04 08:33:46 +00:00
dfd09a8864 solutionControl: Rationalized, simplified and registered to the database 2018-01-03 17:04:21 +00:00
d3a237f560 reactingEulerFoam: Multiphase thermal phase change and support for multiple mass transfer mechanisms
- Thermal phase change and wall boiling functionality has been generalized to
  support two- and multi- phase simulations.
- Thermal phase change now also allows purePhaseModel, which simplifies case setup.
- The phaseSystem templates have been restructured in preparation of multiple
  simultaneous mass transfer mechanisms. For example, combination of thermal phase
  and inhomogeneous population balance models.

Patch contributed by VTT Technical Research Centre of Finland Ltd and Institute
of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR).
2017-12-31 19:50:22 +00:00
ae1f7a23ec vanDriestDelta: Corrected description
Resolves bug-report https://bugs.openfoam.org/view.php?id=2794
2017-12-21 16:17:36 +00:00
853406b8ec wallHeatTransferCoeff: Corrected dimensions of the wallHeatTransferCoeff field 2017-12-19 23:34:42 +00:00
21c26d7eee sampledSets: Corrected curve distance list ordering in parallel
Resolves bug-report https://bugs.openfoam.org/view.php?id=2792
2017-12-18 16:16:44 +00:00
cb7e1b9035 thermo: Macro renaming
Thermo and reaction thermo macros have been renamed and refactored. If
the name is plural (make???Thermos) then it adds the model to all
selection tables. If not (make???Thermo) then it only adds to the
requested psi or rho table.
2017-12-18 08:39:28 +00:00
233d8dea12 reactionThermo: Select singleComponentMixture as pureMixture
A pureMixture can now be specified in a reacting solver. This further
enhances compatibility between non-reacting and reacting solvers.

To achieve this, mixtures now have a typeName function of the same form
as the lower thermodyanmic models. In addition, to avoid name clashes,
the reacting thermo make macros have been split into those that create
entries on multiple selection tables, and those that just add to the
reaction thermo table.
2017-12-18 08:39:28 +00:00
94d05421d3 reactionThermo: Instantiated more single component mixtures 2017-12-18 08:28:59 +00:00
4df95ff418 combustionModels: Default to the "none" model
When the constant/combustionProperties dictionary is missing, the solver
will now default to the "none" model. This is consistent with how
radiation models are selected.
2017-12-18 08:28:59 +00:00
476cbcaac8 reactionThermo: Single component mixture
This mixture allows a reacting solver to be used with a single component
fluid without the additional case files usually required for reacting
thermodynamics.
2017-12-18 08:28:59 +00:00
ea51d79c0d basicSpecieThermo: Updated solver references to mixture class 2017-12-18 08:28:59 +00:00
1206066f40 reactionThermo: Corrected argument names in make macros 2017-12-18 08:28:59 +00:00
5ea87082f1 ODESolver: maxSteps now an optional input
e.g.

odeCoeffs
{
    solver          seulex;
    absTol          1e-12;
    relTol          0.0001;
    maxSteps        1e+06;
}

maxSteps defaults to 10000 for backward compatibility.
2017-12-15 15:26:47 +00:00
10e75bf28a rigidBodyModelState: Added time value member
The absolute value of the the time has been added to the rigid body
model state. This value is not directly necessary for calculating the
evolution of the rigid body system, it just facilitates the
implementation of sub-models which are in some way time-dependent.
2017-12-13 12:06:53 +00:00
68afe78b9b combustionModel: Namespace changes
Wrapped combustion model make macros in the Foam namespace and removed
combustion model namespace from the base classes. This fixes a namespace
specialisation bug in gcc 4.8. It is also somewhat less verbose in the
solvers.

This resolves bug report https://bugs.openfoam.org/view.php?id=2787
2017-12-12 10:29:40 +00:00
61cab84fa6 combustionModel, chemistryModel: Simplified model selection
The combustion and chemistry model selection has been simplified so
that the user does not have to specify the form of the thermodynamics.

Examples of new combustion and chemistry entries are as follows:

    In constant/combustionProperties:

        combustionModel PaSR;

        combustionModel FSD;

    In constant/chemistryProperties:

        chemistryType
        {
            solver          ode;
            method          TDAC;
        }

All the angle bracket parts of the model names (e.g.,
<psiThermoCombustion,gasHThermoPhysics>) have been removed as well as
the chemistryThermo entry.

The changes are mostly backward compatible. Only support for the
angle bracket form of chemistry solver names has been removed. Warnings
will print if some of the old entries are used, as the parts relating to
thermodynamics are now ignored.
2017-12-11 14:49:21 +00:00
dfd7d0b5b4 OSspecific/POSIX: Updated function name in diagnostic messages
Patch contributed by Bruno Santos
Resolves bug-report https://bugs.openfoam.org/view.php?id=2786
2017-12-10 11:08:29 +00:00
862fa9e106 compressibleInterFoam family: Corrected transonic option
Resolves bug-report https://bugs.openfoam.org/view.php?id=2785
2017-12-09 21:03:59 +00:00
de77f4e1f4 collatedFileOperation: Corrected thread support test 2017-12-07 23:50:12 +00:00
f823c91500 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2017-12-06 16:14:07 +00:00
99841e29b7 wallHeatTransferCoeff: New functionObject to calculate the wall heat transfer coefficient
for incompressible flow simulated using simpleFoam, pimpleFoam or pisoFoam.

Description
    Calculates and write the estimated incompressible flow heat transfer
    coefficient at wall patches as the volScalarField field
    'wallHeatTransferCoeff'.

    All wall patches are included by default; to restrict the calculation to
    certain patches, use the optional 'patches' entry.

    Example of function object specification:
    wallHeatTransferCoeff1
    {
        type        wallHeatTransferCoeff;
        libs        ("libfieldFunctionObjects.so");
        ...
        region      fluid;
        patches     (".*Wall");
        rho         1.225;
        Cp          1005;
        Prl         0.707;
        Prt         0.9;
    }

Usage
    Property | Description                   | Required | Default value
    type     | Type name: wallHeatTransferCoeff | yes   |
    patches  | List of patches to process    | no       | all wall patches
    region   | Region to be evaluated        | no       | default region
    rho      | Fluid density                 | yes      |
    Cp       | Fluid heat capacity           | yes      |
    Prl      | Fluid laminar Prandtl number  | yes      |
    Prt      | Fluid turbulent Prandtl number| yes      |

Note
    Writing field 'wallHeatTransferCoeff' is done by default, but it can be
    overridden by defining an empty \c objects list. For details see
    writeLocalObjects.
2017-12-06 16:10:34 +00:00
f2ba82e3b5 fvDOM: Extended to any axis aligned 1-D and 2-D geometry 2017-12-06 12:17:18 +00:00
cc4d4433b8 messageStream: Added support for suppressing the printing of log header
This generalizes and replaces the previous "noBanner" option provided by argList
and is extended to include the messages printed by Time.

Resolves bug-report https://bugs.openfoam.org/view.php?id=2782
2017-12-06 11:58:35 +00:00
745b20acb6 TDACChemistryModel: Removed unnecessary warning messages
Patch contributed by Francesco Contino
2017-12-04 12:28:59 +00:00