Commit Graph

3175 Commits

Author SHA1 Message Date
852726c25f compressibleInterDyMFoam: Improved conservation for morphing mesh cases
Resolves bug-report https://bugs.openfoam.org/view.php?id=2824
2018-02-07 15:36:51 +00:00
6611b54b35 fvFieldReconstructorReconstructFields: minor reformatting 2018-02-07 15:35:38 +00:00
fbf0020910 interpolationCellPointWallModified: Removed
This class did not fulfill its basic purpose and cannot be simply corrected.

Resolves bug-report https://bugs.openfoam.org/view.php?id=2826
2018-02-07 15:32:46 +00:00
15a6365a2a Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-02-06 11:49:36 +00:00
e0cd2062ad error: exit with the given error number rather than 1
Resolves patch request https://bugs.openfoam.org/view.php?id=2827
2018-02-06 11:48:15 +00:00
2feb5a12a3 VectorSpaceOps: Generalised loops for single-element vector spaces
Fixes out-of-bounds warnings generated when vector operations are
applied to spherical tensors.
2018-02-05 09:43:05 +00:00
73e9b2804f PstreamGlobals::MPI_COMM_FOAM: New OpenFOAM specific MPI communicator
Splitting MPI_COMM_FOAM from MPI_COMM_WORLD allows OpenFOAM to be linked with
other libraries communicating via MPI.

Resolves feature request https://bugs.openfoam.org/view.php?id=2815
2018-02-02 19:20:58 +00:00
be2261ca26 foamMonitor: Added -title -t option to set the graph title
Resolves feature request https://bugs.openfoam.org/view.php?id=2819
2018-02-02 16:04:12 +00:00
ce0677e560 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-02-02 14:29:43 +00:00
7dfc3c2244 ReversibleReaction: Generalized reverse rate stabilization
Changed from 1e-6 to rootSmall so that it works effectively for both double and
long double.
2018-02-02 14:28:34 +00:00
6656c849e1 pimpleMultiRegionControl: Fixed printing of PISO-mode message 2018-02-02 09:27:02 +00:00
b9e83c227e plane: Imroved the stability of construction from a plane-equation 2018-02-02 09:17:46 +00:00
283f8b7dc8 chtMultiRegionFoam: SIMPLE operation and transonic switch
Multi-region PIMPLE controls have been applied to the chtMultiRegionFoam
solver, and a transonic option has been implemented.

The new PIMPLE controls let the solver operate SIMPLE mode. The
utilisation of library solution and convergence control functionality
has significantly reduced the amount of code in the solver. The
chtMultiRegionSimpleFoam solver has also been made obsolete, and has
therefore been removed.

A few changes will be necessary to convert an existing
chtMultiRegionSimpleFoam case to chtMultiRegionFoam. All the SIMPLE
sub-dictionaries in the system/<regions>/fvSolution will need to be
renamed PIMPLE. The system/fvSolution file will also need an empty
PIMPLE sub-dictionary. In addition, additional "<variable>Final" solver
and relaxation entries will be needed. For a steady case, adding a
wildcard ending, ".*", to the variable names should be sufficient.

Solution parameters appropriate for a steady case are shown below:

    solvers
    {
        "p_rgh.*"
        {
            solver           GAMG;
            tolerance        1e-7;
            relTol           0.01;
            smoother         DIC;
            maxIter          10;
        }

        "(U|h|e|k|epsilon).*"
        {
            solver           PBiCGStab;
            preconditioner   DILU;
            tolerance        1e-7;
            relTol           0.1;
        }
    }

    PIMPLE
    {
        // ...
    }

    relaxationFactors
    {
        fields
        {
            "p_rgh.*"       0.7;
        }
        equations
        {
            "U.*"           0.5;
            "(h|e).*"       0.3;
            "(k|epsilon).*" 0.2;
        }
    }

This work was supported by Fabian Buelow, at Evonik
Tobias Holzmann provided cases for testing the convergence controls
2018-02-01 19:13:48 +00:00
4c8122783a solutionControl: Multi-region and PIMPLE time-loop control
The solution controls have been rewritten for use in multi-region
solvers, and PIMPLE fluid/solid solution controls have been implemented
within this framework.

PIMPLE also now has time-loop convergence control which can be used to
end the simulation once a certain initial residual is reached. This
allows a PIMPLE solver to run with equivalent convergence control to a
SIMPLE solver. Corrector loop convergence control is still available,
and can be used at the same time as the time-loop control.

The "residualControl" sub-dictionary of PIMPLE contains the residual
values required on the first solve of a time-step for the simulation to
end. This behaviour is the same as SIMPLE. The
"outerCorrectorResidualControl" sub-dictionary contains the tolerances
required for the corrector loop to exit. An example specification with
both types of control active is shown below.

PIMPLE
{
    // ...

    residualControl
    {
        p               1e-3;
        U               1e-4;
        "(k|epsilon|omega)" 1e-3;
    }

    outerCorrectorResidualControl
    {
        U
        {
            tolerance       1e-4;
            relTol          0.1;
        }
        "(k|epsilon|omega)"
        {
            tolerance       1e-3;
            relTol          0.1;
        }
    }
}

Note that existing PIMPLE "residualControl" entries will need to be
renamed "outerCorrectorResidualControl".

Application within a solver has also changed slightly. In order to have
convergence control for the time loop as a whole, the
solutionControl::loop(Time&) method (or the equivalent run method) must
be used; i.e.,

    while (simple.loop(runTime))
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;

        // solve ...
    }

or,

    while (pimple.run(runTime))
    {
        // pre-time-increment operations ...

        runTime ++;
        Info<< "Time = " << runTime.timeName() << nl << endl;

        // solve ...
    }
2018-02-01 16:44:07 +00:00
08d5fce8ca chemistryModel: Added new option to specify the initial ODE integration time-step
In constant/chemistryProperties in addition to the specification of the initial
ODE integration time-step used at the start of the run:

    initialChemicalTimeStep 1e-12;

this time step may now also be specified for every chemistry integration by
setting the optional entry maxChemicalTimeStep, e.g.

    maxChemicalTimeStep 1e-12;
2018-02-01 11:27:31 +00:00
1a0d663977 EulerDdtScheme: Corrected fvcDdt dimensions for multiphase moving-mesh cases
Resolves bug-report https://bugs.openfoam.org/view.php?id=2822
2018-01-31 16:44:58 +00:00
9cc2c6eacf thermo::K: updated for new C++11 scalar limits 2018-01-30 21:54:56 +00:00
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
2c882ab4a7 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingPolyDisperse: Added execute permission to scripts 2018-01-24 22:06:48 +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
504761e6c0 reactingEulerFoam: Improved documentation
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2018-01-22 17:19:55 +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
672d3058ea surfaceFeatureExtract: Changed the internalAngleTolerance to 80deg 2018-01-19 20:16:36 +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
f69bd6c22c Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-01-19 14:34:53 +00:00
799861f557 reactingTwoPhaseEulerFoam: Added ddtCorr to virtual mass time derivative
This removes a class of flux-velocity decoupling ("staggering") relating to the
interaction between the virtual mass, lift and turbulent dispersion forces.
2018-01-19 14:33:12 +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
07f86eabc4 Merge github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-01-11 10:43:20 +00:00
600b75b75a chemFoam: Limit the initial time-step to that specified in controlDict 2018-01-11 10:42:15 +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
9f54506fbf reactingEulerFoam: improvements to population balance modeling
Removed possibility for the user to specify a driftRate in the constantDrift
model which is independent of a fvOptions mass source. The driftRate must be
calculated from/be consistent with the mass source in order to yield a particle
number conserving result.

Made calculation of the over-all Sauter mean diameter of an entire population
balance conditional on more than one velocityGroup being present. This diameter
field is for post-processing purposes only and would be redundant in case of one
velocityGroup being used.

Solution control is extended to allow for solution of the population balance
equation at the last PIMPLE loop only, using an optional switch. This can be
beneficial in terms of simulation time as well as coupling between the
population balance based diameter calculation and the rest of the equation
system.

Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf
(HZDR) and VTT Technical Research Centre of Finland Ltd.
2018-01-04 17:23:00 +00:00