- for example,
defaultFieldValues
(
areaScalarFieldValue h 0.00014
);
regions
(
clipPlaneToFace
{
point (0 0 0);
normal (1 0 0);
fieldValues
(
areaScalarFieldValue h 0.00015
);
}
);
ENH: additional clipPlaneTo{Cell,Face,Point} topo sets
- less cumbersome than defining a semi-infinite bounding box
- remedy by performing the attach() action sequentially (as per
stitchMesh changes). This ensures that the current point addressing
is always used and avoids references to the already-merged points
(which is what causes the failure).
ENH: improve handling of empty patch removal
- only remove empty *merged* patches, but leave any other empty
patches untouched since they may intentional placeholders for other
parts of a workflow.
- remove any empty point/face zones created for patch merging
- simplifies construction/inheritance
ENH: add {fa,fv}PatchField::zeroGradientType() static
- can be used to avoid literal "zeroGradient" in places
STYLE: adjust naming of pointPatch runtime selection table
- simply use 'patch' as per fa/fv fields
STYLE: add zero-size guard to patch constraintType(const word&)
- as an alternative output transform (supplementary to the regular
coordinate system specification - issue #2505) it is now possible to
specify the rotation centre directly.
Example:
formatOptions
{
vtk
{
scale 1000; // m -> mm
transform
{
origin (0 0 0);
rotationCentre (1 0 0);
rotation axisAngle;
axis (0 0 1);
angle -45;
}
}
}
This behaves like the transformPoints and surfaceTransformPoints
'-centre' option (formerly '-origin') in that it removes the
specified amount from the point locations, applies the rotation and
finally adds the specified amount back to the newly rotated point
locations.
The results of specifying a `rotationCentre` and a non-zero
coordinate system `origin` may not be intuitively evident.
When a finite-area case could not find an entry for "lnGradSchemes"
in the "faSchemes" file, the "corrected" scheme has been picked up
by default. Therefore, any changes in "snGradSchemes" entry will not
be read by finite-area models.
For example,
T
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-6;
norm none;
}
STYLE: define defaultMaxIter, defaultTolerance directly in lduMatrix
- barycentric coordinates in interpolation (instead of x/y/z)
- ease U (velocity) requirement.
Needn't be named in the sampled fields.
- default tracking direction is 'forward'
phaseSystemModels function objects are relocated within
functionObjects in order to enable broader usage.
ENH: multiphaseInterHtcModel: new heatTransferCoeff function object model
COMP: createExternalCoupledPatchGeometry: add new dependencies
COMP: alphaContactAngle: avoid duplicate entries between multiphaseEuler and reactingEuler
TUT: damBreak4Phase: rename alphaContactAngle as multiphaseEuler::alphaContactAngle
thermoTools is a relocation of various existing tools:
- src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/
- src/semiPermeableBaffle/derivedFvPatchFields/
- src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/
ENH: Allwmake: reordering various compilation steps
Co-authored-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
- this allows the "relocation" of sampled surfaces. For example,
to reposition into a different coordinate system for importing
into CAD.
- incorporate output scaling for all surface writer types.
This was previously done on an adhoc basis for different writers,
but with now included in the base-level so that all writers
can automatically use scale + transform.
Example:
formatOptions
{
vtk
{
scale 1000; // m -> mm
transform
{
origin (0.05 0 0);
rotation axisAngle;
axis (0 0 1);
angle -45;
}
}
}
in cases with more than one primal or adjoint solvers
TUT: removed all occurances of useSolverNameForFields
from the optimisation tutorials since it is now set
automatically.
- update the area-centres processor/processor information as part of
faMesh::init() after all of the global data and geometry data is
setup.
- improve flattenEdgeField helper to properly handle empty patches.
This change removes the false fails when testing edge-centre
redistribution (FULLDEBUG mode).
TUT: add filmPanel (rivulet) tutorial
- include constant/faMesh cleanup (cleanFaMesh) as part of standard
cleanCase
- simplify cleanPolyMesh function to now just warn about old
constant/polyMesh/blockMeshDict but not try to remove anything
- cleanup cellDist.vtu (decomposePar -dry-run) as well
ENH: foamRunTutorials - fallback to Allrun-parallel, Allrun-serial
TUT: call m4 with file argument instead of redirected stdin
TUT: adjust suffixes on decomposeParDict variants
- simpler to write for sampled cutting planes etc.
For example,
slice
{
type cuttingPlane;
point (0 0 0);
normal (0 0 1);
interpolate true;
}
instead of
slice
{
type cuttingPlane;
planeType pointAndNormal;
pointAndNormalDict
{
point (0 0 0);
normal (0 0 1);
}
interpolate true;
}
STYLE: add noexcept to some plane methods
- can specify rotations that are not "axes" in a compact form:
transform
{
origin (0 0 0);
rotation none;
}
transform
{
origin (0 0 0);
rotation axisAngle;
axis (0 0 1);
angle 45;
}
An expanded dictionary form also remains possible:
transform
{
origin (0 0 0);
rotation
{
type axisAngle;
axis (0 0 1);
angle 45;
}
}
STYLE: verbose deprecation for "coordinateRotation" keyword
- the "coordinateRotation" keyword was replaced by the "rotation"
keyword (OpenFOAM-v1812 and later) but was handled silently.
Now elevated to non-silent.
STYLE: alias lookups "axesRotation", "EulerRotation", "STARCDRotation"
- these warn and report the equivalent short form, which aids in
upgrading. Previously had silent lookups.
- can be more intuitive to specify for some cases:
rotation
{
type euler;
order rollPitchYaw;
angles (0 20 45);
}
- refactor starcd rotation to reuse Euler ZXY ordering
(code reduction)
ENH: add -rotate-x, -rotate-y, -rotate-z for transformPoints etc
- easier to specify for simple rotations
- ensightWrite, vtkWrite, fv::cellSetOption
ENH: additional topoSet "ignore" action
- this no-op can be used to skip an action step, instead of removing
the entire entry
- this allows more flexibility when defining the location or intensity
of sources.
For example,
{
type scalarSemiImplicitSource;
volumeMode specific;
selectionMode all;
sources
{
tracer0
{
explicit
{
type exprField;
functions<scalar>
{
square
{
type square;
scale 0.0025;
level 0.0025;
frequency 10;
}
}
expression
#{
(hypot(pos().x() + 0.025, pos().y()) < 0.01)
? fn:square(time())
: 0
#};
}
}
}
}
ENH: SemiImplicitSource: handle "sources" with explicit/implicit entries
- essentially the same as injectionRateSuSp with Su/Sp,
but potentially clearer in purpose.
ENH: add Function1 good() method to define if function can be evaluated
- for example, provides a programmatic means of avoiding the 'none'
function
- similar to the geometric decomposition constraint,
allows a compositing selection of cells based on topoSet sources
which also include various searchableSurface mechanisms.
This makes for potentially easier placement of sources without
resorting to defining a cellSet.
ENH: support zone group selection for fv::cellSetOption and fa::faceSetOption
Reports cloud information for particles passing through a specified cell
zone.
Example usage:
cloudFunctions
{
particleZoneInfo1
{
type particleZoneInfo;
cellZone leftFluid;
// Optional entries
//writer vtk;
}
}
Results are written to file:
- \<case\>/postProcessing/lagrangian/\<cloudName\>/\<functionName\>/\<time\>
\# cellZone : leftFluid
\# time : 1.0000000000e+00
\#
\# origID origProc (x y z) time0 age d0 d mass0 mass
Where
- origID : particle ID
- origProc : processor ID
- (x y z) : Cartesian co-ordinates
- time0 : time particle enters the cellZone
- age : time spent in the cellZone
- d0 : diameter on entry to the cellZone
- d : current diameter
- mass0 : mass on entry to the cellZone
- mass : current mass
If the optional \c writer entry is supplied, cloud data is written in the
specified format.
During the run, output statistics are reported after the cloud solution,
e.g.:
particleZoneInfo:
Cell zone = leftFluid
Contributions = 257
Here, 'Contributions' refers to the number of incremental particle-move
contributions recorded during this time step. At write times, the output
is extended, e.g.:
particleZoneInfo:
Cell zone = leftFluid
Contributions = 822
Number of particles = 199
Written data to "postProcessing/lagrangian/reactingCloud1/
TUT: filter: add an example for the particleZoneInfo function object
- Previously, the multiFieldValue function object was limited to operate on
lists of fieldValue function objects.
- Any function objects that generate results can now be used, e.g.
pressureAverage
{
type multiFieldValue;
libs (fieldFunctionObjects);
operation average;
functions
{
inlet
{
type surfaceFieldValue;
operation areaAverage;
regionType patch;
name inlet;
fields (p);
writeFields no;
writeToFile no;
log no;
resultFields (areaAverage(inlet,p));
}
outlet
{
type surfaceFieldValue;
operation areaAverage;
regionType patch;
name outlet;
fields (p);
writeFields no;
writeToFile no;
log no;
}
average
{
type valueAverage;
functionObject testSample1;
fields (average(p));
writeToFile no;
log no;
}
}
}
TUT: cavity: add an example for the multiFieldValue function object
Two problems:
- flipping inside snappyHexMesh is not done in a parallel
consistent way. So e.g. the octree-cached inside/outside information
has already been calculated. For now flipping of
distributedTriSurfaceMesh is disabled.
- octree-cached inside/outside information was using already
cached information and would only work for outwards pointing
volumes
- can now specify sampled sets as dictionary entries instead of a list
entry.
can now use: sets { ... }
instead of: sets ( ... );
This is similar to sampled surfaces and makes it easier to
manage with dictionary manipulation tools.
TUT: update to use writeTime instead of outputTime
Automatic hole closure:
- introduces 'holeToFace' topoSet source
- used when detecting a 'leak-path'
- creates additional baffles to close the leak
Multi-stage layer addition:
- Can add layers in multiple passes
See issues: #2403, #2404
- the internal data are contiguous so can broadcast size and internals
directly without an intermediate stream.
ENH: split out broadcast time for profilingPstream information
STYLE: minor Pstream cleanup
- UPstream::commsType_ from protected to private, since it already has
inlined noexcept getters/setters that should be used.
- don't pass unused/unneed tag into low-level MPI reduction templates.
Document where tags are not needed
- had Pstream::broadcast instead of UPstream::broadcast in internals
- now largely encapsulated using PstreamBuffers methods,
which makes it simpler to centralize and maintain
- avoid building intermediate structures when sending data,
remove unused methods/data
TUT: parallel version of depthCharge2D
STYLE: minor update in ProcessorTopology
- this can be used to apply a uniform field level to remove from
a sampled field. For example,
fieldLevel
{
"p.*" 1e5; // Absolute -> gauge [Pa]
T 273.15; // [K] -> [C]
U #eval{ 10/sqrt(3) }; // Uniform mag(U)=10
}
After the fieldLevel has been removed, any fieldScale is applied.
For example
fieldScale
{
"p.*" 0.01; // [Pa] -> [mbar]
}
The fieldLevel for vector and tensor fields may still need some
further refinement.
- when used with *any* alphaField and normalised (the usual case)
would largely give a 0-1 corresponding to the min/max of the first
component, but could also yield negative values.
- if the alpha field corresponds identically to colour field, it is
readily possible to combine as into RGBA sequences. However, if the
fields are different it potentially means referencing an opacity
field that has not yet been sampled. This impedes using the format
for a streaming sampler without additional overhead and/or rewriting
the alpha channel later.
- supports sampling/probing of values to obtain min/max/average/size
at execution intervals without writing any output or generating
output directories.
- 'verbose' option for additional output
The parcel initial velocity can now be set using the new `velocityType`
entry, taking one of the following options:
- fixedValue : (default) same as earlier versions, requires U0
- patchValue : velocity set to seed patch face value
- zeroGradient : velocity set to seed patch face adjacent cell value
Example usage:
model1
{
type patchInjection;
massTotal 1;
SOI 0;
parcelBasisType mass;
patch cylinder;
duration 10;
parcelsPerSecond 100;
velocityType patchValue;
//velocityType zeroGradient;
//U0 (-10 0 0);
flowRateProfile constant 1;
sizeDistribution
{
type normal;
normalDistribution
{
expectation 1e-3;
variance 1e-4;
minValue 1e-5;
maxValue 2e-3;
}
}
}
See the new $FOAM_TUTORIALS/lagrangian/kinematicParcelFoam/spinningDisk tutorial
The turbulentTemperatureCoupledBaffleMixed boundary condition
has been superseded by the turbulentTemperatureRadCoupledMixed condition
TUT: injectorPipe: remove an unused entry
TUT: waveMakerFlap: remove uncompressed entry
- provides a simple means of defining/modifying fields. For example,
```
<name1>
{
type exprField;
libs (fieldFunctionObjects);
field pTotal;
expression "p + 0.5*(rho*magSqr(U))";
dimensions [ Pa ];
}
```
It is is also possible to modify an existing field.
For example, to modify the previous one.
```
<name2>
{
type exprField;
libs (fieldFunctionObjects);
field pTotal;
action modify;
// Static pressure only in these regions
fieldMask
#{
(mag(pos()) < 0.05) && (pos().y() > 0)
|| cellZone(inlet)
#};
expression "p";
}
```
To use as a simple post-process calculator, simply avoid storing the
result and only generate on write:
```
<name2>
{
store false;
executionControl none;
writeControl writeTime;
...
}
```
- literal lookups only for expression strings
- code reduction for setExprFields.
- changed keyword "condition" to "fieldMask" (option -field-mask).
This is a better description of its purpose and avoids possible
naming ambiguities with functionObject triggers (for example)
if we apply similar syntax elsewhere.
BUG: erroneous check in volumeExpr::parseDriver::isResultType()
- not triggered since this method is not used anywhere
(may remove in future version)
- this refines commit c233961d45, which added prefix scoping.
Default is now off (v2106 behaviour).
The 'useNamePrefix' keyword can be specified on a per function basis
or at the top-level of "functions".
```
functions
{
errors warn;
useNamePrefix true;
func1
{
type ...;
useNamePrefix false;
}
func2
{
type ...;
// Uses current default for useNamePrefix
}
}
```
- marks if the value is considered to be independent of 'x'.
Propagate into PatchFunction1 instead ad hoc checks there.
- adjust method name in PatchFunction1 to 'whichDb()' to reflect
final changes in Function1 method names.
ENH: add a Function1 'none' placeholder function
- This is principally useful for interfaces that expect a Function1
but where it is not necessarily used by a particular submodel.
TUT: update Function1 creation to use objectRegistry
- use `#word` to concatenate, expand content with the resulting string
being treated as a word token. Can be used in dictionary or
primitive context.
In dictionary context, it fills the gap for constructing dictionary
names on-the-fly. For example,
```
#word "some_prefix_solverInfo_${application}"
{
type solverInfo;
libs (utilityFunctionObjects);
...
}
```
The '#word' directive will automatically squeeze out non-word
characters. In the block content form, it will also strip out
comments. This means that this type of content should also work:
```
#word {
some_prefix_solverInfo
/* Appended with application name (if defined) */
${application:+_} // Use '_' separator
${application} // The application
}
{
type solverInfo;
libs (utilityFunctionObjects);
...
}
```
This is admittedly quite ugly, but illustrates its capabilities.
- use `#message` to report expanded string content to stderr.
For example,
```
T
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-10;
relTol 0;
#message "using solver: $solver"
}
```
Only reports on the master node.
- provide a plain stream() method on messageStream to reduce reliance
on casting operators and slightly opaque operator()() calls etc
- support alternative stream for messageStream serial output.
This can be used to support local redirection of output.
For example,
refPtr<OFstream> logging; // or autoPtr, unique_ptr etc
// Later...
Info.stream(logging.get())
<< "Detailed output ..." << endl;
This will use the stdout semantics in the normal case, or allow
redirection to an output file if a target output stream is defined,
but still effectively use /dev/null on non-master processes.
This is mostly the same as this ternary
(logging ? *logging : Info())
except that the ternary could be incorrect on sub-processes,
requires more typing etc.
ENH: use case-relative names of dictionary, IOstream for FatalIOError
- normally yields more easily understandable information
- argList::envExecutable() static method.
This is identical to getEnv("FOAM_EXECUTABLE"), where the name of
the executable has typically been set from the argList construction.
Provides a singleton access to this value from locations that
do not have knowledge of the originating command args (argList).
This is a similar rationale as for the argList::envGlobalPath() static.
- additional argList::envRelativePath() static method.
- make -dry-run handling more central and easier to use by adding into
argList itself.
STYLE: drop handling of -srcDoc (v1706 option)
- replaced with -doc-source for 1712 and never used much anyhow
The original thermoSurfaceFilm sub-models were divided between kinematicSurfaceFilm and thermoSurfaceFilm in order to use the surfaceFilm model in a kinematicCloud.
The film interaction models are now in a kinematicSurface class which can be used in a kinematic cloud adding constant thermal properties (p and T) for some sub-models, e.g. drySplashInteraction/wetSplashInteraction.
pRef and Tref were added to the kinematicSurfaceFilm as entry to the regionFilm when used with a kinematic cloud.
In the finite area surface film model Tref, pRef are stored in filmSubModelBase.
TUT: kinematicParcelFoam: new tutorial pitzDailySprinkles
1) Adding subMesh capabilities to momentumError and div FOs.
- A subMesh is created from cellZones.
- The operators (div, etc) are only calculated in the subMesh.
2) Optionally, halo cells can be added to the cellZones.
3) New helper class to handle the subMesh creation and field mapping.
- previously a function (unlike the csh version) but since bashrc and
setup have been split -> replace with inline definition
STYLE: formatting/wording for openfoam starters
TUT: simplify controlDict modification, add default substitution
ENH: accept '/' for end-of-options terminator (etc/openfoam)
- makes the application or service more apparent.
* eg. /usr/bin/openfoam / blockMesh
* vs. /usr/bin/openfoam -- blockMesh
Accept lone '-' as the end-of-options terminator, as per bash
- Adjust handling of openfoam '-c' option to flag that a command-string
will appear, but continue with option parsing.
Consistent with bash definition.
- adjust commented-out evaluation to avoid warnings.
With code like this
```
#if 0
nxin #eval{ round($nxin / 5) };
#endif
```
The handling of the "#if 0 / #endif" clause uses the plain ISstream
parser to tokenize. This means that the "round(" is parsed as a word
with a mismatched closing ')', whereas the "#eval" parser will slurp
everything in until the closing brace and send it off as a string
to the expression parser.
Wrapper that clones the supplied object for each region.
Simplifies the setup of identical post-processing requirements for
multi-region cases.
Applies the supplied function to all regions by default.
Example of function object specification:
multiRegion
{
type multiRegion;
libs (utilityFunctionObjects);
...
function
{
// Actual object specification
type fieldMinMax;
libs (fieldFunctionObjects);
fields (<field1> .. <fieldN>);
}
// Optional entries
regions (region1 region2);
}
Where the entries comprise:
Property | Description | Reqd | Default
type | Type name: multiRegion | yes |
function | Function object sub-dictionary | yes |
regions | List of region names | no | all
Computes a selected operation between multiple \c fieldValue function
objects.
The operation is applied to all results of each \c fieldValue object.
Note
Each object must generate the same number and type of results.
Usage
Minimal example by using \c system/controlDict.functions:
multiFieldValue1
{
// Mandatory entries (unmodifiable)
type multiFieldValue;
libs (fieldFunctionObjects);
// Mandatory entries (runtime modifiable)
operation subtract;
// List of fieldValue function objects as dictionaries
functions
{
region1
{
...
}
region2
{
...
}
...
regionN
{
...
}
}
// Optional (inherited) entries
...
}
where the entries mean:
Property | Description | Type | Req'd | Dflt
type | Type name: multiFieldValue | word | yes | -
libs | Library name: fieldFunctionObjects | word | yes | -
operation | Operation type to apply to values | word | yes | -
functions | List of fieldValue function objects | dict | yes | -
\endtable
Options for the \c operation entry:
add | add
subtract | subtract
min | minimum
max | maximum
average | average
Deprecated fieldValueDelta
- The fieldValueDelta function object was originally written to compute the
difference between two fieldValue-type function objects. The multiFieldValue
object name better describes its purpose whilst being able to operate on an
arbitrary number of fieldValue-type objects.
- support wordRes for selecting patch names
- ownerPolyPatch specification is now optional, which simplifies input
and also supports a faMesh spanning different patches but with a
single boundary condition.
Alternatively, can specify more granularity if required.
```
polyMeshPatches ( "top.*" );
boundary
{
inlet1
{
type patch;
ownerPolyPatch top1; // <- specific to this portion
neighbourPolyPatch inlet;
}
inlet2
{
type patch;
ownerPolyPatch top2; // <- specific to this portion
neighbourPolyPatch inlet;
}
outlet
{
type patch;
neighbourPolyPatch outflow;
}
bound
{
type symmetry;
neighbourPolyPatch bound;
}
}
```
- additional -serial/-parallel option:
prefer Allrun-serial or Allrun-parallel if available
- optional -output=DIR to preserve output
ENH: report missing tutorials/ directory in RunFunctions
code style and quality improvements
renamed recon::centre to interfaceCentre.{groupName}
ranmed recon::normal to interfaceNormal.{groupName}
centre and normal field are not written by default
- meshTools include/library for many (most) coded items
- add PatchFunction1 include for coded BCs to provide ready access
to Function1 and PatchFunction1
- adjust surfactantFoam/planeTransport tutorial to have partial
coverage of the plate by the finiteArea mesh.
Depending on the decomposition, the outflow boundary may coincide
with a processor patch (good for testing purposes).
- additional Allrun-parallel versions for targetted future behaviour
- can be used for block-like meshes that are not aligned with the global
coordinate directions. Alternatively, for general testing purposes.
Example,
method simple;
coeffs
{
n ( 2 2 2 );
transform
{
origin (-0.15 0.15 0);
e1 (1 1 0);
e3 (0 0 1);
}
}
- additional debug information
- improve support for dictionary specification of constant, polynomial
and table entries. These previously only worked properly for
primitiveEntry, which causes confusion.
- extend table Function1 to include TableFile functionality.
Simplifies switching and modifying content.