Commit Graph

7106 Commits

Author SHA1 Message Date
3c18db77ed multiphaseEuler::StationaryPhaseModel: Replaced functions returning 0 with notImplemented
requiring all parts of the moving phase solution algorithm to loop and operate
on the moving phases only making the code easier to understand and maintain.
2023-09-03 10:21:31 +01:00
ba772c03e6 multiphaseEuler::MomentumTransferPhaseSystem: Only cache the drag coefficients if needed
The virtual mass and face drag coefficients are no longer cached saving some
storage.
2023-09-01 22:55:50 +01:00
6558f63293 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-09-01 13:13:31 +01:00
18200e72a6 multiphaseEuler: Update the virtual-mass force implementation
The central coefficient part of the virtual-mass phase acceleration matrix is
now included in the phase velocity transport central coefficient + drag matrix
so that the all the phase contributions to each phase momentum equation are
handled implicitly and consistently without lagging contribution from the other
phases in either the pressure equation or phase momentum correctors.

This improves the conditioning of the pressure equation and convergence rate of
bubbly-flow cases.
2023-09-01 13:07:00 +01:00
eebd2d46d4 populationBalance: Fix typo 2023-08-31 13:42:53 +01:00
a83f23828b populationBalance: Corrected fraction field registration 2023-08-31 13:28:58 +01:00
85791217a8 tutorials/multiphaseEuler/hydrofoil: Improve graph formatting 2023-08-31 12:05:40 +01:00
fe4ec3a2dc test: Simplified dimensionless specification from [0 0 0 0 0 0 0] -> [] 2023-08-31 12:05:40 +01:00
a05df4abe0 populationBalance: Standardise default field handling
Population balance size-group fraction 'f<index>.<phase>' fields are now
read from an 'fDefault.<phase>' field if they are not provided
explicitly. This is the same process as is applied to species fractions
or fvDOM rays. The sum-of-fs field 'f.<phase>' is no longer required.

The value of a fraction field and its boundary conditions must now be
specified in the corresponding field file. Value entries are no longer
given in the size group dictionaries in the constant/phaseProperties
file, and an error message will be generated if a value entry is found.

The fraction fields are now numbered programatically, rather than being
named. So, the size-group dictionaries do not require a name any more.

All of the above is also true for any 'kappa<index>.<phase>' fields that
are constructed and solved for as part of a fractal shape model.

The following is an example of a specification of a population balance
with two phases in it:

    populationBalances (bubbles);

    air1
    {
        type            pureIsothermalPhaseModel;
        diameterModel   velocityGroup;
        velocityGroupCoeffs
        {
            populationBalance bubbles;
            shapeModel      spherical;
            sizeGroups
            (
                { dSph 1e-3; } // Size-group #0: Fraction field f0.air1
                { dSph 2e-3; } // ...
                { dSph 3e-3; }
                { dSph 4e-3; }
                { dSph 5e-3; }
            );
        }
        residualAlpha   1e-6;
    }

    air2
    {
        type            pureIsothermalPhaseModel;
        diameterModel   velocityGroup;
        velocityGroupCoeffs
        {
            populationBalance bubbles;
            shapeModel      spherical;
            sizeGroups
            (
                { dSph 6e-3; } // Size-group #5: Fraction field f5.air2
                { dSph 7e-3; } // ...
                { dSph 8e-3; }
                { dSph 9e-3; }
                { dSph 10e-3; }
                { dSph 11e-3; }
                { dSph 12e-3; }
            );
        }
        residualAlpha   1e-6;
    }

Previously a fraction field was constructed automatically using the
boundary condition types from the sum-of-fs field, and the value of both
the internal and boundary field was then overridden by the value setting
provided for the size-group. This procedure doesn't generalise to
boundary conditions other than basic types that store no additional
data, like zeroGradient and fixedValue. More complex boundary conditions
such as inletOutlet and uniformFixedValue are incompatible with this
approach.

This is arguably less convenient than the previous specification, where
the sizes and fractions appeared together in a table-like list in the
sizeGroups entry. In the event that a substantial proportion of the
size-groups have a non-zero initial fraction, writing out all the field
files manually is extremely tedious. To mitigate this somewhat, a
packaged function has been added to initialise the fields given a file
containing a size distribution (see the pipeBend tutorial for an example
of its usage). This function has the same limitations as the previous
code in that it requires all boundary conditions to be default
constructable.

Ultimately, the "correct" fix for the issue of how to set the boundary
conditions conveniently is to create customised inlet-outlet boundary
conditions that determine their field's position within the population
balance and evaluate a distribution to determine the appropriate inlet
value. This work is pending funding.
2023-08-31 12:05:12 +01:00
a0c391b8bd multiphaseEuler: Corrected handling of pRef 2023-08-30 14:16:09 +01:00
381e95039b tutorials/multiphaseEuler/mixerVessel2D: Removed 0/alpha.map file 2023-08-30 14:16:09 +01:00
5dade27f25 codedBase: Added support for arbitrary entry names
Non-alphanumeic characters in the name of the coded object are now *all*
replaced by underscores. This means functions with complex names (i.e.,
like those resulting from command line substitutions) can now be
compiled.
2023-08-30 13:53:54 +01:00
b01930e078 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-08-30 13:33:19 +01:00
a91e7ea6d3 multiphaseEuler::MomentumTransferPhaseSystem::alphaDByAf: Only consider pPrime for moving phases 2023-08-30 13:32:20 +01:00
ea594573b8 bash_completion: updated 2023-08-29 18:16:56 +01:00
abb919c6d8 templates/closedVolume: reinstated relaxationFactors 2023-08-29 11:39:35 +01:00
b9a8910739 includeFvModel: now searches the constant directory for local configuration files 20230829 2023-08-28 23:31:54 +01:00
30940e0e1d Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-08-28 20:32:49 +01:00
6054b1fea0 objectRegistry, regIOobject: Added support for automatic re-reading of dependent class
Now with the addition of the optional dependenciesModified() function classes
which depend on other classes which are re-read from file when modified are also
automatically updated via their read() function called by
objectRegistry::readModifiedObjects.

This significantly simplifies the update of the solutionControls and modular
solvers when either the controlDict or fvSolution dictionaries are modified at
run-time.
2023-08-28 20:28:39 +01:00
7390fc15a9 Merge branch 'master' of github.com:OpenFOAM/OpenFOAM-dev 2023-08-28 10:50:49 +01:00
53e40f6c8d packaged fvConstraints: formatting 2023-08-28 10:29:30 +01:00
11c6751927 constrainHbyA: Removed the now redundant constrainH function 2023-08-26 17:07:19 +01:00
5fd30443f3 multiphaseEuler: New implicit drag algorithm replaces partial-elimination corrector
The momentum equation central coefficient and drag matrix is formulated,
inverted and used to eliminate the drag terms from each of the phase momentum
equations which are combined for formulate a drag-implicit pressure equation.
This eliminates the lagged drag terms from the previous formulation which
significantly improves convergence for small particle and Euler-VoF high-drag
cases.

It would also be possible to refactor the virtual-mass terms and include the
central coefficients of the phase acceleration terms in the drag matrix before
inversion to further improve the implicitness of the phase momentum-pressure
coupling for bubbly flows.  This work is pending funding.
2023-08-26 10:09:38 +01:00
49c69872e5 externalTemperatureFvPatchScalarField: Changed fixesValue() to true
With the change the boundary temperature is updated only via the evaluate call
rather than derived from the corresponding energy solution.  This has proved
more stable and convergent for the wallBoiling cases.
2023-08-26 10:07:02 +01:00
46ececfc19 genericFvPatchFields: Fix documentation typo 2023-08-25 10:13:47 +01:00
0433bd3e00 genericFields: Library reorganisation and reduce duplication 2023-08-25 09:46:40 +01:00
ba416ac909 fvMeshStitcher: Standardise mesh change hooks 2023-08-24 12:10:45 +01:00
089aa672d5 caseDicts: added skeleton fvModels and fvConstraints files 2023-08-23 12:55:40 +01:00
af0552e9f0 templates/compressibleInflowOutflow: corrected fvSchemes 2023-08-23 12:46:56 +01:00
075c358fb9 snappyHexMeshConfig: layers can be specified for individual surfaces 2023-08-22 16:48:11 +01:00
be88a99ecd Cloud: Delete all particles that fail to map 2023-08-22 11:40:30 +01:00
bf8b8596f8 polyMesh: Use appropriate boundary meshes when swapping patches 2023-08-22 11:40:30 +01:00
af9afec754 snappyHexMeshConfig: allow a cylindrical background mesh without a rotating zone 2023-08-18 16:46:06 +01:00
66d3b49eb5 contactAngleFvPatchScalarField: Added documentation 2023-08-18 10:32:50 +01:00
4e7ee7ed65 primitiveFaceZone: Removed
This definition was incorrect, and the correct form is not needed as it
is the same as indirectPrimitivePatch

Resolves bug report https://bugs.openfoam.org/view.php?id=4008
2023-08-18 08:54:25 +01:00
dd23a7dbe8 Template cases: automatically set relaxationFactors for steady-state and transient simulation 2023-08-17 09:21:39 +01:00
07b434e098 Template cases: remove redundant PISO settings in fvSolution 2023-08-16 18:45:22 +01:00
e3b53f2727 multiphaseEuler: Fix indexing bug in partial elimination 2023-08-16 16:03:32 +01:00
7ab2321a07 multicomponentThermo: Fix for singleComponentMixture
This prevents a segfault when using singleComponentMixture and no mass
fraction fields are stored

Resolves bug report https://bugs.openfoam.org/view.php?id=4006
2023-08-16 09:34:17 +01:00
6d9bc62fa9 foamDictionary: Added -output option
to specify the path name of the output dictionary to which the expanded and/or
changed dictionary is written.

Usage: foamDictionary [OPTIONS] <dictionary file>
options:
  -add <value>      Add a new entry
  -case <dir>       specify alternate case directory, default is the cwd
  -dict             Set, add or merge entry from a dictionary.
  -diff <dict>      Write differences with respect to the specified dictionary
  -entry <name>     report/select the named entry
  -expand           Read the specified dictionary file and expand the macros
                    etc.
  -fileHandler <handler>
                    override the fileHandler
  -hostRoots <((host1 dir1) .. (hostN dirN))>
                    slave root directories (per host) for distributed running
  -includes         List the #include/#includeIfPresent files to standard output
  -keywords         list keywords
  -libs '("lib1.so" ... "libN.so")'
                    pre-load libraries
  -merge <value>    Merge entry
  -noFunctionObjects
                    do not execute functionObjects
  -output <path name>
                    Path name of the output dictionary
  -parallel         run in parallel
  -remove           Remove the entry.
  -roots <(dir1 .. dirN)>
                    slave root directories for distributed running
  -set <value>      Set entry value, add new entry or apply list of
                    substitutions
  -value            Print entry value
  -writePrecision <label>
                    Write with the specified precision
  -srcDoc           display source code in browser
  -doc              display application documentation in browser
  -help             print the usage

manipulates dictionaries
2023-08-10 21:24:44 +01:00
89db32a3a7 foamDictionary: Corrected handling of the -case option
Now if the -case option is specified the dictionary path provided is treated as
relative to the case path, e.g.

foamDictionary -expand -case shockFluid/shockTube system/controlDict
2023-08-10 20:28:54 +01:00
9e296d3040 dimensionedType: Make read flexible as to the presence of a name 2023-08-10 10:37:33 +01:00
cce5bc9e40 HookFunctions: Prevent expansion prior to command evaluation 2023-08-09 16:29:00 +01:00
a2314a5a23 multicomponentThermo: Construct Yslicer on demand
This fixes a crash caused by the pointers to the mass fraction boundary
fields being invalidated by mesh-to-mesh mapping
2023-08-09 15:10:23 +01:00
b790a69507 DimensionedFunction1: Permit setting argument-dimensions of inline functions
Both argument and value dimensions can be set for inline-constructable
function1-s. For example, this inline table function:

    massFlowRate table [CAD] [g/s]
    (
        (0 0.46)
        (0.17 1.9)
        (0.31 4.8)
    );

Is equivalent to this dictionary specification:

    massFlowRate
    {
        type    table;
        xDimensions [CAD];
        dimensions [g/s];
        values
        (
             (0 0.46)
             (0.17 1.9)
             (0.31 4.8)
        );
    }

In the inline form, the argument/x-dimensions come first, and the value
dimensions second. If there only one dimension set provided, then this
is assumed to be the value dimensions.
2023-08-09 12:30:44 +01:00
9a7b9e9229 ConeInjection: Permit unit specification for dInner/dOuter 2023-08-08 16:29:51 +01:00
a693bf009d IrreversibleReaction: Formatting 2023-08-08 16:18:01 +01:00
95589f6973 dimensionSets: Removed writeSets
The functionality necessary to write in a different unit set has been
removed. This was excessivelty complex, never used in practice, and of
little practical usage. Output numeric data, in general, is not designed
to be conveniently user-readable, so it is not important what unit
system it is written in.
2023-08-08 16:17:57 +01:00
fd2f932bfe DimensionSets: Added milliseconds [ms] and microseconds [us] 2023-08-08 13:12:03 +01:00
bf044f5c47 DimensionedFunction1: Function1 with dimensions
This can be used identically to a standard Function1. In addition, it
also permits specification of the dimensions. This allows the dimensions
to be checked. It also permits unit conversions. For example:

    <name>
    {
        type        table;

        // Dimensions
        xDimensions [CAD];  // Optional. Argument dimensions/units.
                            // Here, this specifies coordinates are in
                            // crank angle degrees (available if using
                            // engine time).
        dimensions  [mm];   // Optional. Value dimensions/units.
                            // Here, values are in mm.

        // Tablulated data
        values
        (
            (0 0)
            (60 12)         // <-- i.e., 12 mm at 60 degrees
            (180 20)
            (240 8)
            (360 0)
        );
        outOfBounds repeat;
    }

This replaces TimeFunction1, as it allows per-function control over
whether the function is considered to be one of real-time or user-time.
2023-08-08 13:11:59 +01:00