Commit Graph

1940 Commits

Author SHA1 Message Date
b17c0e3fa1 PrghPressureFvPatchScalarField: New base class used to create p_rgh variants of pressure BCs
The prghPressureFvPatchScalarField, prghTotalPressureFvPatchScalarField and
prghUniformDensityHydrostaticPressure p_rgh boundary conditions are now derived
from the corresponding pressure boundary conditions using the
PrghPressureFvPatchScalarField template.
2018-03-31 21:47:58 +01:00
01d6aed0e1 Corrected typos in comments
Resolves bug-report https://bugs.openfoam.org/view.php?id=2891
2018-03-27 21:08:37 +01:00
80cf711937 stringOps::inplaceExpand: Use scientific rather than fixed format for scalar values
Resolves bug-report https://bugs.openfoam.org/view.php?id=2889
2018-03-26 16:00:33 +01:00
828254ab34 functionObjects::forceCoeffs: normalize liftDir, dragDir and pitchAxis
It may be convenient to specify these directions un-normalized so it is
necessary to normalize them before they are used to calculate the force
coefficients.
2018-03-25 22:20:02 +01:00
9b40325e69 Corrected typo in comment: "the the" -> "the" 2018-03-25 12:15:07 +01:00
8a9bbb9a73 Corrected typos in comment: "the the" -> "the" 2018-03-25 12:09:00 +01:00
5d4c8f5d5f fvMeshDistribute: uses topological rather than geometric point merging
Patch contributed by Mattijs Janssens
2018-03-23 17:02:18 +00:00
f2cc03bf8d MULES: Non-uniform limiting and additional form of limit sum
MULES and CMULES have been extended so that the limits can be supplied
as fields. These arguments are templated so that zeroField, oneField or
UniformField<scalar> can be used in place of a scalar value with no
additional overhead. The flux argument has been removed from the
unlimited CMULES correct functions in order to make this templating
possible.

An additional form of limit sum has also been added to MULES. This
limits the flux sum by ofsetting in proportion to the phase fraction,
rather than by reducing the magnitude of the fluxes with the same sign
as the imbalance. The new procedure makes it possible to limit the flux
sum in the presence of constraints without encountering a divide by
zero.
2018-03-22 16:55:36 +00:00
ea86dc2cf4 LduMatrix: Sum-diag operations for diagonal matrices 2018-03-22 16:55:36 +00:00
9cf51b0363 fvOptions: Added method for querying application to a field 2018-03-22 16:55:36 +00:00
58b7c01dbd fvPatchFields: Corrected documentation
Resolves bug-report https://bugs.openfoam.org/view.php?id=2885
2018-03-22 11:09:42 +00:00
c677ba1185 wideBandAbsorptionEmission: Corrected errors
Resolves bug-reports
https://bugs.openfoam.org/view.php?id=2881
https://bugs.openfoam.org/view.php?id=2882

Patches contributed by Kevin Nordin-Bates
2018-03-21 18:03:29 +00:00
a4de83a425 Improvements to the fileHandler and collated IO
Improvements to existing functionality
--------------------------------------
  - MPI is initialised without thread support if it is not needed e.g. uncollated
  - Use native c++11 threading; avoids problem with static destruction order.
  - etc/cellModels now only read if needed.
  - etc/controlDict can now be read from the environment variable FOAM_CONTROLDICT
  - Uniform files (e.g. '0/uniform/time') are now read only once on the master only
    (with the masterUncollated or collated file handlers)
  - collated format writes to 'processorsNNN' instead of 'processors'.  The file
    format is unchanged.
  - Thread buffer and file buffer size are no longer limited to 2Gb.

The global controlDict file contains parameters for file handling.  Under some
circumstances, e.g. running in parallel on a system without NFS, the user may
need to set some parameters, e.g. fileHandler, before the global controlDict
file is read from file.  To support this, OpenFOAM now allows the global
controlDict to be read as a string set to the FOAM_CONTROLDICT environment
variable.

The FOAM_CONTROLDICT environment variable can be set to the content the global
controlDict file, e.g. from a sh/bash shell:

    export FOAM_CONTROLDICT=$(foamDictionary $FOAM_ETC/controlDict)

FOAM_CONTROLDICT can then be passed to mpirun using the -x option, e.g.:

    mpirun -np 2 -x FOAM_CONTROLDICT simpleFoam -parallel

Note that while this avoids the need for NFS to read the OpenFOAM configuration
the executable still needs to load shared libraries which must either be copied
locally or available via NFS or equivalent.

New: Multiple IO ranks
----------------------
The masterUncollated and collated fileHandlers can now use multiple ranks for
writing e.g.:

    mpirun -np 6 simpleFoam -parallel -ioRanks '(0 3)'

In this example ranks 0 ('processor0') and 3 ('processor3') now handle all the
I/O.  Rank 0 handles 0,1,2 and rank 3 handles 3,4,5.  The set of IO ranks should always
include 0 as first element and be sorted in increasing order.

The collated fileHandler uses the directory naming processorsNNN_XXX-YYY where
NNN is the total number of processors and XXX and YYY are first and last
processor in the rank, e.g. in above example the directories would be

    processors6_0-2
    processors6_3-5

and each of the collated files in these contains data of the local ranks
only. The same naming also applies when e.g. running decomposePar:

decomposePar -fileHandler collated -ioRanks '(0 3)'

New: Distributed data
---------------------

The individual root directories can be placed on different hosts with different
paths if necessary.  In the current framework it is necessary to specify the
root per slave process but this has been simplified with the option of specifying
the root per host with the -hostRoots command line option:

    mpirun -np 6 simpleFoam -parallel -ioRanks '(0 3)' \
        -hostRoots '("machineA" "/tmp/" "machineB" "/tmp")'

The hostRoots option is followed by a list of machine name + root directory, the
machine name can contain regular expressions.

New: hostCollated
-----------------

The new hostCollated fileHandler automatically sets the 'ioRanks' according to
the host name with the lowest rank e.g. to run simpleFoam on 6 processors with
ranks 0-2 on machineA and ranks 3-5 on machineB with the machines specified in
the hostfile:

    mpirun -np 6 --hostfile hostfile simpleFoam -parallel -fileHandler hostCollated

This is equivalent to

    mpirun -np 6 --hostfile hostfile simpleFoam -parallel -fileHandler collated -ioRanks '(0 3)'

This example will write directories:

    processors6_0-2/
    processors6_3-5/

A typical example would use distributed data e.g. no two nodes, machineA and
machineB, each with three processes:

    decomposePar -fileHandler collated -case cavity

    # Copy case (constant/*, system/*, processors6/) to master:
    rsync -a cavity machineA:/tmp/

    # Create root on slave:
    ssh machineB mkdir -p /tmp/cavity

    # Run
    mpirun --hostfile hostfile icoFoam \
        -case /tmp/cavity -parallel -fileHandler hostCollated \
        -hostRoots '("machineA" "/tmp" "machineB" "/tmp")'

Contributed by Mattijs Janssens
2018-03-21 12:42:22 +00:00
a5d6778281 atmosphericModels: Added Lopes da Costa porosity and turbulence models
Specialized variants of the power law porosity and k epsilon turbulence models
developed to simulate atmospheric flow over forested and non-forested complex
terrain.

Class
    Foam::powerLawLopesdaCosta

Description
    Variant of the power law porosity model with spatially varying
    drag coefficient

    given by:

        \f[
            S = -\rho C_d \Sigma |U|^{(C_1 - 1)} U
        \f]

    where
    \vartable
        \Sigma | Porosity surface area per unit volume
        C_d    | Model linear coefficient
        C_1    | Model exponent coefficient
    \endvartable

    Reference:
    \verbatim
        Costa, J. C. P. L. D. (2007).
        Atmospheric flow over forested and non-forested complex terrain.
    \endverbatim

Class
    Foam::RASModels::kEpsilonLopesdaCosta

Description
    Variant of the standard k-epsilon turbulence model with additional source
    terms to handle the changes in turbulence in porous regions represented by
    the powerLawLopesdaCosta porosity model.

    Reference:
    \verbatim
        Costa, J. C. P. L. D. (2007).
        Atmospheric flow over forested and non-forested complex terrain.
    \endverbatim

    The default model coefficients are
    \verbatim
        kEpsilonLopesdaCostaCoeffs
        {
            Cmu         0.09;
            C1          1.44;
            C2          1.92;
            sigmak      1.0;
            sigmaEps    1.3;
        }
    \endverbatim

Tutorial case to follow.
2018-03-20 22:26:07 +00:00
ea00c1a4c5 uniformDensityHydrostaticPressureFvPatchScalarField.H: Corrected typo 2018-03-18 14:25:17 +00:00
ea4fbd5e83 src/atmosphericModels: New library containing models specific to atmospheric flows
Converted the atmBoundaryLayerInlet boundary conditions to inletOutlet to handle
changes in inflow orientation without the need for re-meshing.
2018-03-18 14:08:20 +00:00
4b40886496 MRFZone: Filter-out excluded patches from ddtCorr 2018-03-16 17:14:27 +00:00
0fd3db427f functionObjects::forces: Construct nu without need to specify name and dimensions
Resolved patch request https://bugs.openfoam.org/view.php?id=2880
2018-03-15 00:44:33 +00:00
81947c8085 particle: Optimisation by inlining key methods
Resolves bug report https://bugs.openfoam.org/view.php?id=2871
2018-03-13 08:25:20 +00:00
85c1c8b94f PengRobinsonGas: Corrected construction order in constructor not currently used
Resolves bug report https://bugs.openfoam.org/view.php?id=2874
2018-03-12 14:09:17 +00:00
d5185e9cec Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-03-10 23:51:46 +00:00
4331b98735 omegaWallFunction: Change blending from geometric mean to wall distance Reynolds number based
Replaced the ad hoc geometric mean blending with the more physical wall distance
Reynolds number blending function.

Additionally the part of the production term active for y+ < 11.6 has been
reinstated.
2018-03-10 23:46:32 +00:00
1ba4d4b298 sweptFaceAreaWeightAMI: Replaced std::to_string with Foam::name
Resolves bug report https://bugs.openfoam.org/view.php?id=2873
2018-03-09 16:04:34 +00:00
494f97dea5 prghUniformDensityHydrostaticPressureFvPatchScalarField: Corrected documentation 2018-03-09 08:15:49 +00:00
52a2ba84c2 prghUniformDensityHydrostaticPressureFvPatchScalarField: New boundary condition for p_rgh
Sets the boundary values of p_rgh corresponding to a constant density hydrostatic
pressure distribution.

Description
    This boundary condition provides a hydrostatic pressure condition for p_rgh,
    calculated as:

        \f[
            p_{rgh} = p_{ref} - (\rho - \rho_0) g (h - h_{ref})
        \f]

    where
    \vartable
        p_{rgh}    | Pseudo hydrostatic pressure [Pa]
        p_{ref}    | Static pressure at hRef [Pa]
        h          | Height in the opposite direction to gravity
        h_{ref}    | Reference height in the opposite direction to gravity
        \rho       | Density field
        \rho_{ref} | Uniform reference density at boundary
        g          | Acceleration due to gravity [m/s^2]
    \endtable

Usage
    \table
        Property     | Description               | Required    | Default value
        pRef         | Reference static pressure | yes         |
        rhoRef       | Reference density         | yes         |
        rho          | Density field name        | no          | rho
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            prghUniformDensityHydrostaticPressure;
        rhoRef          1000;
        p               0;
        value           uniform 0; // optional initial value
    }
    \endverbatim
2018-03-08 21:59:29 +00:00
ba84383e26 reactingEulerFoam: Multiphase partial elimination and re-organisation
Partial elimination has been implemented for the multiphase Euler-Euler
solver. This does a linear solution of the drag system when calculating
flux and velocity corrections after the solution of the pressure
equation. This can improve the behaviour of the solution in the event
that the drag coupling is high. It is controlled by means of a
"partialElimination" switch within the PIMPLE control dictionary in
fvSolution.

A re-organisation has also been done in order to remove the exposure of
the sub-modelling from the top-level solver. Rather than looping the
drag, virtual mass, lift, etc..., models directly, the solver now calls
a set of phase-system methods which group the different force terms.
These new methods are documented in MomentumTransferPhaseSystem.H. Many
other accessors have been removed as a consequence of this grouping.

A bug was also fixed whereby the face-based algorithm was not
transferring the momentum associated with a given interfacial mass
transfer.
2018-03-08 12:41:14 +00:00
1073607cb0 Corrected spelling and typo's in comments
Resolves bug report https://bugs.openfoam.org/view.php?id=2845
2018-03-05 20:14:28 +00:00
e08128781e functionObjects::turbulenceIntensity: New functionObject which writes the turbulenceIntensity field
Description
    Evaluates and writes the turbulence intensity field 'I'.

    The turbulence intensity field 'I' is the root-mean-square of the turbulent
    velocity fluctuations normalised by the local velocity magnitude:
    \f[
        I \equiv \frac{\sqrt{\frac{2}{3}\, k}}{U}
    \f]
    To avoid spurious extrema and division by 0 I is limited to 1 where the
    velocity magnitude is less than the turbulent velocity fluctuations.

    Example of function object specification:
    \verbatim
    functions
    {
        .
        .
        .
        turbulenceIntensity
        {
            type        turbulenceIntensity;
            libs        ("libfieldFunctionObjects.so");
        }
        .
        .
        .
    }
    \endverbatim

    or using the standard configuration file:
    \verbatim
    functions
    {
        .
        .
        .
        #includeFunc turbulenceIntensity
        .
        .
        .
    }
    \endverbatim
2018-03-02 14:32:29 +00:00
658ffb0da9 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-03-01 14:24:12 +00:00
68805b5a54 singleComponentMixture: Updated for the Intel compiler 2018-03-01 14:23:09 +00:00
0d2fe24cd7 token: Explicitly support char as either signed or unsigned char
Resolves bug-report https://bugs.openfoam.org/view.php?id=2863
2018-03-01 14:20:25 +00:00
217429aae1 turbulentTemperatureCoupledBaffleMixed: Reword error message 2018-02-28 14:27:25 +00:00
639daf63bc basicThermo: updated splitThermoName for the Intel compiler 2018-02-28 14:16:05 +00:00
b4c0d086e0 turbulentTemperatureCoupledBaffleMixed: Added error message 2018-02-28 14:13:56 +00:00
9ea6e22b0a cubicGradientLimiter: Documented private data 2018-02-27 17:37:28 +00:00
c9c9c62a24 VenkatakrishnanGradientLimiter: Updated documentation 2018-02-27 14:46:17 +00:00
1037330349 cellLimitedGrad gradientLimiters: Added support for run-time selectable gradient limiter function
Minmod is the default limiter function and specified with an explicit name e.g.:

    gradSchemes
    {
        default Gauss linear;
        limited cellLimited Gauss linear 1;
    }

Venkatakrishnan and cubic limiter functions are also provided and may be
specified explicitly e.g.:

    gradSchemes
    {
        default Gauss linear;
        limited cellLimited<Venkatakrishnan> Gauss linear 1;
    }

or

    gradSchemes
    {
        default Gauss linear;
        limited cellLimited<cubic> 1.5 Gauss linear 1;
    }

The standard minmod function is recommended for most applications but if
convergence or stability problems arise it may be beneficial to use one of the
alternatives which smooth the gradient limiting.  The Venkatakrishnan is not
well formulated and allows the limiter to exceed 1 whereas the cubic limiter is
designed to obey all the value and gradient constraints on the limiter function,
see

    Michalak, K., & Ollivier-Gooch, C. (2008).
    Limiters for unstructured higher-order accurate solutions
    of the Euler equations.
    In 46th AIAA Aerospace Sciences Meeting and Exhibit (p. 776).

The cubic limiter function requires the transition point at which the limiter
function reaches 1 is an input parameter which should be set to a value between
1 and 2 although values larger than 2 are physical but likely to significantly
reduce the accuracy of the scheme.
2018-02-26 23:14:46 +00:00
d5d1fffcec Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-02-23 12:27:01 +00:00
fb15be492c freestreamPressure, freestreamVelocity: New blended boundary conditions for the freestream
These BCs blend between typical inflow and outflow conditions based on the
velocity orientation.

airFoil2D tutorial updated to demonstrate these new BCs.
2018-02-23 12:23:06 +00:00
a5560ad05a solutionControl: Replace solveFlow control with frozenFlow
The old "solveFlow" keyword in sprayFoam and chtMultiRegionFoam is still
available for backwards compatibility
2018-02-21 10:34:36 +00:00
df6e2da2dd OpenFOAM field reading: Automated the handling of <field>.orig files
Now if a <field> file does not exist first the compressed <field>.gz file is
searched for and if that also does not exist the <field>.orig file is searched
for.

This simplifies case setup and run scripts as now setField for example can read
the <field>.orig file directly and generate the <field> file from it which is
then read by the solver.  Additionally the cleanCase function used by
foamCleanCase and the Allclean scripts automatically removed <field> files if
there is a corresponding <field>.orig file.  So now there is no need for the
Allrun scripts to copy <field>.orig files into <field> or for the Allclean
scripts to explicitly remove them.
2018-02-14 17:42:14 +00:00
019c2c08dc Corrected spelling in comments
Resolves bug-report https://bugs.openfoam.org/view.php?id=2844
2018-02-13 22:17:53 +00:00
fe1fade8cb Corrected spelling in comments
Resolves bug-report https://bugs.openfoam.org/view.php?id=2844
2018-02-13 20:39:56 +00:00
0248dd81e3 Corrected comments: inbetween -> in between 2018-02-13 16:38:41 +00:00
04d5bdc865 snappyHexMesh: Fixed "cannot find triSurfaceMesh" error message 2018-02-12 14:33:08 +00:00
1a7a489c7e InjectionModel: Removed the limit on the number of particles per parcel
A lower limit of one on the number of particles represented by a single
parcel has been removed from the injection models. It may be appropriate
to simulate the statistical behaviour of a particulate flow with more
lagrangian elements than physical particles. A unity lower limit does
not permit this.

The limit was, in some situations, also causing the large-diameter end
of an injected distribution to be clipped.

This resolves bug report https://bugs.openfoam.org/view.php?id=2837
2018-02-12 09:08:52 +00:00
eba00df061 greyDiffusiveRadiationMixedFvPatchScalarField: Simplified the lookup of the fvDOM model 2018-02-11 21:02:27 +00:00
b01118c806 MRF: Remove ddtCorr from MRF regions 2018-02-10 22:46:17 +00:00
139ffcc112 functionObject: Fixed bugs in function object time-step adjustment
The logic governing function objects' ability to change the time-step
has been modified so that it is compatible with the time-step adjustment
done in the Time class. The behaviour has been split into a method which
sets the step directly, and another which moidifies the time until the
next write operation (i.e., the time that the solver "aims" for).

This fixes an issue where the adjustments in Time and the function
objects interfere and cause the time step to decrease exponentially down
to machine precision. It also means that the set-time-step function
object now does not break the adjustable run-time setting.

This resolves bug report https://bugs.openfoam.org/view.php?id=2820
2018-02-08 11:22:46 +00:00
2b76b83343 solutionControl: Made simple and pimple name convention consistent 2018-02-08 11:22:46 +00:00