Commit Graph

986 Commits

Author SHA1 Message Date
861b7ba2b4 tutorials: Standardised boundary field indentation 2022-05-25 19:41:37 +01:00
141ee94b69 tutorials: Corrected end-of-file delimiter 2022-05-25 17:27:23 +01:00
744924bf69 mixtureKEpsilon: mixture k and epsilon fields are now required
to ensure complex BCs are selected and initialised correctly.

All mixture fields are now constructed and read as required in the construction
of the liquid (phase 1) mixtureKEpsilon model to ensure they are read before
time-increment and possible mesh topology change.
2022-05-25 15:57:33 +01:00
6d3e31f8e0 multiphaseEulerFoam::kineticTheoryModels, phasePressureModel: now use the phase.alphaMax()
rather than read and use a potentially inconsistent local value for alphaMax.
2022-05-25 13:47:18 +01:00
9302074836 createPatch: Simplification and removed unused dictionaries
The 'pointSync' setting in createPatchDict is now optional and defaults
to false. This setting is very rarely used. A number of unused
'createPatchDict' files have also been removed and obsolete information
has been removed from the annotated example dictionaries.
2022-05-20 14:04:17 +01:00
f54376b20c Code documentation: corrected typos 2022-05-20 10:42:25 +01:00
755c0aa869 tutorials: TJunctionFan: Simplified orig usage 2022-05-19 09:50:46 +01:00
420866cfa6 Non-Conformal Coupled (NCC): Conversion of tutorials from AMI to NCC
The following examples in the tutorials ($FOAM_TUTORIALS) directory have
been converted from using AMI to the new NCC system:

+ compressible/rhoPimpleFoam/RAS/annularThermalMixer
+ incompressible/pimpleFoam/RAS/propeller
+ lagrangian/particleFoam/mixerVessel2D (formerly mixerVesselAMI2D)
+ multiphase/interFoam/RAS/mixerVessel
+ multiphase/interFoam/RAS/propeller
+ multiphase/multiphaseEulerFoam/laminar/mixerVessel2D (formerly mixerVesselAMI2D)

The following tutorial has been converted from using ACMI:

+ incompressible/pimpleFoam/RAS/oscillatingInlet

The following tutorial has been converted from using Repeat AMI:

+ incompressible/pimpleFoam/RAS/impeller

The following tutorial has been added to demonstrate NCC's ability to
create a sufficiently conservative solution in a closed domain to
maintain phase fraction boundedness:

+ multiphase/interFoam/laminar/mixerVessel2D

The following tutorials have been added to demonstrate NCC's ability to
simulate partially overlapping couples on curved surfaces:

+ incompressible/pimpleFoam/RAS/ballValve
+ multiphase/compressibleInterFoam/RAS/ballValve

The following tutorial has been added to provide a simple comparison of
the conservation behaviour of AMI and NCC:

+ incompressible/pimpleFoam/laminar/nonConformalChannel

The following tutorial has been removed, as there were sufficiently many
examples involving this geometry:

+ incompressible/pimpleFoam/laminar/mixerVesselAMI2D
2022-05-18 10:25:43 +01:00
16c0c68e92 tutorials: planarCouette: Simplify creation of cyclic patches 2022-05-13 16:17:31 +01:00
0999cd0efe multiphaseEulerFoam: Added pipeBend tutorial
This tutorial simulates solid particle coalescence and breakage through
a 90 degree pipe bend.

Patch contributed by Kasper Gram Bilde and Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-05-11 15:30:11 +01:00
a346040bcb MomentumTransportModels::ReynoldsStress: Improved the R-U coupling stabilisation algorithm
On unstructured collocated meshes the Reynolds stress tends to decouple from the
velocity creating pronounced staggering patterns in the solution.  This effect
is reduced or eliminated by a special coupling algorithm which replaces the
gradient diffusion component of the Reynolds stress with the equivalent compact
representation on the mesh, i.e. div-grad with Laplacian in the DivDevRhoReff function:

template<class BasicMomentumTransportModel>
template<class RhoFieldType>
Foam::tmp<Foam::fvVectorMatrix>
Foam::ReynoldsStress<BasicMomentumTransportModel>::DivDevRhoReff
(
    const RhoFieldType& rho,
    volVectorField& U
) const
{
    tmp<volTensorField> tgradU = fvc::grad(U);
    const volTensorField& gradU = tgradU();
    const surfaceTensorField gradUf(fvc::interpolate(gradU));

    // Interpolate Reynolds stress to the faces
    // with either a stress or velocity coupling correction
    const surfaceVectorField Refff
    (
        (this->mesh().Sf() & fvc::interpolate(R_))

        // Stress coupling
      + couplingFactor_
       *(this->mesh().Sf() & fvc::interpolate(this->nut()*gradU))

        // or velocity gradient coupling
   // + couplingFactor_
   //  *fvc::interpolate(this->nut())*(this->mesh().Sf() & gradUf)

      - fvc::interpolate(couplingFactor_*this->nut() + this->nu())
       *this->mesh().magSf()*fvc::snGrad(U)
      - fvc::interpolate(this->nu())*(this->mesh().Sf() & dev2(gradUf.T()))
    );

    return
    (
        fvc::div(fvc::interpolate(this->alpha_*rho)*Refff)
      - correction(fvm::laplacian(this->alpha_*rho*this->nuEff(), U))
    );
}

In the above two options for the coupling term are provided, one based on the
stress correction (un-commented) and an alternative based an the velocity
gradient correction (commented).  Tests run so far indicate that the stress
correction provides better coupling while minimising the error introduced.

A new tutorial case ductSecondaryFlow is provided which demonstrates the updated
coupling algorithm on the simulation of the classic secondary flow generated in
rectangular ducts.
2022-05-10 15:54:03 +01:00
55533d2872 tutorials/multiphase/interFoam: Removed unused rhoInf entries from forces functionObject spec 2022-05-06 10:13:54 +01:00
376b51b58b multiphaseEulerFoam::populationBalanceModel: improved dilatation treatment
The population balance model considers dilatation originating from density
change and mass transfer via source terms describing nucleation as well as
"drift" of the size distribution to smaller or larger sizes. Numerically, the
treatment does not necessarily equal the total dilatation, hence a correction is
introduced to ensure boundedness of the size group fractions.

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
and VTT Technical Research Centre of Finland Ltd.
2022-04-29 16:18:03 +01:00
58444464aa initialConditions: Corrected header
Resolves bug-report https://bugs.openfoam.org/view.php?id=3831
2022-04-29 12:29:05 +01:00
95b6b0c003 tutorials: Renamed 2D MRF mixer vessel cases to mixerVessel2DMRF 2022-04-27 12:31:09 +01:00
2beec217d9 tutorials: interFoam: mixerVessel2D: Fix typo 2022-04-27 12:17:21 +01:00
b92fdc82f5 tutorials: pipeCyclic: Overhaul
The refinement cell set is now generated directly using boxToCell. The
mesh now uses cyclic, rather than cyclicAMI, patches so that propagation
of the refinement across the coupling can be tested. Field files have
been simplified by using #includeEtc to set constraints. A best practice
velocity/pressure specification has been set for the outlet boundary.
Unused fields and settings have been removed.
2022-04-27 11:54:41 +01:00
8aecadcafd particleTracks: Made compatible with dynamicMesh and updated annotated dictionary 2022-04-26 17:19:56 +01:00
3bac211785 epsilonmWallFunction: New wall-function specifically for the mixtureKEpsilon model
epsilonm is obtained by combining epsilon.gas and epsilon.liquid in a two-phase
system, each of which will apply the epsilonWallFunction at walls; the
epsilonmWallFunction propagates the resulting wall epsilonm into the near-wall
cells.

If the 0/epsilonm file is provided the epsilonmWallFunction should be specified
for walls, if the 0/epsilonm file is not provided it will be generated
automatically and the epsilonmWallFunction applied to walls for which the
epsilonWallFunction is specified in the epsilon.liquid file.
2022-04-20 18:48:35 +01:00
5e99344348 multiphaseEulerFoam::populationBalanceModel: Removed temporary dilatation correction
and updated tutorials to work with the current phase limit stabilisation.
2022-04-12 10:23:42 +01:00
b8ce733e4b fvMesh: Separated fvMesh::move() and fvMesh::update()
fvMesh::update() now executes at the beginning of the time-step, before time is
incremented and handles topology change, mesh to mesh mapping and redistribution
without point motion.  Following each of these mesh changes fields are mapped
from the previous mesh state to new mesh state in a conservative manner.  These
mesh changes not occur at most once per time-step.

fvMesh::move() is executed after time is incremented and handles point motion
mesh morphing during the time-step in an Arbitrary Lagrangian Eulerian approach
requiring the mesh motion flux to match the cell volume change.  fvMesh::move()
can be called any number of times during the time-step to allow iterative update
of the coupling between the mesh motion and field solution.
2022-04-08 18:46:12 +01:00
47b0cd54dd fvMeshTopoChangers::meshToMesh: New fvMesh topoChanger which maps to a sequence of meshes at run-time
With fvMeshTopoChangers::meshToMesh it is now possible to map the solution to a
specified sequence of pre-generated meshes at run-time to support arbitrary mesh
changes, refinements, un-refinements, changes in region topology, geometry,
etc.  Additionally mesh-motion between the sequence of meshes is supported to
allow for e.g. piston and valve motion in engines.

The tutorials/incompressible/pimpleFoam/laminar/movingCone case has been updated
to provide a demonstration of the advantages of this run-time mesh-mapping by
mapping to meshes that are finer behind the cone and coarser in front of the
cone as the cone approaches the end of the domain, thus maintaining good
resolution while avoiding excessive cell aspect ratio as the mesh is squeezed.
The dynamicMeshDict for the movingCone case is;

mover
{
    type            motionSolver;

    libs            ("libfvMeshMovers.so" "libfvMotionSolvers.so");

    motionSolver    velocityComponentLaplacian;

    component       x;
    diffusivity     directional (1 200 0);
}

topoChanger
{
    type    meshToMesh;

    libs    ("libmeshToMeshTopoChanger.so");

    times   (0.0015 0.003);

    timeDelta 1e-6;
}

which lists the mesh mapping times 0.0015s 0.003s and meshes for these times in
directories constant/meshToMesh_0.0015 and constant/meshToMesh_0.003 are
generated in the Allrun script before the pimpleFoam run:

runApplication -a blockMesh -dict blockMeshDict.2
rm -rf constant/meshToMesh_0.0015
mkdir constant/meshToMesh_0.0015
mv constant/polyMesh constant/meshToMesh_0.0015

runApplication -a blockMesh -dict blockMeshDict.3
rm -rf constant/meshToMesh_0.003
mkdir constant/meshToMesh_0.003
mv constant/polyMesh constant/meshToMesh_0.003

runApplication -a blockMesh -dict blockMeshDict.1

runApplication $application

Note: This functionality is experimental and has only undergone basic testing.
It is likely that it does not yet work with all functionObject, fvModels
etc. which will need updating to support this form of mesh topology change.
2022-04-06 16:37:22 +01:00
b9b8a8ac12 Alltest: added -from and -to options for specifying the directory to run tests from and in
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2022-03-25 23:25:24 +00:00
19b3b2e563 tutorials: reverseBurner: Ignite with temperature constraint
This method of igniting is easier to control than a heat-source based
method. A suitable temperature at which the reaction will take is
typically fairly easy to estimate, whilst determining a heat source
value which achieves the same effect is difficult and is often requires
trial and error.

The new fractional control of value constraints has permitted the use of
fixedTemperatureConstraint in this way; both because it allows for
ramping and for limiting the duration over which the constraint is
applied.
2022-03-23 13:03:42 +00:00
87855d849e tutorials/multiphase/interFoam/RAS/floatingObject: Added controlDict.sixDoF
to be used with dynamicMeshDict.sixDoF to test the deprecated
sixDoFRigidBodyMotion motion solver.
2022-03-19 09:54:13 +00:00
fbf7374bef driftFluxFoam: Added MRF centrifugal acceleration effect to the relativeVelocityModels
This required changing the formulation of the relative velocity in terms of a
scalar velocity coefficient Vc rather than the velocity V0 such that

    V0 = Vc*g

where g is the acceleration due to gravity.  With MRF rotation

    V0 = Vc*(g + <MRF centrifugal acceleration>)
2022-03-17 17:35:15 +00:00
0f88d03f5a tutorials/multiphase/interFoam/RAS/planingHullW3/Allmesh.*: Remove sets after refinement
otherwise renumberMesh fails due to the refinement sets being inconsistent with
the final mesh.
2022-03-16 10:43:27 +00:00
a08bb7bae1 meshQualityDict: Switch off the minVol control by default
It is not clear for what cases the minVol control is useful or necessary and for
some cases it causes problems with snapping and layer addition if not set to a
sufficiently small value.
2022-03-15 14:50:12 +00:00
f2bf348ab2 tutorials/incompressible/icoFoam/cavity: Updated transportProperties -> physicalProperties 2022-03-14 13:50:30 +00:00
bbaba1a645 topoSetDict: Corrected/updated formatting
Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum
Dresden - Rossendorf (HZDR)
2022-03-14 13:49:07 +00:00
373c4993a8 externalWallHeatFluxTemperature: Removed "mode"
Heat power (Q), heat flux (q) and heat transfer coefficient (h)
can now all be specified simultaneously. Their effects will be summed
into a single heat transfer rate. The "mode" keyword is no longer
required.
2022-03-08 10:19:47 +00:00
e7aaae76ac tutorials: reverseBurner: Fix warnings about wedge geometry 2022-03-08 09:16:51 +00:00
16788ffc36 fvMeshDistributorsDistributor: Changed decompose call to support constraints
Resolves bug-report https://bugs.openfoam.org/view.php?id=3812
2022-03-04 18:34:32 +00:00
8cecaa8b6e MultiComponentPhaseModel: Replaced local residualAlpha_ with phase.residualAlpha()
There is no clear need for a residualAlpha to be defined specifically for Yi and
read from the fvSolution dictionary, the phase.residualAlpha() should be
suitable to stabilise the Yi equations.
2022-03-01 18:00:06 +00:00
99cfbd818f blockMesh: Added warning to set defaultPatch appropriately for snappyHexMesh and 2D cases
The defaultPatch type currently defaults to empty which is appropriate for 1D
and 2D cases but not when creating the initial blockMesh for snappyHexMesh as
the presence of empty patches triggers the inappropriate application of 2D point
constraint corrections following snapping and morphing.  To avoid this hidden
problem a warning is now generated from blockMesh when the defaultPatch is not
explicitly set for cases which generate a default patch, i.e. for which the
boundary is not entirely defined.  e.g.

.
.
.
Creating block mesh topology

--> FOAM FATAL IO ERROR:
The 'defaultPatch' type must be specified for the 'defaultFaces' patch, e.g. for snappyHexMesh

    defaultPatch
    {
        name default; // optional
        type patch;
    }

or for 2D meshes

    defaultPatch
    {
        name frontAndBack; // optional
        type empty;
    }
.
.
.

All the tutorials have been update to include the defaultPatch specification as
appropriate.
2022-02-24 21:35:09 +00:00
32e7b52c81 motionSmootherAlgoCheck::checkMesh: improved minVol test and removed unused tests
motionSmootherAlgoCheck::checkMesh is used by snappyHexMesh to check the mesh
after snapping and morphing.  The minVol test which checks for collapsed cells
is now relative to the cube of the minimum bounding box length so that it is
less dependent on the size of the geometry and less likely to need changing for
very small geometries.

The default value is set in
etc/caseDicts/mesh/generation/meshQualityDict
etc/caseDicts/mesh/generation/meshQualityDict.cfg

//- Minimum cell pyramid volume relative to min bounding box length^3
//  Set to a fraction of the smallest cell volume expected.
//  Set to very negative number (e.g. -1e30) to disable.
minVol 1e-10;

The unused minArea and minTriangleTwist tests have been removed
2022-02-24 16:44:34 +00:00
b827c0d740 Compressible solvers: Improved transonic option in the pressure equation
The handling of the div(phid,p) term for transonic support in the pressure
equation is now consistent such that conservation is achieved at convergence of
the pressure system irrespective of the scheme chosen for div(phid,p) and the
relaxation of the pressure equation.

The rhoSimpleFoam tutorials have been updated and improved.
2022-02-22 13:05:40 +00:00
d40ecd78eb buoyantFoam: Merged buoyantSimpleFoam and buoyantPimpleFoam
Solver for steady or transient buoyant, turbulent flow of compressible fluids
for ventilation and heat-transfer, with optional mesh motion and mesh topology
changes.  Created by merging buoyantSimpleFoam and buoyantPimpleFoam to provide
a more general solver and simplify maintenance.
2022-02-18 12:20:54 +00:00
46895490c7 Compressible solver pEqn.H: Standardised the treatment of density
In rhoPimpleFoam, rhoSimpleFoam, buoyantPimpleFoam and buoyantSimpleFoam the
density prediction step at the start of pEqn.H is now consistent between these
solvers and the other compressible solvers.  If the density is relaxed in the
corrector it is now also relaxed following the predictor which improves
consistency, stability and convergence.
2022-02-18 10:33:40 +00:00
fd3cfe4364 tutorials::buoyantCavity::createGraphs: Updated for new sample file format 2022-02-17 09:33:28 +00:00
dbc4b4b20b tutorials::wingMotion_snappyHexMesh::blockMeshDict: replaced symmetryPlane with patch
to ensure createPatch removes the original front and back patches after
extrusion.
2022-02-10 19:54:58 +00:00
c468a63830 compressibleInterFoam::VoFSurfaceFilm: Added maxDeltaT
to limit the time-step by comparing the film Courant number with the maximum
Courant number obtain from the optional maxCo entry in the system/<film
region>/fvSolution file.  If maxCo is not provided the film model does not limit
the time-step.

See tutorials/multiphase/compressibleInterFoam/laminar/cylinder as an example
demonstrating this functionality.
2022-02-09 11:45:42 +00:00
fec6837f8f tutorials/multiphase: totalPressure -> prghTotalPressure
For most multiphase flows it is more appropriate to evaluate the total pressure
from the static pressure obtained from p_rgh rather than from p_rgh directly.
2022-02-07 12:32:20 +00:00
f85f45fe4b tutorials/multiphase/interFoam/laminar/wave: Added tangentialVelocity to top boundary
to match the air flow in the domain.
2022-02-06 19:21:33 +00:00
5df9ec5b1e tutorials/heatTransfer/buoyantSimpleFoam: Updated solver settings to improve convergence
Also changed from internal energy to enthalpy which is preferable for
steady-state simulations.
2022-02-06 11:44:07 +00:00
6d91cb289c tutorials::counterFlowFlame2D_GRI, floatingObject: Added -cellDist
to write the cellDist processor distribution files for
decomposition/redistribution post-processing and diagnostics.
2022-02-01 11:33:02 +00:00
360fd3f804 tutorials/multiphase/interFoam/RAS/DTCHull: Improved LTS settings
Following a rationalisation of the Courant number used to set the LTS time-step
the LTS settings needed to be changed to improve convergence.
2022-01-29 09:10:39 +00:00
ba130ec083 multiphase: Rationalised alphaContactAngle handling
Alpha contact angle boundaries are now specified in the following way
for multiphase solvers (i.e., multiphaseInterFoam,
compressibleMultiphaseInterFoam, and multiphaseEulerFoam):

   boundaryField
   {
       wall
       {
           type            alphaContactAngle;
           contactAngleProperties
           {
               water
               {
                   // Constant contact angle
                   theta0 90;
               }
               oil
               {
                   // Dynamic contact angle
                   theta0 90;
                   uTheta 1;
                   thetaA 125;
                   thetaR 85;
               }
           }
           value           uniform 0;
       }
   }

All solvers now share the same implementation of the alphaContactAngle
boundary condition and the contact angle correction algorithm.

If alpha contact angle boundary conditions are used they must be
specified for all phases or an error will result. The consistency of the
input will also be checked. The angles given for water in the alpha.air
file must be 180 degrees minus the angles given for air in the
alpha.water file.
2022-01-28 17:25:22 +00:00
fbe65c0865 tutorials/multiphase/multiphaseEulerFoam: Multiphase blending changes
Updated tutorials for the changes to the blending system. Cases using
"none" blending have been updated to use "continuous" or "segregated" as
appropriate.

The bed tutorial has been extended to include a proper switch to a bed
drag model (AttouFerschneider) when the solid phase displaces the
fluids. This change made the trickleBed case a subset of the bed case,
so the trickleBed has been removed.
2022-01-28 09:24:28 +00:00
64a6562a1e tutorials/multiphase/multiphaseEulerFoam: Backwards compatible changes
These changes are not required for the cases to run with the new
phaseInterface system. The syntax prior to this commit will be read in
the new phaseInterface system's backwards compatibility mode.
2022-01-28 09:24:28 +00:00