Commit Graph

2325 Commits

Author SHA1 Message Date
a33b4812b1 localEulerDdt: Ensure the rSubDeltaT field is registered 2019-01-03 15:27:37 +00:00
70afbf01a5 dictionary::functionEntries::if(eq)Entry: New conditional statement handling in dictionary
Class
    Foam::functionEntries::if

Description
    Conditional parsing of dictionary entries.

    E.g.
    \verbatim
        U_inlet 15;

        #if #calc "${U_inlet} < 10"
            ..
        #else
            ..
        #endif
    \endverbatim

    Note:
    - only supports single line, '\' is not supported
    - condition should be readable as a \c Switch
      (supports 0,1, true, false, etc.)

Class
    Foam::functionEntries::ifeqEntry

Description
    Conditional parsing of dictionary entries.

    E.g.
    \verbatim
        a #calc "0.123";
        b 1.23e-1;

        #ifeq $a $b
            ..
        #else
            ..
        #endif
    \endverbatim

    \verbatim
    ddtSchemes
    {
    #ifeq ${FOAM_APPLICATION} simpleFoam
        default         steadyState;
    #else
        default         Euler;
    #endif
    }
    \endverbatim

    Note:
    - supports dictionary variables and environment variables
    - the two arguments should be two tokens
    - the comparison is a string comparison for any word/string/variable,
      integer comparison for two integers and floating point comparison for
      any floating point number.
    - parsing of (non)matching \c #else, \c #endif is not very sophisticated

Contributed by Mattijs Janssens
2018-12-31 18:51:25 +00:00
0c31e465be Changed tmp<pointField> construction to use the new simpler "New" method
avoiding unnecessary database registration of temporary fields
2018-12-21 19:52:16 +00:00
6dc48b62d9 Changed tmp<volField> and tmp<surfaceField> construction to use the new simpler "New" method
avoiding unnecessary database registration of temporary fields
2018-12-21 18:37:13 +00:00
d95d68d7be Removed support for ancient platforms IA64 and SGIN32 2018-12-21 18:35:20 +00:00
819eb06657 src: Changed tmp<volField> construction to use the new simpler "New" method
avoiding unnecessary database registration of temporary fields
2018-12-21 07:14:52 +00:00
2fada7886a GeometricFields: Removed registration of temporary fields 2018-12-20 15:25:41 +00:00
942d9d1515 DimensionedField: Temporary fields are no longer registered on the database by default 2018-12-20 15:24:46 +00:00
146a59e46c GeometricField: Temporary fields are no longer registered on the database by default
Registration occurs when the temporary field is transferred to a non-temporary
field via a constructor or if explicitly transferred to the database via the
regIOobject "store" methods.
2018-12-20 11:00:37 +00:00
6faadcb45c Removed the unnecessary ".0" from dimensionedScalar constructors 2018-12-19 14:24:41 +00:00
2f7f0a2f11 GeometricField: Changed "New" method to take a name argument instead of using the name of the dimensionedType 2018-12-19 13:56:30 +00:00
b55c176eb8 DimensionedField: Added "New" methods to return unregistered temporary fields 2018-12-19 13:55:09 +00:00
3708da6175 dimensionedType: Added constructor from dimensions and value
The name is generated from the value.
2018-12-19 13:54:30 +00:00
60e4b0b60e waveAtmBoundaryLayerSuperposition: Fixed typo in header documentation 2018-12-19 13:37:43 +00:00
35327ca5e1 src/Allwmake: Fixed compilation order of wave and atmosphericModels 2018-12-19 11:41:51 +00:00
3db8158b7b TurbulenceModels: Changed tmp geometric field construction to use the new "New" method
to avoid unnecessary database registrations of temporary fields and simplify the
code.
2018-12-18 21:58:15 +00:00
7fc61d7eb7 negEntry: Supporting negation of already negative quantities 2018-12-18 11:51:45 +00:00
5925868fb7 waves: Moved mean velocity specification back into the wave models
With the inclusion of boundary layer modelling in the gas, the
separation of wave perturbation from and mean flow became less useful,
and potentially prevents further extension to support similar boundary
layer modelling in the liquid.

The mean velocity entry, UMean, is now needed in the
constant/waveProperties file rather than in the waveVelocity boundary
condition.
2018-12-18 10:34:40 +00:00
4d6b99faa7 waves: Added atmospheric boundary layer modelling to the gas
An atmospheric boundary layer velocity can now be added to the gas side
of the wave modelling. The wave superposition class has been given a
run-time selection mechanism, and a derivation added which includes gas
atmospheric boundary layer modelling. This modelling is therefore
available in both the wave boundary conditions, and in setWaves.

This functionality can be selected in the constant/waveProperties file
by supplying a "type" entry and a number of parameters controlling the
boundary layer. For example:

    In constant/waveProperties:

        type            waveAtmBoundaryLayer;

        // properties specifying the wave modelling ...

        UGasRef         (10 0 0);
        hRef            20;
        hWaveMin        -2;
        hWaveMax        3;

UGasRef is the gas velocity relative to the liquid, at the height, hRef,
relative to the wave model origin. hWaveMin and hWaveMax describe the
range of the wave elevation; it is non-trivial to calculate this from
the wave models themselves, so it is required as an input.

The base wave superposition class can be selected with "type wave;", but
also selects by default when the "type" entry is omitted, so the change
is backwards compatible.
2018-12-17 16:40:29 +00:00
b66cad39ee TDACChemistryModel: Allow reduction and tabulation methods to be instantiated in the same file 2018-12-14 15:05:02 +00:00
bd5a194280 atmBoundaryLayer: Added documentation 2018-12-14 11:20:32 +00:00
2e4027d182 atmBoundaryLayer: Added experimental support for an offset boundary layer 2018-12-12 16:27:30 +00:00
967edc9425 waves: Split mean flow from wave perturbation modelling
In order to increase the flexibility of the wave library, the mean flow
handling has been removed from the waveSuperposition class. This makes
waveSuperposition work purely in terms of perturbations to a mean
background flow.

The input has also been split, with waves now defined as region-wide
settings in constant/waveProperties. The mean flow parameters are sill
defined by the boundary conditions.

The new format of the velocity boundary is much simpler. Only a mean
flow velocity is required.

    In 0/U:

        boundaryField
        {
            inlet
            {
                type            waveVelocity;
                UMean           (2 0 0);
            }
            // etc ...
        }

Other wave boundary conditions have not changed.

The constant/waveProperties file contains the wave model selections and
the settings to define the associated coordinate system and scaling
functions:

    In constant/waveProperties:

        origin          (0 0 0);
        direction       (1 0 0);
        waves
        (
            Airy
            {
                length      300;
                amplitude   2.5;
                phase       0;
                angle       0;
            }
        );
        scale           table ((1200 1) (1800 0));
        crossScale      constant 1;

setWaves has been changed to use a system/setWavesDict file rather than
relying on command-line arguments. It also now requires a mean velocity
to be specified in order to prevent ambiguities associated with multiple
inlet patches. An example is shown below:

    In system/setWavesDict:

        alpha   alpha.water;
        U       U;
        liquid  true;
        UMean   (1 0 0);
2018-12-10 13:39:06 +00:00
37396d1498 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-12-10 10:48:35 +00:00
43b54e1623 functionObjects::fieldAverageItem: Corrected writing of prime2Mean
Resolves bug-report https://bugs.openfoam.org/view.php?id=3122
2018-12-10 10:47:06 +00:00
4796ce32bd waveSuperposition: Fixed bug in gas pressure 2018-12-10 09:17:04 +00:00
2e1e8837c0 outletPhaseMeanVelocity: Renamed Umean to UnMean
This is to make it clear that the value supplied is the scalar mean
velocity normal to the patch, and to distinguish it from other instances
of the keyword "UMean" which take a vector quantity.
2018-12-10 09:05:30 +00:00
73c8e0d9f9 Function1: Replaced separate value-ramp pairs with a single Function1
The Scaled Function1 removes the need for classes to hold both a value
and a ramping function. If it is desired to ramp up a velocity up to
(10 0 0) over the space of 5 seconds, that can be achieved as follows:

    velocity
    {
        type        scale;
        scale
        {
            type        halfCosineRamp;
            duration    5;
        }
        value       (10 0 0);
    }

Also, as a result of this change, the velocityRamping fvOption has
become a general acceleration source, based on a velocity Function1. It
has therefore been renamed accelerationSource.
2018-12-10 09:04:11 +00:00
78b6c7c9e5 solidificationMeltingSourceTemplates: Removed incorrect comments
Resolves bug-report https://bugs.openfoam.org/view.php?id=3124
2018-12-07 16:20:18 +00:00
d6f538c453 dynamicInterpolatedFvMesh: New dynamic mesh which interpolates a given set of point position or displacement files
Class
    Foam::dynamicInterpolatedFvMesh

Description
    Interpolates pre-specified motion specified as a set of pointVectorFields.

    The motion can be provided either as a set of displacement or position
    fields and the entry \c displacement specified accordingly.

Usage
    Example:
    \verbatim
    dynamicFvMesh   dynamicInterpolatedFvMesh;

    displacementLaplacianCoeffs
    {
        field               wantedDisplacement;
        displacement        yes;
        interpolationScheme linear;
    }
    \endverbatim

    This will scan the case for \c wantedDisplacement \c pointVectorFields in
    the time directories and interpolate those in time (using \c linear
    interpolation) to obtain the current displacement.  The advantage of
    specifying displacement in this way is that it automatically works in
    parallel using \c decomposePar to decompose the set of \c pointVectorFields
    provided.
2018-12-05 12:04:51 +00:00
6ec5e56968 fileOperations: Added more diagnostics
Patch contributed by Mattijs Janssens
2018-11-30 15:13:53 +00:00
b786f41498 IOobject: Add "local" to message
Patch contributed by Mattijs Janssens
2018-11-30 15:13:20 +00:00
d756303c30 fvPatch: start() and name() functions are now virtual
Patch contributed by Mattijs Janssens
2018-11-30 15:12:43 +00:00
58170f4405 argList: allow parallel running without a decomposeParDict and support -libs argument
to allow dynamic linking of libraries at start-up.

Patch contributed by Mattijs Janssens
2018-11-30 15:06:45 +00:00
b785c988c6 ConeInjection: Added support for time-varying position and direction
The position and direction of cone injection sites can now be specified
using Function1 to make them change in time, relative to the start of
injection.

An example specification of the relevant entries is shown below.

    injectionModels
    {
        injection1
        {
            type            coneInjection;
            position        table
            (
                (0 (-0.1 -0.1 0))
                (0.25 (0.1 -0.1 0))
                (0.5 (0.1 0.1 0))
                (0.75 (-0.1 0.1 0))
                (1 (-0.1 -0.1 0))
            );
            direction       table
            (
                (0 (-1 -1 0))
                (0.25 (1 -1 0))
                (0.5 (1 1 0))
                (0.75 (-1 1 0))
                (1 (-1 -1 0))
            );
            outOfBounds     repeat;

            // etc ...
        }
    }

Sub-dictionaries can also be used if the keywords of parameters of the
two functions collide:

    injectionModels
    {
        injection1
        {
            type            coneInjection;
            position        tableFile;
            positionCoeffs
            {
                file            "constant/injection1.positions";
                outOfBounds     clamp;
            }
            direction       tableFile;
            directionCoeffs
            {
                file            "constant/injection1.directions";
                outOfBounds     repeat;
            }

            // etc ...
        }
    }

A check is also done to determine whether a constant function is in use
on a stationary mesh, in order to prevent repeated searching for the
same position, and therefore retain approximately the efficiency of the
previous implementation in simple cases.
2018-11-30 08:50:34 +00:00
f31a675478 thermophysicalModels: Further rationalisation of the of the combinations of energy and thermo property forms
eConst is now used with sensibleInternalEnergy rather the hConst for consistency
and efficiency.
2018-11-29 14:50:19 +00:00
b20e55ab5b waves: Minor fixes to wave model velocity functions 2018-11-29 08:48:56 +00:00
49d60b8520 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-11-28 22:08:59 +00:00
bcbfe542cf Rationalised WM_PROJECT_SITE and WM_PROJECT_INST_DIR in foamEtcFile and etcFiles
for consistency with WM_PROJECT.  Now "etc" files are assumed to be in etc
sub-directories of WM_PROJECT_SITE and WM_PROJECT_INST_DIR allowing other files
to be stored in those directories.  The search order is now:

Search for files from user/group/shipped directories.
The search scheme allows for version-specific and
version-independent files using the following hierarchy:
- \b user settings:
  - ~/.OpenFOAM/\<VERSION\>/
  - ~/.OpenFOAM/
- \b group (site) settings (when $WM_PROJECT_SITE is set):
  - $WM_PROJECT_SITE/\<VERSION\>/etc/
  - $WM_PROJECT_SITE/etc/
- \b group (site) settings (when $WM_PROJECT_SITE is not set):
  - $WM_PROJECT_INST_DIR/site/\<VERSION\>/etc/
  - $WM_PROJECT_INST_DIR/site/etc/
- \b other (shipped) settings:
  - $WM_PROJECT_DIR/etc/

\return The list of full paths of all the matching files or
an empty list if the name cannot be found.
Optionally abort if the file cannot be found.
Optionally stop search after the first file has been found.

This change was proposed and agreed by the sponsors of the OpenFOAM project on
the OpenFOAM Hub, see https://openfoam.org/maintenance/
2018-11-28 22:00:34 +00:00
d012e3eb1e levelSetTemplates: Fixed bug in boundary handling 2018-11-28 14:42:49 +00:00
3c60437a3e Renamed directory fixedInternalValueFvPatchField -> fixedInternalValue for consistency 2018-11-28 10:24:50 +00:00
95815460c0 Comment spelling corrections 2018-11-28 10:24:26 +00:00
e353a07ecf functionObjects/field/age: Added schemesField option
This allows scheme and solver settings used for the calculation of age
to be copied from another variable
2018-11-25 12:55:09 +00:00
b928e37677 functionObjects: Added age function object
This object calculates a field of the age of fluid in the domain; i.e.,
the time taken for a fluid particle to travel to a location from an
inlet. It outputs a field, named age, with dimensions of time, and
requires a solver and a div(phi,age) scheme to be specified. A number of
corrections for the solution procedure can be set, as well as the name
of the flux and density fields.

Example specification:

    age1
    {
        type    age;
        libs    ("libfieldFunctionObjects.so");
        nCorr   10;
        phi     phi;
        rho     rho;
    }

Example usage:

    postProcess -func age -fields "(phi)" -latestTime

This work was supported by Robert Secor and Lori Holmes, at 3M
2018-11-23 08:37:48 +00:00
e928eafa52 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-11-20 11:33:02 +00:00
bcf4e68901 Further rationalisation of the handling of "Final" solver settings
The selection of the "Final" solver settings is now handled automatically within
the "<equation>.solve()" call and there is no longer any need no provide a bool
argument for specific cases.  This simplifies the solution algorithm loop
structures and ensures consistency in behaviour across all solvers.

All tutorials have been updated to correspond to the now consistent rules.
2018-11-20 11:28:02 +00:00
f810b87dba solutionControl: Default simpleRho true when steady, and improved log messages 2018-11-19 13:53:11 +00:00
ee443e201f Rationalised the handling of "Final" solver and relaxation factor settings
Now for transient simulations "Final" solver settings are required for ALL
equations providing consistency between the solution of velocity, energy,
composition and radiation properties.

However "Final" relaxation factors are no longer required for fields or
equations and if not present the standard value for the variable will be
applied.  Given that relaxation factors other than 1 are rarely required for
transient runs and hence the same for all iterations including the final one
this approach provide simpler input while still providing the flexibility to
specify a different value for the final iteration if required.  For steady cases
it is usual to execute just 1 outer iteration per time-step for which the
standard relaxation factors are appropriate, and if more than one iteration is
executed it is common to use the same factors for both.  In the unlikely event
of requiring different relaxation factors for the final iteration this is still
possible to specify via the now optional "Final" specification.
2018-11-17 19:42:23 +00:00
ae28cb34d2 fanFvPatchField -> fanPressureJumpFvPatchScalarField: for consistency with fanPressureFvPatchScalarField
Description
    This boundary condition provides a pressure jump condition, using
    the \c cyclic condition as a base.

    The jump is specified as a \c Function1 type, to enable the use of, e.g.
    constant, polynomial, table values. This boundary condition can operate
    in two modes - standard and backward compatibility.
    In standard mode, jump is specified as a function of total volumetric
    flow rate through the patch. In backward compatibility mode, the boundary
    conditions serves as a direct replacement for the fanFvPatchField, where
    jump is defined as a function of local velocity.

Usage
    \table
        Property     | Description             | Required    | Default value
        patchType    | underlying patch type should be \c cyclic| yes |
        fanCurve     | fan curve, e.g. \c csvFile | yes      |
        jumpTable    | jump data (backward compatibility mode) | no       |
        reverse      | reverse jump direction  | no | false
        phi          | flux field name         | no          | phi
        rho          | density field name      | no          | rho
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            fan;
        patchType       cyclic;
        fanCurve       csvFile;
        csvFileCoeffs
        {
            hasHeaderLine   1;
            refColumn       0;
            componentColumns 1(1);
            separator       ",";
            file           "$FOAM_CASE/constant/pressureVsQ";
        }
        value           uniform 0;
    }
    \endverbatim

    The above example shows the use of a comma separated (CSV) file to specify
    the jump condition.

Contributed by Daniel Jasinski
Resolves bug-report https://bugs.openfoam.org/view.php?id=3102#c10159
2018-11-14 15:35:35 +00:00
ffd0f34c24 coupledPolyPatch, coupledPolyPatch: Added defaultTransform argument 2018-11-14 14:48:02 +00:00