Commit Graph

2950 Commits

Author SHA1 Message Date
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
20180121
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
20180114
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.
20180107
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
79207b6147 reactingEulerFoam: improvements to population balance modeling
allow renormalization of sizeGroup volume fractions for restarts involving
initial conditions with a slight degree of unboundedness

Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf
(HZDR) and VTT Technical Research Centre of Finland Ltd.
2018-01-04 17:20:28 +00:00
9b58f5226b Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2018-01-04 15:20:21 +00:00
7fb371eb03 reactingEulerFoam::phasePair: Added const_iterator
which provides access to the current phase and the corresponding other phase for
each of the phases in the pair.  This allows some simplification of the phase
pair loops in several sub-models and avoids the need for pointer swaps.
2018-01-04 15:17:56 +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
4cf2b466e6 README.org: Updated links 2018-01-03 17:18:12 +00:00
dfd09a8864 solutionControl: Rationalized, simplified and registered to the database 2018-01-03 17:04:21 +00:00
868d01a70a reactingEulerFoam::HeatTransferPhaseSystem: Corrected new dmdt function
Patch contributed by Juho Peltola, VTT.
2018-01-03 12:07:16 +00:00
1e08de9b73 reactingEulerFoam: Simplified model expressions to make them more readable 2018-01-01 23:54:08 +00:00
739a0aa631 HrenyaSinclairViscosity: Simplified expression 2018-01-01 23:30:03 +00:00
26b20eb399 reactingEulerFoam: Added space after commas 2018-01-01 22:21:57 +00:00
cbe1e6e3b7 reactingEulerFoam::PhaseSystems: Updated phase pair "loops" 2018-01-01 22:12:13 +00:00
6a93b33e68 reactingEulerFoam: Corrected copyright dates of new files for populationBalance functionality
Patch contributed by HZDR
2018-01-01 20:15:22 +00:00
87c507d8c8 reactingMultiphaseEulerFoam: Updated using new pair "loop" structure 2018-01-01 16:58:42 +00:00
a9cb40b55b reactingEulerFoam::phasePair: Provide more convenient method to "loop" over pair
Checking a pair contains a particular phase and adding a contribution from the
"other" phase can now be written:

            if (pair.contains(phase))
            {
                const phaseModel& otherPhase = pair.other(phase);

                phiHbyAs[phasei] +=
                    fvc::interpolate(rAUs[phasei]*K)
                   *MRF.absolute(otherPhase.phi());

                HbyAs[phasei] += rAUs[phasei]*K*otherPhase.U();
            }

which previously would have been written as a loop over the pair and excluding
self reference:

            const phaseModel* phase1 = &pair.phase1();
            const phaseModel* phase2 = &pair.phase2();

            forAllConstIter(phasePair, pair, iter)
            {
                if (phase1 == &phase)
                {
                    phiHbyAs[phasei] +=
                        fvc::interpolate(rAUs[phasei]*K)
                       *MRF.absolute(phase2->phi());

                    HbyAs[phasei] += rAUs[phasei]*K*phase2->U();
                }

                Swap(phase1, phase2);
            }
2018-01-01 16:06:56 +00:00
8d4726cc73 reactingTwoPhaseEulerFoam::twoPhaseSystem: Updated dmdt function for consistency with reactingMultiphaseEulerFoam::reactingMultiphaseEulerFoam
Patch contributed by Juho Peltola, VTT
2018-01-01 15:37:34 +00:00
f578347934 tutorials: Corrected headers 2017-12-31 20:15:10 +00:00
57fa56ae7b tutorials/multiphase/reacting.*EulerFoam Allrun Allclean: Corrected file permissions 2017-12-31 20:09:10 +00:00
e779b244ce reactingEulerFoam: Corrected file permissions 2017-12-31 20:06:17 +00:00
3e577d8515 reactingEulerFoam: Added population balance modeling capability
This patch enables the reactingEulerFoam solvers to simulate polydisperse flow
situations, i.e. flows where the disperse phase is subject to a size
distribution.

The newly added populationBalanceModel class solves the integro-partial
differential population balance equation (PBE) by means of a class method, also
called discrete or sectional method. This approach is based on discretizing the
PBE over its internal coordinate, the particle volume. This yields a set of
transport equations for the number concentration of particles in classes with a
different representative size. These are coupled through their source-terms and
solved in a segregated manner. The implementation is done in a way, that the
total particle number and mass is preserved for coalescence, breakup and drift
(i.e. isothermal growth or phase change) processes, irrespective of the chosen
discretization over the internal coordinate.

A population balance can be split over multiple velocity (temperature) fields,
using the capability of reactingMultiphaseEulerFoam to solve for n momentum
(energy) equations. To a certain degree, this takes into account the dependency
of heat- and momentum transfer on the disperse phase diameter. It is also possible
to define multiple population balances, e.g. bubbles and droplets simultaneously.

The functionality can be switched on by choosing the appropriate phaseSystem
type, e.g. populationBalanceMultiphaseSystem and the newly added diameterModel
class called velocityGroup. To illustrate the use of the functionality, a
bubbleColumnPolydisperse tutorial was added for reactingTwoPhaseEulerFoam and
reactingMultiphaseEulerFoam.

Furthermore, a reactingEulerFoam-specific functionObject called sizeDistribution
was added to allow post-Processing of the size distribution, e.g. to obtain the
number density function in a specific region.

Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf
(HZDR) and VTT Technical Research Centre of Finland Ltd.
2017-12-31 19:59:47 +00:00
252daea980 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2017-12-31 19:52:36 +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
0ff6fe2675 foamCloneCase: corrected operation with no time dirs 2017-12-22 14:06:23 +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
d953353cd6 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2017-12-19 23:35:31 +00:00
853406b8ec wallHeatTransferCoeff: Corrected dimensions of the wallHeatTransferCoeff field 2017-12-19 23:34:42 +00:00