- wish to deprecate and remove exprFixedValue in the future since the
same functionality is possible using patch expressions with a
uniformFixedValue condition.
- replaced ad hoc handling of formatOptions with coordSetWriter and
surfaceWriter helpers.
Accompanying this change, it is now possible to specify "default"
settings to be inherited, format-specific settings and have a
similar layering with surface-specific overrides.
- snappyHexMesh now conforms to setFormats
Eg,
formatOptions
{
default
{
verbose true;
format binary;
}
vtk
{
precision 10;
}
}
surfaces
{
surf1
{
...
formatOptions
{
ensight
{
scale 1000;
}
}
}
}
- in continuation of #2565 (rotationCentre for surface output formats)
it is helpful to also support READ_IF_PRESENT behaviour for the
'origin' keyword.
This can be safely used wherever the coordinate system definition
is embedded within a sub-dictionary scope.
Eg,
dict1
{
coordinateSystem
{
origin (0 0 0); // now optional here
rotation ...;
}
}
but remains mandatory if constructed without a sub-dict:
dict2
{
origin (0 0 0); // still mandatory
e1 (1 0 0);
e3 (0 0 1);
}
With this change, the "transform" sub-dictionary can written
more naturally:
formatOptions
{
vtk
{
scale 1000; // m -> mm
transform
{
rotationCentre (1 0 0);
rotation axisAngle;
axis (0 0 1);
angle -45;
}
}
}
ENH: simplify handling of "coordinateSystem" dictionary lookups
- coordinateSystems::NewIfPresent method for optional entries:
coordSysPtr_ = coordinateSystem::NewIfPresent(mesh, dict);
Instead of
if (dict.found(coordinateSystem::typeName, keyType::LITERAL))
{
coordSysPtr_ =
coordinateSystem::New
(
mesh_,
dict,
coordinateSystem::typeName
);
}
else
{
coordSysPtr_.reset();
}
ENH: more consistent handling of priorities for binModels, forces (#2598)
- if the dictionaries are overspecified, give a 'coordinateSystem'
entry a higher prioriy than the 'CofR' shortcuts.
Was previously slightly inconsistent between the different models.
- 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.
- 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;
}
}
}
- 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
- 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
- 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.
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)
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.
- 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.
- 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;
}
}
```
- 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);
}
}