750 Commits

Author SHA1 Message Date
c25313dc14 nonConformalCHT: new template case for CHT using NCC interface
The nonConformalCHT template case is designed to help create a conjugate
heat transfer (CHT) simulation in which fluid and solid regions are
coupled with non-conformal coupled (NCC) interfaces.  It includes an
Allmesh script which provides example commands to generate the meshes
for the fluid and solid regions using the 'snappyHexMeshConfig' utility,
and to generate NCC interfaces using 'createNonConformalCouples'.  The
remaining workflow to configure and run the CHT simulation is similar to
the 'singleFluidCHT' template case.
2025-01-31 12:27:19 +00:00
f05ff64c91 singleFluidCHT template case: minor corrections and improvements 2025-01-31 12:18:17 +00:00
999196b7c1 bash_completion: updated 2024-12-13 17:39:39 +00:00
5829755744 etc/bashrc: Allow parameter/prefs modification of user and site paths 2024-11-26 14:34:08 +00:00
29e2c93dc1 foamNewBC: Reinstate time method
This serves as an example of the creation of a private method. It no
longer needs to convert the Function1 argument to user time, following
the addition of generalised unit conversion.
2024-10-17 14:06:14 +01:00
275189c0c2 bash_completion: updated 2024-07-28 10:13:41 +01:00
c59e5ce983 Updated for OpenFOAM-12 2024-07-06 16:02:47 +01:00
5babe5c67c Documentation: Updated for Doxygen 1.11.0
Typos in documentation strings corrected with the aid of codespell
2024-07-06 10:32:56 +01:00
8eae989a1c etc: ThirdParty Zoltan and system ParaView by default 2024-07-05 10:13:16 +01:00
dab3104d4c functionObjects::specieFlux: New functions to calculate specie fluxes
These functions calculate the specie-flux and write it as a
surfaceScalarField called 'specie<Type>Flux(<specieName>)'. There are
three such functions; specieAdvectiveFlux and specieDiffusiveFlux return
the advective and diffusive parts of the flux, respectively, and
specieFlux returns the total combined flux.

Example of function object specification:

    specieFlux
    {
        type    specieFlux; // specieAdvectiveFlux, specieDiffusiveFlux
        libs    ("libfieldFunctionObjects.so");
        field   NH3;
    }

Or, using the standard configuration:

    #includeFunc specieFlux(NH3)
2024-07-04 14:54:59 +01:00
4fd55976d5 bash_completion: updated 2024-06-27 12:47:43 +01:00
8bf9afff11 Time: Removed the deprecated timeName() function
use name() instead.
2024-06-26 11:38:49 +01:00
efa45475f2 src/parallel/decompose: Add option to specify system installation directories 2024-06-13 11:33:33 +01:00
48fcb7f6d1 etc: Explicit control of decomposition and ParaView installation type
*** Note that this commit depends on a corresponding change in
ThirdParty-dev. Ensure that both repositories are up to date before
re-building OpenFOAM.

New environment variables have been added to explicitly control the
installation type of the thirdparty decomposition libraries and of the
ParaView visualiation software. These are set in the etc/bashrc and can
be overridden in a ~/.OpenFOAM/<version>/prefs.sh file or similar.

The variables relating to the decomposition libraries are SCOTCH_TYPE,
METIS_TYPE, PARMETIS_TYPE and ZOLTAN_TYPE, and they can take values of
none, system, or ThirdParty. In the case of ThirdParty, a
<library>_VERSION variable can also be specified. If the version is not
specified then the configuration will search for a source directory, and
if multiple such directories are found then the one with the highest
version number will be used.

The variable relating to ParaView is ParaView_TYPE, and this can be
similarly be set to none, system, or ThirdParty, and ParaView_VERSION
can also be specified when the type is ThirdParty. If the version is not
specified then the installation with the highest version number will be
used.

An example  ~/.OpenFOAM/dev/prefs.sh file, in which all decomposition
libraries are enabled, and the Scotch and ParaView versions are
explicitly set, is as follows:

    export SCOTCH_TYPE=ThirdParty
    export SCOTCH_VERSION=7.0.3
    export METIS_TYPE=ThirdParty
    export PARMETIS_TYPE=ThirdParty
    export ZOLTAN_TYPE=ThirdParty

    export ParaView_TYPE=ThirdParty
    export ParaView_VERSION=5.11.2

*** Note that if version numbers are not set then the configuration will
search for a decomposition source directory, but it will search for a
ParaView installation directory. This is because decomposition libraries
are built as part of OpenFOAM's ./Allwmake, but ParaView is not. This
distinction remains. If a local compilation of ParaView is needed, then
'./makeParaView -version X.XX.X' should be called explicitly in the
third party directory prior to building OpenFOAM.

The name of the third party directory can now also be independently set.
This simplifies some packaging processes in that it permits third party
to be located within the OpenFOAM installation directory and therefore
bundled into the same binary package.
2024-06-06 15:20:19 +01:00
a9742de070 paraview: Prevent clean of standard directories in PATH 2024-06-06 15:11:34 +01:00
40bcabf79f decompositionMethods::parMetis: New interface to the ParMETIS distributor for load-balancing
ParMETIS is a parallel version of METIS and can be used as an alternative to
ptScotch or Zoltan, supporting multi-constraints and redistribution:

Description
    ParMetis redistribution in parallel

    Note: parMetis methods do not support serial operation.

    Parameters
    - Method of decomposition
      - kWay: multilevel k-way
      - geomKway: combined coordinate-based and multi-level k-way
      - adaptiveRepart: balances the work load of a graph

    - Options
      - options[0]: The specified options are used if options[0] = 1

      - options[1]: Specifies the level of information to be returned during
        the execution of the algorithm. Timing information can be obtained by
        setting this to 1. Additional options for this parameter can be obtained
        by looking at parmetis.h. Default: 0.

      - options[2]: Random number seed for the routine

      - options[3]: Specifies whether the sub-domains and processors are coupled
        or un-coupled.  If the number of sub-domains desired (i.e., nparts) and
        the number of processors that are being used is not the same, then these
        must be un-coupled. However, if nparts equals the number of processors,
        these can either be coupled or de-coupled. If sub-domains and processors
        are coupled, then the initial partitioning will be obtained implicitly
        from the graph distribution. However, if sub-domains are un-coupled from
        processors, then the initial partitioning needs to be obtained from the
        initial values assigned to the part array.

    - itr: Parameter which describes the ratio of inter-processor communication
      time compared to data redistribution time.  Should be set between 0.000001
      and 1000000.0.  If set high, a repartitioning with a low edge-cut will be
      computed. If it is set low, a repartitioning that requires little data
      redistribution will be computed.  Good values for this parameter can be
      obtained by dividing inter-processor communication time by data
      redistribution time. Otherwise, a value of 1000.0 is recommended.
      Default: 1000.

The ParMETIS sources can be downloaded and compiled in ThirdParty-dev using the
link in the README file and the compilation commands in Allwmake.

Note the specific license under which ParMETIS is released:

Copyright & License Notice
--------------------------

The ParMETIS package is copyrighted by the Regents of the
University of Minnesota. It can be freely used for educational and
research purposes by non-profit institutions and US government
agencies only. Other organizations are allowed to use ParMETIS
only for evaluation purposes, and any further uses will require prior
approval. The software may not be sold or redistributed without prior
approval. One may make copies of the software for their use provided
that the copies, are not sold or distributed, are used under the same
terms and conditions.

As unestablished research software, this code is provided on an
``as is'' basis without warranty of any kind, either expressed or
implied. The downloading, or executing any part of this software
constitutes an implicit agreement to these terms. These terms and
conditions are subject to change at any time without prior notice.
2024-05-22 15:30:46 +01:00
f8b5d71e25 Function1: Preferentially construct from separate unit conversion arguments 2024-05-21 12:43:16 +01:00
476bb42b04 unitConversion: Unit conversions on all input parameters
The majority of input parameters now support automatic unit conversion.
Units are specified within square brackets, either before or after the
value. Primitive parameters (e.g., scalars, vectors, tensors, ...),
dimensioned types, fields, Function1-s and Function2-s all support unit
conversion in this way.

Unit conversion occurs on input only. OpenFOAM writes out all fields and
parameters in standard units. It is recommended to use '.orig' files in
the 0 directory to preserve user-readable input if those files are being
modified by pre-processing applications (e.g., setFields).

For example, to specify a volumetric flow rate inlet boundary in litres
per second [l/s], rather than metres-cubed per second [m^3/s], in 0/U:

    boundaryField
    {
        inlet
        {
            type            flowRateInletVelocity;
            volumetricFlowRate 0.1 [l/s];
            value           $internalField;
        }

        ...
    }

Or, to specify the pressure field in bar, in 0/p:

    internalField   uniform 1 [bar];

Or, to convert the parameters of an Arrhenius reaction rate from a
cm-mol-kcal unit system, in constant/chemistryProperties:

    reactions
    {
        methaneReaction
        {
            type    irreversibleArrhenius;
            reaction "CH4^0.2 + 2O2^1.3 = CO2 + 2H2O";
            A       6.7e12 [(mol/cm^3)^-0.5/s];
            beta    0;
            Ea      48.4 [kcal/mol];
        }
    }

Or, to define a time-varying outlet pressure using a CSV file in which
the pressure column is in mega-pascals [MPa], in 0/p:

    boundaryField
    {
        outlet
        {
            type            uniformFixedValue;
            value
            {
                type            table;
                format          csv;
                nHeaderLine     1;
                units           ([s] [MPa]); // <-- new units entry
                columns         (0 1);
                mergeSeparators no;
                file            "data/pressure.csv";
                outOfBounds     clamp;
                interpolationScheme linear;
            }
        }

        ...
    }

(Note also that a new 'columns' entry replaces the old 'refColumn' and
'componentColumns'. This is is considered to be more intuitive, and has
a consistent syntax with the new 'units' entry. 'columns' and
'componentColumns' have been retained for backwards compatibility and
will continue to work for the time being.)

Unit definitions can be added in the global or case controlDict files.
See UnitConversions in $WM_PROJECT_DIR/etc/controlDict for examples.
Currently available units include:

    Standard: kg m s K kmol A Cd

     Derived: Hz N Pa J W g um mm cm km l ml us ms min hr mol
              rpm bar atm kPa MPa cal kcal cSt cP % rad rot deg

A user-time unit is also provided if user-time is in operation. This
allows it to be specified locally whether a parameter relates to
real-time or to user-time. For example, to define a mass source that
ramps up from a given engine-time (in crank-angle-degrees [CAD]) over a
duration in real-time, in constant/fvModels:

    massSource1
    {
        type        massSource;
        points      ((1 2 3));
        massFlowRate
        {
            type        scale;
            scale       linearRamp;
            start       20 [CAD];
            duration    50 [ms];
            value       0.1 [g/s];
        }
    }

Specified units will be checked against the parameter's dimensions where
possible, and an error generated if they are not consistent. For the
dimensions to be available for this check, the code requires
modification, and work propagating this change across OpenFOAM is
ongoing. Unit conversions are still possible without these changes, but
the validity of such conversions will not be checked.

Units are no longer permitted in 'dimensions' entries in field files.
These 'dimensions' entries can now, instead, take the names of
dimensions. The names of the available dimensions are:

    Standard: mass length time temperature
              moles current luminousIntensity

     Derived: area volume rate velocity momentum acceleration density
              force energy power pressure kinematicPressure
              compressibility gasConstant specificHeatCapacity
              kinematicViscosity dynamicViscosity thermalConductivity
              volumetricFlux massFlux

So, for example, a 0/epsilon file might specify the dimensions as
follows:

    dimensions      [energy/mass/time];

And a 0/alphat file might have:

    dimensions      [thermalConductivity/specificHeatCapacity];

*** Development Notes ***

A unit conversion can construct trivially from a dimension set,
resulting in a "standard" unit with a conversion factor of one. This
means the functions which perform unit conversion on read can be
provided dimension sets or unit conversion objects interchangeably.

A basic `dict.lookup<vector>("Umean")` call will do unit conversion, but
it does not know the parameter's dimensions, so it cannot check the
validity of the supplied units. A corresponding lookup function has been
added in which the dimensions or units can be provided; in this case the
corresponding call would be `dict.lookup<vector>("Umean", dimVelocity)`.
This function enables additional checking and should be used wherever
possible.

Function1-s and Function2-s have had their constructors and selectors
changed so that dimensions/units must be specified by calling code. In
the case of Function1, two unit arguments must be given; one for the
x-axis and one for the value-axis. For Function2-s, three must be
provided.

In some cases, it is desirable (or at least established practice), that
a given non-standard unit be used in the absence of specific
user-defined units. Commonly this includes reading angles in degrees
(rather than radians) and reading times in user-time (rather than
real-time). The primitive lookup functions and Function1 and Function2
selectors both support specifying a non-standard default unit. For
example, `theta_ = dict.lookup<scalar>("theta", unitDegrees)` will read
an angle in degrees by default. If this is done within a model which
also supports writing then the write call must be modified accordingly
so that the data is also written out in degrees. Overloads of writeEntry
have been created for this purpose. In this case, the angle theta should
be written out with `writeEntry(os, "theta", unitDegrees, theta_)`.
Function1-s and Function2-s behave similarly, but with greater numbers
of dimensions/units arguments as before.

The non-standard user-time unit can be accessed by a `userUnits()`
method that has been added to Time. Use of this user-time unit in the
construction of Function1-s should prevent the need for explicit
user-time conversion in boundary conditions and sub-models and similar.

Some models might contain non-typed stream-based lookups of the form
`dict.lookup("p0") >> p0_` (e.g., in a re-read method), or
`Umean_(dict.lookup("Umean"))` (e.g., in an initialiser list). These
calls cannot facilitate unit conversion and are therefore discouraged.
They should be replaced with
`p0_ = dict.lookup<scalar>("p0", dimPressure)` and
`Umean_(dict.lookup<vector>("Umean", dimVelocity))` and similar whenever
they are found.
2024-05-16 09:01:46 +01:00
47fa9bc620 snappyHexMesh: Corrected use of layer featureAngle
The 'featureAngle' control defines the included angle between faces
above which layer extrusion is prevented. Its use within snappyHexMesh
was incorrect in that the cosine was not being taken before being
compared to dot products of face normals. This has now been corrected.

Existing 'featureAngle' settings may need changing to recover equivalent
behaviour. Any angle previously set to 58 degrees or above previously
resulted in no reduction of layer coverage. A large angle between 90 and
180 degrees is likely to be an appropriate replacement for cases such as
this. Angles previously set to 57 degrees and below can be equivalently
replaced by a value of (180/pi)*arccos(<angle>*(pi/180)).

Note that changing the feature angle also affects the slip feature
angle. The slip feature angle is taken to be half the feature angle if a
'slipFeatureAngle' is not specified.
2024-05-09 14:15:38 +01:00
f9ac53aab4 bin/foamFind: added '-edit' option to open file in a text editor
The editor must be specified by configuring the EDITOR environment
variable. For example to use the 'gedit' editor, the following entry
could be added to the user's .bashrc file:

export EDITOR=gedit
2024-04-19 20:53:00 +01:00
3bd79f0447 bash_completion: Added reorderPatches 2024-04-17 17:38:33 +01:00
c15bd5914b functionObjects::userTimeStep: New functionObject to write the time-step in user-time units 2024-04-10 14:13:58 +01:00
1c6d785c1c foamFind: script to find files in OpenFOAM and optionally process the contents
by printing their contents or lines which match a search string.

Usage: ${0##*/} [OPTIONS] <filename>
options:
  -a | -applications     search for the file from the \$FOAM_APP directory
  -d | -dir <dir>        specify search directory
  -f | -files            find wmake 'files' file associated with searched file
  -h | -help             help
  -i | -isearch <string> searches files for a <string>, case insensitive
  -m | -modules          search for the file from the \$FOAM_MODULES directory
  -n | -numbers          print line numbers with file output
  -o | -options          find wmake 'options' file associated with searched file
  -p | -print            print the file(s)
  -s | -search <string>  searches files for a <string>, case sensitive
  -t | -tutorials        search for the file from the \$FOAM_TUTORIALS directory

Finds one or more files in OpenFOAM and optionally processes the contents by:
+ printing the file ('-print' option);
+ printing lines within the file matching a search string ('-search' option).

With source code files, can locate the 'files' and 'options' files associated
with their compilation using 'wmake'.

By default, files are searched from the src (\$FOAM_SRC) directory.
Alternatively the '-dir' option allows the user to specify the search directory
The '-applications', '-modules' and '-tutorials' options specifically set the
search path to the \$FOAM_APP, \$FOAM_MODULES and \$FOAM_TUTORIALS directories,
respectively.

Examples:
    foamFind -print wallHeatFlux.C | less
    + click space bar to scroll down
    + enter line number (after ":") to jump to line
    + enter "/text" to search for "text" (or any other string)

    foamFind -applications -isearch "momentumtransport" -options fluid.C
    foamFind -numbers -search laminar BirdCarreau.C
2024-04-05 13:28:41 +01:00
33aa449682 extrudeMesh: Added optional generation of cellZones for the extruded cells
For a case extruding patches left and right:

    sourcePatches   (left right);

if the optional zoneNames entry is also specified in extrudeMeshDict

    zoneNames       (leftCells rightCells);

the cells extruded from the left patch are added to the leftCells cellZone and
the cells extruded from the right patch are added to the rightCells cellZone.

Alternatively if a single zone name is specified, e.g.

    zoneNames       (extrudedCells);

then cells extruded from the left and right patches are added to the
extrudedCells cellZone.

If the number of patches to extrude is large it might be more convenient for
the cells extruded from each patch to be added to a cellZone named the same as
each patch, this option is selected by setting zoneNames to patchNames:

    zoneNames       (patchNames);
2024-03-19 11:16:16 +00:00
4b6b492408 renumberMesh: Removed the deprecated and unmaintained zoltan option 2024-03-16 23:43:32 +00:00
9d4fe93bc6 utilities/mesh/manipulation/rotateMesh: Removed
This utility is superseded by the much more general transformPoints. A
rotation between vectors (0 1 0) and (0.707107 0.707107 0), and a
corresponding transformation of all vector and tensor fields, can be
achieved with the following call to transformPoints:

    transformPoints "rotate=((0 1 0) (0.707107 0.707107 0))" -rotateFields
2024-03-08 16:21:32 +00:00
1622e19021 functionObjects::cylindrical: Added packaged configuration
This function can now be run interactively using the following command:

    foamPostProcess -func "cylindrical(origin=(0 0 0), axis=(0 0 1), U)"

Or it can be executed at run time by adding the following entry in the
system/functions file:

    #includeFunc cylindrical(origin=(0 0 0), axis=(0 0 1), U)
2024-02-28 10:46:10 +00:00
646a9f6fd9 etc/config.sh/bash_completion: Updated 2024-02-21 19:25:24 +00:00
11be8e6a3f etc/caseDicts/functionTemplates: dedicated location for template (coded) functions 2024-02-21 16:15:09 +00:00
811faaa0be etc/caseDicts/functions/coded: added example coded function objects 2024-02-20 18:47:06 +00:00
eaf0531aa0 etc/caseDicts: Added postProcessing directory link for backwards compatibility 2024-02-20 15:37:44 +00:00
9753b67f30 multiValveEngineState: New functionObject to print and log the piston and valve motion
for the multiValveEngine fvMeshMover.  This replaced the hard-coded messages
printed by the multiValveEngine class, providing automatic logging of the piston
and valve speed and position and easy user extension or replacement to provide
additional case-specific diagnostics without having to hack the core
multiValveEngine code.  A functionObject configuration file is provided so that
the simple line

can be added to the system/functions file to enable this functionObject.
2024-02-15 19:25:40 +00:00
c84e216282 fvMeshMovers: Rationalised directory structure and library naming convention
to support additional movers in a more modular fashion so that they can be
loaded individually.
2024-02-13 21:26:52 +00:00
a3e38977c6 nonConformalMappedWall: New patch type for connecting regions
A new nonConformalMappedWall patch type has been added which can couple
between different regions of a multi-region simulation. This patch type
uses the same intersection algorithm as the nonConformalCyclic patch,
which is used for coupling sections of a mesh within the same region.

The nonConformalMappedWall provides some advantages over the existing
mappedWall patches:

  - The connection it creates is not interpolative. It creates a pair of
    coupled finite-volume faces wherever two opposing faces overlap.
    There is therefore no interpolation error associated with mapping
    values across the coupling.

  - Faces (or parts of faces) which do not overlap are not normalised
    away by an interpolation or averaging process. Instead, they are
    assigned an alternative boundary condition; e.g., an external
    constraint, or even another non-conformal cyclic or mapped wall.
    This makes the system able to construct partially-overlapping
    couplings.

  - The direct non-interpolative transfer of values between the patches
    makes the method equivalent to a conformal coupling. Properties of
    the solution algorithm, such as conservation and boundedness, are
    retained regardless of the non-conformance of the boundary meshes.

  - All constructed finite volume faces have accurate centre points.
    This makes the method second order accurate in space.

Usage:

Non-conformal mapped wall couplings are constructed as the last stage of
a multi-region meshing process. First, a multi-region mesh is
constructed in one of the usual ways, but with the boundaries specified
as standard non-coupled walls instead of a special mapped type. Then,
createNonConformalCouples is called to construct non-conformal mapped
patches that couple overlapping parts of these non-coupled walls. This
process is very similar to the construction of non-conformal cyclics.

createNonConformalCouples requires a
system/createNonConformalCouplesDict in order to construct non-conformal
mapped walls. Each coupling is specified in its own sub-dictionary, and
a "regions" entry is used to specify the pair of regions that the
non-conformal mapped wall will couple. Non-conformal cyclics can also be
created using the same dictionary, and will be assumed if the two
specified regions are the same, or if a single "region" entry is
specified. For example:

    // Do not modify the fields
    fields  no;

    // List of non-conformal couplings
    nonConformalCouples
    {
        // Non-conformal cyclic interface. Only one region is specified.
        fluidFluid
        {
            region      fluid;
            originalPatches (nonCoupleRotating nonCoupleStationary);
        }

        // Non-conformal mapped wall interface. Two different regions
        // have been specified.
        fluidSolid
        {
            regions     (fluid solid);
            originalPatches (nonCoupleRotating nonCoupleStationary);
        }
    }

After this step, a case should execute with foamMultiRun and decompose
and reconstruct and post-process normally.

One additional restriction for parallelised workflows is that
decomposition and reconstruction must be done with the -allRegions
option, so that the both sides of the coupling are available to the
decomposition/reconstruction algorithm.

Tutorials:

Two tutorials have been added to demonstrate use of this new
functionality:

  - The multiRegion/CHT/misalignedDuct case provides a simple visual
    confirmation that the patches are working (the exposed corners of
    the solid will be hot if the non-conformal mapped walls are active),
    and it demonstrates createNonConformalCouples's ability to add
    boundary conditions to existing fields.

  - The multiRegion/CHT/notchedRoller case demonstrates use of
    non-conformal mapped walls with a moving mesh, and also provides an
    example of parallelised usage.

Notes for Developers:

A coupled boundary condition now uses a new class,
mappedFvPatchBaseBase, in order to perform a transfer of values to or
from the neighbouring patch. For example:

    // Cast the patch type to it's underlying mapping engine
    const mappedFvPatchBaseBase& mapper =
        mappedFvPatchBaseBase::getMap(patch());

    // Lookup a field on the neighbouring patch
    const fvPatchScalarField& nbrTn =
        mapper.nbrFvPatch().lookupPatchField<volScalarField, scalar>("T");

    // Map the values to this patch
    const scalarField Tn(mapper.fromNeighbour(nbrTn));

For this to work, the fvPatch should be of an appropriate mapped type
which derives from mappedFvPatchBaseBase. This mappedFvPatchBaseBase
class provides an interface to to both conformal/interpolative and
non-conformal mapping procedures. This means that a coupled boundary
condition implemented in the manner above will work with either
conformal/interpolative or non-conformal mapped patch types.

Previously, coupled boundary conditions would access a mappedPatchBase
base class of the associated polyPatch, and use that to transfer values
between the patches. This direct dependence on the polyPatch's mapping
engine meant that only conformal/interpolative fvPatch fields that
corresponded to the polyPatch's geometry could be mapped.
2024-01-30 11:21:58 +00:00
60acc3a845 etc/caseDicts/functions/functions: Template functions file for foamGet
Executing the command

    foamGet functions

in a case copies the etc/caseDicts/functions/functions template file into the
system directory.
2024-01-23 10:15:42 +00:00
8eb0cc00b1 etc/templates: Updated the system/functions files 2024-01-22 12:29:50 +00:00
8402bc3de2 potentialFoam: Replaced the -withFunctionObjects option with -functionObjects
and removed the unused -noFunctionObjects option.
2024-01-21 09:27:12 +00:00
a1eb8898d6 tutorials: Moved the functions entry from controlDict into a functions file 2024-01-20 23:43:10 +00:00
de363dde05 functionObjectList: Moved the functions entry from controlDict into a functions file
for consistency with fvModels and fvConstraints, to simplify code and case
maintenance and to avoid the potentially complex functions entries being
unnecessarily parsed by utilities for which functionObject evaluation is
disabled.

The functions entry in controlDict is still read if the functions file is not
present for backward-compatibility, but it is advisable to migrate cases to use
the new functions file.
2024-01-20 14:46:28 +00:00
ddeaa566ef coded: Permit both untyped and typed substitutions
Coded functionality now supports basic un-typed substitutions from the
surrounding dictionary. For example:

    value 1.2345;

    #codeExecute
    {
        scalar s = $value;
        ...
    };

It also now supports the more functional typed substitutions, such as:

    direction (1 0 0);

    #codeExecute
    {
        vector v = $<vector>direction;
        ...
    };

These substitutions are now possible in all code blocks. Blocks with
access to the dictionary (e.g., #codeRead) will do a lookup which will
not require re-compilation if the value is changed. Blocks without
access to the dictionary will have the value directly substituted, and
will require recompilation when the value is changed.
2024-01-10 15:41:57 +00:00
69da8f3d7b stitchMesh: Replacement utility based on the new patchIntersection algorithm
The mergePatchPairs functionality in blockMesh also now uses patchIntersection.

The new mergePatchPairs and patchIntersection replaces the old, fragile and
practically unusable polyTopoChanger::slidingInterface functionality the removal
of which has allowed the deletion of a lot of other ancient and otherwise unused
clutter including polyTopoChanger, polyMeshModifier, polyTopoChange::setAction
and associated addObject/*, modifyObject/* and removeObject/*.  This
rationalisation paves the way for the completion of the update of zone handling
allowing mesh points, faces and cells to exist in multiple zones which is
currently not supported with mesh topology change.

Application
    stitchMesh

Description
    Utility to stitch or conform pairs of patches,
    converting the patch faces either into internal faces
    or conformal faces or another patch.

Usage
    \b stitchMesh (\<list of patch pairs\>)

    E.g. to stitch patches \c top1 to \c top2 and \c bottom1 to \c bottom2
        stitchMesh "((top1 top2) (bottom1 bottom2))"

    Options:
      - \par -overwrite \n
        Replace the old mesh with the new one, rather than writing the new one
        into a separate time directory

      - \par -region \<name\>
        Specify an alternative mesh region.

      - \par -fields
        Update vol and point fields

      - \par -tol
        Merge tolerance relative to local edge length (default 1e-4)

See also
    Foam::mergePatchPairs
2023-12-25 13:32:39 +00:00
b94ade6e61 triSurfaceMesh: Rationalised the handling of the now required "file" entry 2023-12-20 11:38:55 +00:00
a5939b0f0a etc/caseDicts/annotated/topoSetDict: Updated documentation for triSurfaceMesh 2023-12-20 11:08:00 +00:00
2a9a2d0e7a Template cases: apply entrainmentPressure BC for p at outlet patches
The boundary condition applied to pressure at open boundaries and outlets is switched
from totalPressure to entrainmentPressure. The latter boundary condition is more robust
since it calculates the pressure for inflow using (velocity) fluxes rather than velocity
on the patch.
2023-12-19 15:56:25 +00:00
eb8e221f15 functionObjects::layerAverage: Volume averaging, and weight fields
This function has been changed to volume average, making it appropriate
to use on layered meshes in which the cells have non-uniform geometry
within their layers. A 'weightFields' (or 'weightField') control has
also been added, so that mass or phase weighted averages can be
performed within the layers.
2023-12-15 14:51:28 +00:00
b9fe7df344 polyTopoChange: New library containing the mesh topology change functionality
from the original dynamicMesh library, now separated into polyTopoChange and motionSolvers
2023-12-14 14:08:45 +00:00
eed7a62b98 Template cases: apply totalPressure BC on pressure at outlet 2023-12-13 18:03:58 +00:00
6e16197328 Template cases: corrected PIMPLE settings in fvSolution 2023-12-13 18:03:10 +00:00
9a8ea017f3 Template cases: automatic selection of bounded scheme in fvSchemes 2023-12-13 18:01:59 +00:00
58e38a761f constants: Standardise use of kmol instead of mol
This prevents spurious factors of 1000 from being introduced in
thermodynamic models. It also generalises the system further with
respect to alternative unit sets.
2023-12-13 15:25:53 +00:00