Swak4Foam README 2.x PDF
Swak4Foam README 2.x PDF
Contents
1 Description 1
3 Contributors etc 2
3.1 Original Author . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3.2 Current Maintainer . . . . . . . . . . . . . . . . . . . . . . . . 2
3.3 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3.4 Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4 Installation/Compilation 2
4.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
4.2 Building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
4.2.1 Additional configuration . . . . . . . . . . . . . . . . . 3
4.2.2 Possible compilation failure with old 2.0.x-versions . . 4
4.3 Global installation . . . . . . . . . . . . . . . . . . . . . . . . 4
4.4 Packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.4.1 Debian . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
5 Contents 5
5.1 Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
5.1.1 swak4FoamParsers . . . . . . . . . . . . . . . . . . . . 5
5.1.2 simpleFunctionObjects . . . . . . . . . . . . . . . . . 5
5.1.3 groovyBC . . . . . . . . . . . . . . . . . . . . . . . . . 5
5.1.4 swakFunctionObjects . . . . . . . . . . . . . . . . . . 5
5.1.5 simpleSwakFunctionObjects . . . . . . . . . . . . . . 6
1
5.1.6 swakSourceFields . . . . . . . . . . . . . . . . . . . . 6
5.1.7 swakTopoSources . . . . . . . . . . . . . . . . . . . . . 7
5.1.8 swakFiniteArea . . . . . . . . . . . . . . . . . . . . . 7
5.1.9 groovyStandardBCs . . . . . . . . . . . . . . . . . . . 7
5.1.10 pythonIntegration . . . . . . . . . . . . . . . . . . . 7
5.1.11 fluFunctionObjectDriver . . . . . . . . . . . . . . . 7
5.1.12 functionPlugins . . . . . . . . . . . . . . . . . . . . . 8
5.2 Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5.2.1 funkySetFields . . . . . . . . . . . . . . . . . . . . . 8
5.2.2 funkySetAreaFields . . . . . . . . . . . . . . . . . . . 8
5.2.3 funkySetBoundaryField . . . . . . . . . . . . . . . . . 9
5.2.4 replayTransientBC . . . . . . . . . . . . . . . . . . . 9
5.2.5 funkyDoCalc . . . . . . . . . . . . . . . . . . . . . . . 9
5.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3.1 groovyBC . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3.2 FunkySetFields . . . . . . . . . . . . . . . . . . . . . . 11
5.3.3 FunkySetBoundaryFields . . . . . . . . . . . . . . . . 11
5.3.4 InterFoamWithSources . . . . . . . . . . . . . . . . . . 11
5.3.5 InterFoamWithFixed . . . . . . . . . . . . . . . . . . . 11
5.3.6 FiniteArea . . . . . . . . . . . . . . . . . . . . . . . . . 11
5.3.7 other . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.3.8 PythonIntegration . . . . . . . . . . . . . . . . . . . . 13
5.3.9 CodeStream . . . . . . . . . . . . . . . . . . . . . . . . 13
5.3.10 solvePDE . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.3.11 BasicSourceSubclasses . . . . . . . . . . . . . . . . . . 14
5.3.12 Lagrangian . . . . . . . . . . . . . . . . . . . . . . . . 14
5.3.13 tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.4 maintainanceScripts . . . . . . . . . . . . . . . . . . . . . . 15
7 Copyright 18
2
8 Known bugs 18
8.1 Moving meshes and sampledSurfaces . . . . . . . . . . . . . 18
8.2 Missing support for interpolation and point-Fields . . . . . . 18
8.3 Caching of loaded fields not working . . . . . . . . . . . . . . 18
8.4 Possible enhancements of the code . . . . . . . . . . . . . . . 18
8.4.1 Pointers in the driver code . . . . . . . . . . . . . . . . 18
8.5 Possible memory loss . . . . . . . . . . . . . . . . . . . . . . . 19
8.6 Non-treatment of the inner product & of symmetric tensors . 19
8.7 No point-vector construction for Subsets . . . . . . . . . . . . 19
9 History 19
9.1 2010-09-13 - version number : 0.1 . . . . . . . . . . . . . . . . 19
9.2 2010-12-18 - version number : 0.1.1 . . . . . . . . . . . . . . . 19
9.2.1 Parser for sampledSurfaces . . . . . . . . . . . . . . . 19
9.2.2 Multiline variables . . . . . . . . . . . . . . . . . . . 19
9.2.3 Two maintainance-scripts were added . . . . . . . . . . 20
9.2.4 Parsers using external variables are now run-time se-
lectable . . . . . . . . . . . . . . . . . . . . . . . . . . 20
9.3 2011-01-30 - version number : 0.1.2 . . . . . . . . . . . . . . . 20
9.3.1 Support for Finite Area-stuff . . . . . . . . . . . . . . 20
9.3.2 Bugfix for compiling in single precision . . . . . . . . . 20
9.3.3 New function nearDist . . . . . . . . . . . . . . . . . 20
9.4 2011-04-20 - version number : 0.1.3 . . . . . . . . . . . . . . . 21
9.4.1 New utility funkySetAreaField . . . . . . . . . . . . 21
9.4.2 Refactoring of groovyBC and groovified boundary con-
ditions . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9.4.3 Easier deployment . . . . . . . . . . . . . . . . . . . . 21
9.4.4 Force equations . . . . . . . . . . . . . . . . . . . . . . 21
9.4.5 New utility funkyDoCalc . . . . . . . . . . . . . . . . 21
9.4.6 Debian packaging . . . . . . . . . . . . . . . . . . . . . 21
9.4.7 Lookup-tables . . . . . . . . . . . . . . . . . . . . . . . 21
9.4.8 Stored variables . . . . . . . . . . . . . . . . . . . . . . 21
9.4.9 Sampled sets . . . . . . . . . . . . . . . . . . . . . . . 22
9.5 2011-07-26 - version number : 0.1.4 . . . . . . . . . . . . . . . 22
9.5.1 Port to OpenFOAM 2.0 . . . . . . . . . . . . . . . . . 22
9.5.2 New features: . . . . . . . . . . . . . . . . . . . . . . . 22
9.5.3 Bug-fixes . . . . . . . . . . . . . . . . . . . . . . . . . 22
9.5.4 Packaging . . . . . . . . . . . . . . . . . . . . . . . . . 23
9.6 2011-10-03 - version number : 0.1.5 . . . . . . . . . . . . . . . 23
9.6.1 New features . . . . . . . . . . . . . . . . . . . . . . . 23
3
9.6.2 Administrative and packaging . . . . . . . . . . . . . . 24
9.6.3 Bugfixes . . . . . . . . . . . . . . . . . . . . . . . . . . 24
9.7 2012-01-04 - version number : 0.1.6 . . . . . . . . . . . . . . . 24
9.7.1 Cases changed . . . . . . . . . . . . . . . . . . . . . . 24
9.7.2 Infrastructure . . . . . . . . . . . . . . . . . . . . . . . 25
9.7.3 Technical . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.7.4 New features . . . . . . . . . . . . . . . . . . . . . . . 26
9.7.5 Bug fixes . . . . . . . . . . . . . . . . . . . . . . . . . 28
9.7.6 Discontinued features . . . . . . . . . . . . . . . . . . 29
9.8 2012-04-13 - version number : 0.2.0 Friday the 13th . . . . . . 29
9.8.1 New features . . . . . . . . . . . . . . . . . . . . . . . 29
9.8.2 Infrastructure . . . . . . . . . . . . . . . . . . . . . . . 32
9.8.3 Packaging . . . . . . . . . . . . . . . . . . . . . . . . . 32
9.8.4 Changes in the behavior . . . . . . . . . . . . . . . . . 32
9.8.5 Bug fixes . . . . . . . . . . . . . . . . . . . . . . . . . 33
9.9 2012-10-18 - version number : 0.2.1 . . . . . . . . . . . . . . . 35
9.9.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . 35
9.9.2 Bug fixes . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.9.3 Enhancements . . . . . . . . . . . . . . . . . . . . . . 38
9.9.4 New features . . . . . . . . . . . . . . . . . . . . . . . 40
9.9.5 Infrastructure . . . . . . . . . . . . . . . . . . . . . . . 43
1 Description
A collection of libraries and tools that let the user handle OpenFOAM-data
based on expressions
2.2 Technical
This file is written in the mighty org-mode (see http://orgmode.org/) a
markup/outline-mode for (X)Emacs. Using this mode it can be easily (using
4
3 keystrokes . . . its Emacs) to PDF or HTML to make it more readable
(and add a table of contents).
Please dont try to beautify it with any other text editor as this will
surly mess up the markup (and keeping the file org-compatible outside of the
org-mode is a pain in the neck.
3 Contributors etc
3.1 Original Author
Bernhard Gschaider ([email protected])
3.3 Contributors
In alphabetical order of the surname
3.4 Documentation
See: http://openfoamwiki.net/index.php/contrib/swak4Foam
5
4 Installation/Compilation
4.1 Requirements
Version 2.0 or 2.1 of OpenFOAM (a version that works with 1.6, 1.6-ext
and 1.7 is available separately)
bison swak4Foam is known to work with bison version 2.4 and higher.
Version 2.3 compiles but the plugin-functionality does not work
correctly
flex since the introduction of the plugin functions at least a flex version
of 2.5.33 is required (2.5.35 is the lowest confirmed version)
Both of these are mainstream packages (they are for instance needed to
compile gcc) and should exist on every Linux distribution. Use the package
manager of your distribution to install them and only if the compilation
process of swak4Foam complains about too low versions try to install them
from other sources.
swak4Foam tries to keep the requirements on these as low as possible
and sometimes lower versions than the ones reported may work. If they do
please report so.
The version of bison can be checked with
bison -V
flex -V
4.2 Building
wmake all
at the base directory should build all the libraries and tools.
Rerun the command to make sure that there was no problem with the
compilation (this should be quite fast and only report libraries being created
and some administrative stuff)
6
4.2.1 Additional configuration
Some features (currently only the Python-integration may need third
party software. The paths to these packages can be configured in a file
swakConfiguration (an example file swakConfiguration.example is pro-
vided). If that file is not present these unconfigured features will not be
compiled.
Environment variables that can be set in this file are:
7
4.4 Packaging
4.4.1 Debian
The command build dpkg builds a Debian/Ubuntu package for the cur-
rently enabled OpenFOAM-package. Note:
5 Contents
5.1 Libraries
Collection of Libraries
5.1.1 swak4FoamParsers
The basis of swak4Foam: the expression parsers with the logic to access the
OpenFOAM data-structures.
None of the other software pieces compile without it.
Also defines a subclass to DataEntry that uses swak-expressions and a
function object initSwakFunctionObject that might be used if this fails
5.1.2 simpleFunctionObjects
A collection of function objects that was previously separately available at
http://openfoamwiki.net/index.php/Contrib_simpleFunctionObjects.
Provides consistent output of values (on patches and fields) and more.
5.1.3 groovyBC
Implements the infamous groovyBC. A boundary condition that allows arbi-
trary expressions in the field-file
8
5.1.4 swakFunctionObjects
Function objects that have no additional requirements. Mainly used for
manipulating and creating fields with expressions
5.1.5 simpleSwakFunctionObjects
Function objects based on the simpleFunctionObjects-library (which is a
prerequisite for compiling it).
Evaluate expressions and output the results
9
5.1.6 swakSourceFields
These classes allow to manipulate the solution. To use these the solver has
to be modified.
These sources are based on basicSource and can be used without a modi-
fication of the solver (they are only available in the 2.x version):
5.1.7 swakTopoSources
topoSources for cellSet and faceSet. Can be used with the cellSet and
faceSet-utilities
5.1.8 swakFiniteArea
Implements parsers for the finiteArea-stuff in 1.6-ext. Also implements
groovyBC for areaField and expressionField and other function objects
5.1.9 groovyStandardBCs
Collection of boundary conditions that give standard boundary conditions
the possibility to use expression for the coefficients
Contributions to this library are explicitly encouraged. Please use the
Mercurial-branch groovyStandardBCs to groovyify standard boundary con-
ditions.
10
5.1.10 pythonIntegration
Embeds a Python-interpreter.
5.1.11 fluFunctionObjectDriver
Driver for functionObjects that implemented entirely in Python using the
pythonFlu-library
5.1.12 functionPlugins
Directory with a number of libraries with function-plugins:
11
swakLagrangianCloudSourcesFunctionPlugin Functions that get in-
formations like source terms from clouds of particles (due to technical
reasons this works only for the regular intermediate clouds)
5.2 Utilities
5.2.1 funkySetFields
Utility that allows creation and manipulation of files with expressions
5.2.2 funkySetAreaFields
Utility like funkySetFields for areaFields (only works with 1.6-ext)
5.2.3 funkySetBoundaryField
Sets any field on a boundary to a non-uniform value based on an expression.
Acts without deeper understanding of the underlying boundary condition
5.2.4 replayTransientBC
Utility to quickly test whether a groovyBC gives the expected results. Writes
the specified fields with the applied boundary condition but doesnt do any-
thing else.
Can be used for other BCs as well
5.2.5 funkyDoCalc
Evaluates expressions that are listed in a dictionary using data that is found
on the disc and prints summarized data (min, max, average, sum) to the
screen
5.3 Examples
If not otherwise noted cases are prepared by a simple blockMesh-call.
Note: All the cases here are strictly for demonstration purposes and
resemble nothing from the real world
12
5.3.1 groovyBC
The old groovyBC-Demos
pulsedPitzDaily
Solver pisoFoam
Also demonstrates manipulateField, expressionField and clearField
from the swakFunctionObjects. patchExpression from simpleSwakFunctionObjects.
solveLaplacianPDE and solveTransportPDE for solving equa-
tions
wobbler
Solver solidDisplacementFoam
circulatingSplash
Solver interDyMFoam
movingConeDistorted
Solver pimpleDyMFoam
Also demonstrates swakExpression with surface. Due to a prob-
lem described below this currently doesnt work
average-t-junction
Solver pimpleFoam
Mesh preparation Execute the script prepare.sh in that directory
(requires PyFoam: if not installed change in the boundary-file the
type of the defaultFaces to wall)
delayed-t-junction
Solver pimpleFoam
Demonstrates Delayed variables to simulate an inflow that depends
on the value of the outflow
multiRegionHeaterFeedback
Solver chtMultiRegionFoam
Mesh preparation Execute the script prepare.sh in that directory
13
Also demonstrated patchExpression and swakExpression from
simpleSwakFunctionObjects.
fillingTheDam
Solver interFoam
Also demonstrates Usage of a sampledSet defined in the controlDict
do determine the average filling height. Also stored variables for
not switching back once the criterion is reached. Global variables
defined by a function object
sprinklingInlet
Solver interFoam
Description Winner of the swak4Foam-competition at the 6th OpenFOAM-
Workshop (2011). By Peter Keller
potentialPitzDaily
Solver potentialFoam
Description Demonstrates the use of groovyB with potentialFoam
(also a problem connected with that). Provided by Martin Backer
5.3.2 FunkySetFields
Example dictionary for funkySetFields
5.3.3 FunkySetBoundaryFields
Example dictionary for funkySetBoundaryFields. Sets nonsense boundary
conditions for the world famous damBreak-case
5.3.4 InterFoamWithSources
Demonstrates usage of expressionSource
Due to differences in the original interFoam-solver this doesnt work on
certain OpenFOAM-versions (most specifically 1.6-ext). The current solver
works with 2.1. For older OF-versions use the sources labeled _pre2.1.
The only modifications to the original solver are found at the end of
createFields.H and in UEqn.H (the added source terms).
14
5.3.5 InterFoamWithFixed
Demonstrates usage of forceEquation
Due to differences in the original interFoam-solver this doesnt work on
certain OpenFOAM-versions (most specifically 1.6-ext). The current solver
works with 2.1. For older OF-versions use the sources labeled _pre2.1.
The only modifications to the original solver are found at the end of
createFields.H and in UEqn.H (the fixing of the velocities).
interFoamWithSources
Slightly modified version of interFoam. Adds a source term to the
momentum equation. The source term is an expression that is defined
at run-time
mixingThing
Demonstration case for it.
Preparation Run the script prepare.sh to prepare the case
5.3.6 FiniteArea
Demonstration of the finiteArea-stuff that works with 1.6-ext
swakSurfactantFoam
Variation of surfactantFoam that adds an expressionSource
planeTransport
Demonstration case
Preparation Use blockMesh and makeFaMesh
Solver surfactantFoam (without source term) or swakSurfactantFoam
Demonstrates FAM-specific swakExpressions and groovyBC (as
well as the expressionSource)
5.3.7 other
Cases that dont have a groovyBC
angledDuctImplicit
Solver rhoPorousMRFSimpleFoam
Mesh preparation Execute the makeMesh.sh-script in that direc-
tory. If you want to run in parallel call the decomposeMesh.sh-
script with the number of processors as an argument
15
Demonstrates Usage of the swakTopoSources. Compares different
approaches to evaluating with the swakExpression-functionObject.
Also an example dictionary that demonstrates the use of funkyDoCalc
angledDuctImplicitTransient
Solver rhoPorousMRFPimpleFoam
Mesh preparation Execute the makeMesh.sh-script in that direc-
tory. If you want to run in parallel call the decomposeMesh.sh-
script with the number of processors as an argument
Demonstrates The same as angledDuctImplicit but also the out-
put of temporal changes
capillaryRise
Solver interFoam
Case preparation run the supplied script prepareCase.sh
Demonstrates Usage of a sampled surface to track the interface in a
VOF-simulation
mixingGam
Solver interFoam
Case preparation run the supplied script prepareCase.sh
Demonstrates Emulate a moving gravitation by using the manipulateField-
functionObject to recalculate gh and ghf
5.3.8 PythonIntegration
Demonstrate the integration of Python. Mostly using PyFoam but also with
pythonFlu
manipulatedPitzDaily
Solver simpleFoam
Demonstrates Usage of PyFoam to manipulate the fvSolution-file
during the run (possible application: unphysical initial conditions
cause the run to fail during startup with normal relaxation val-
ues)
findPointPitzDaily
16
Solver simpleFoam
Demonstrates Usage of the pythonFlu-integration to find the point
where the recirculation behind the step ends. Also tries to plot
the result using the matplotlib-library
bed2OfPisa
Solver twoPhaseEulerFoam
Demonstrates Usage of PyFoam to read the direction of gravity and
feeding it into a goovyBC via global variables
Case preparation Just call funkySetFields -time 0
multiRegionHeaterBuildFunctionObjects
Solver chtMultiRegionFoam
Demonstrates Building the specification of function objects at run-
time via a Python-script
5.3.9 CodeStream
Demonstrates working together with the coded-stuff in OpenFOAM 2.0
5.3.10 solvePDE
Examples for the functionObjects that can solve Partial Differential equa-
tions
flangeWithPDE
Solver laplacianFoam
Demonstrates The usage of the functionObject that solves the
laplacian (Poisson) equation and (hopefully) that it gets the same
result as the native solver
Case preparation Allrun-script is provided
pitzDailyWithPDE
Solver scalarTransportFoam
Demonstrates Solving additional transport equations
17
5.3.11 BasicSourceSubclasses
These examples test the source terms based on basicSource. They only
work with OpenFOAM 2.x and all use the simpleFoam-solver
pitzDailyWithSwirl
pitzDailyWithExplicitPoroPlug
pitzDailyWithImplicitPoroPlug
5.3.12 Lagrangian
Tests for the functionObjects that create and evolve a cloud of particles
hotStream
Solver replayTransientBC
Mesh preparation prepareCase.sh-script
Demonstrates 3 clouds (kinematic, reacting, solidParticle). Loading
of a thermophysical model with a functionObject. Plugin func-
tions for information about the clouds
angledDuctWithBalls
Solver rhoPimpleFoam
Demonstrates Thermo-cloud. Functions for lagrangian particles
5.3.13 tests
Simple test cases for specific features
randomCavity
Testing of different seeds for the rand-function. Also tests the
randFixed-function
18
5.4 maintainanceScripts
Undocumented scripts used for maintaining swak4Foam. If you dont un-
derstand them, dont use them
6.2 Development
Contributions to to swak4Foam are most welcome. If you want to contribute
clone the Mercurial archive of the sources
hg clone http://openfoam-extend.hg.sourceforge.net:8000/hgroot/openfoam-extend/swak4Fo
Change to the branch that you want to improve (usually default) and create
a new branch
hg branch <branchName>
hg export <nodeID>
19
(nodeID being the ids of your changesets) and send them to the maintainer
(or attach them to a bug report on Manits). The changes will be reviewed
and merged into the default branch (do not attempt to do this yourself).
Patches generated with hg export make sure that all changes are attributed
to the original developer (you).
An alternative would be the bundle command. Just do
hg bundle <bundlefile>
and then send the bundlefile. This will include all commits that are not
in the upstream repository and will allow similar inclusion in the upstream
as export.
Once you have proven by successfully submitting changesets via hg
export you can ask for write access to the mercurial repository.
bison/flex This pair of compiler generator tools generate the parsers for
the expressions. Google for a tutorial that looks promising to you.
For a short example that shows how a new function was added to two
parsers have a look at this changeset that added the cpu()-function to
the field and the the patch-parser (usually youll have to write a new
method for the driver too):
hg diff -c 8604e865cce6
default The main branch. This is the brancht that the general public will
receive. It compiles under 1.7 and 1.6-ext
port_2.0.x The branch that compiles under OpenFOAM 2.0. This will
eventually become the default-branch
20
debianPackaging Branch for generating new Debian-packages of swak4Foam.
If somebody wants to inherit this: contact the maintainer
7 Copyright
swak4Foam is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version. See the file COPYING in this directory, for a description of the
GNU General Public License terms under which you can copy the files.
8 Known bugs
The following list is not complete. If the Artemis extension (see above) is
installed then
hg ilist
gives a more up-to-date list
21
8.2 Missing support for interpolation and point-Fields
Apart from patches and internal fields the support for interpolation from
cells to faces (and vice versa) is incomplete as well as point fields (although
they are supported in the grammar)
22
9 History
9.1 2010-09-13 - version number : 0.1
First Release
23
a parser faField for areaFields
24
9.4.5 New utility funkyDoCalc
Utility does calculations on saved results and outputs single numbers (min,
max, sum, average) to the terminal. Can be used for reporting or validity
checks
9.4.7 Lookup-tables
A single-argument function can be specified as a piecewise linear function.
Basically works like timelines but the argument can be something else (not
only the time)
These two functions now can receive an integer seed that deter-
mines the pseudo-randooom sequence generated by these func-
tions
25
Two functions randFixed and randNormalFixed were added.
While the usual rand functions generate a different result at ev-
ery time-steps for these functions the pseudo-random sequence is
determined only by the seed (not by the timestep)
Binary min and max
Take the bigger/smaller of two fields. Helps avoid ?:-operations
Allow writing of only volume-fields in funkySetAreaFields
Application: If the results of the calculation are only needed in Par-
aView
Internal changes
Use autoPtr for sets
Update sets that change in memory or on disc
9.5.3 Bug-fixes
funkySetAreaFields did not check for the correct fields
Fixed by Petr Vita
surfaceProxy uses the wrong geometric data
Avoid floating point exceptions with division of fields
Calculated boundaries were 0 and caused a division by zero
9.5.4 Packaging
Update Debian packaging
Packaging information for the currently used OF-version is gen-
erated (allows a separate swak-package for every OF-version
Submission to launchpad added
Deployment scripts
Now install to FOAM_SITE_APPBIN/LIBBIN
26
replayTransientBC allows execution of functionObjects
This can be switched on using the allowFunctionObjects-option
Python-embedding
Allows the execution of Python-Code in a functionObject
This feature is still experimental and the organization of the libraries
is subject to change
Global variables
It is now possible to define variables that are global: They can be
read in any entity.
Currently these variables can only be uniform.
To access global variables the specification-dictionary has to have a
wordList named globalScopes. The scopes are searched in that order
for the names of global variables. Having scopes allows some kind of
separation of the variables
27
to compile in this place. What happens then (committing them into
the repository or just plain compilation) is up to the maintainer
Absorb simpleFunctionObjects
As many parts of swak4Foam depend on it the simpleFunctionObjects
have now been absorbed into swak4Foam. They can still be compiled
on their own
9.6.3 Bugfixes
Variables not working for parallel computations
If a variable is defined and the patch which it is defined on doesnt have
any faces the variable is reported on that processor as not existing and
the whole run fails
9.7.2 Infrastructure
Check for correct bison-version
The Allwmake-script now checks for the correct bison-version (and the
existence of bison) and fails if it doesnt seem to be the right one
9.7.3 Technical
Refactoring of the FieldDriver
28
Refactoring of the FaFieldDriver
Writing of storedVariables
If necessary (for instance swakExpression-functionObject) the storedVariables
are written to disc (into a subdirectory swak4Foam of the timestep) and
are reread at the start. This allows consistent restarts (for instance if
a flow was summed using the variable) if the expressions stay the
same.
29
Extension of the expressionToFace topoSet
If the expression evaluates to a surfaceField then this is used as a flag
whether or not the face is in the faceSet. If the expression evaluates
to a volScalarField then the old semantic applies (faces are in the
set if one cell is true and the other is false).
This only works for internal faces
30
Submeshes automatically read if searchOnDisc specified
If a submesh is not yet in memory and the option searchOnDisc is set,
the mesh is automatically read into memory and kept there
Conditional functionObjects
The simpleFunctionObjects-library now has a number of functionOb-
jects that allow the conditional execution of a list of function objects.
These are
31
Subclass to DataEntry that uses swak -expressions
This is defined in the swak4FoamParsers-library. The class needs a
default mesh defined to construct the driver. Definition of the default
mesh (if no other driver was constructed in some function-object or
by a groovyBC) can be forced using the initSwakFunctionObject (see
the test case flowRateAngledDuct)
32
9.7.6 Discontinued features
groovyFlowRateInletVelocity
This boundary condition will be removed in future releases because the
base class now supports the more general DataEntry-class for which a
swak-subclass exists
If there is no old time value stored and in the parser dictionary the
parameter prevIterIsOldTime is set, then the previous iteration value
is used as the old time.
33
Boundary condition groovcBCDirection
Based on the directionMixed boundary condition this allows to set a
boundary condition as a Dirichlet-condition only in certain directions
while in the other directions it is a gradient-condition
Note: this should have been in the last release but was forgotten to
merge into the default branch
funkySetFields
new topoSource expressionToPoint
expressionField and manipulateField now can deal with point-
Fields
34
Support for tensors in the finiteArea-field parser
The faField-parser now supports tensors, symmetric tensors and
spherical tensors.
Not all operators are supported because the are not instantiated in
1.6-ext
New convenience-variables for the Python-Integration
These variables are added in the namespace to ease the writing of
Python-code whose output is consistent with OF
timeName Name of the current time as a string. Allows the con-
struction of directory names
outputTime Boolean that indicates whether this is a timestep where
OpenFOAM will write output
Additional operators from the fvc-namespace
The missing operators from the fvc-namespace have been added to the
Field-parser. These are
d2dt2 for all volumeFields
flux for all volumFields. Needs a surfaceField as a first argument
meshPhi for volume-vector-fields. Optional with a scalar-field that acts
as the density as the first argument. Only works in the context
of a solver with a dynamic mesh and hasnt been tested yet
The only missing operators from the fvc-namespace are volumeIntegrate=/=domainIntegrate.
These have been omitted as they are trivial to implement using other
functions
9.8.2 Infrastructure
Full parallel compilation
Thanks to patches supplied by Bruno Santos (see http://sourceforge.net/apps/mantisbt/openfoam
extend/view.php?id=105) compilation of the libraries is now possible
in parallel
Version numbers and version number reporting
Releases up to now got a version number. Utilities now report the ver-
sion number. This should make it easier to find out whether problems
are due to an old version
Still looking for a way to do that for the libraries (so that they will
report it if dynamically loaded)
35
9.8.3 Packaging
Update of the Debian-Packaging
make dpkg now genrates also a valid package if the current OpenFOAM-
installation is not installed using the dpkg.
36
-allowFunctionObjects-option not working for replayTransientBC
Function-objects only work with the while(runTime.loop())-construct
in 2.1. The utility now uses this.
FieldValues
PatchValues
SubsetValues (all Zones, sets and samples)
finiteArea-Parsers: faPatch and faField
37
As mentioned in https://sourceforge.net/apps/mantisbt/openfoam-
extend/view.php?id=130 it was not possible to construct a point-
vector field using vector(toPoint(1),toPoint(1),toPoint(1)). Same
for tensors
bison 2.4
Version 2.3 compiles but there is an offset-problem with the locations
that breaks the Plugin-functionality
Mac-users will have to install bison from another source (for instance
MacPorts)
38
9.9.2 Bug fixes
Make sure that Allwmake always uses the bash
On Ubuntu /bin/sh is something else and the scripts fail. Hardcode
to /bin/bash
downloadSimpleFunctionObjects.sh still in Makefile
This script (which was removed long ago) was still referenced in the
Makefile.
grad in fields added dimensions
grad and other operators from fvc added dimensions to values that
were supposed to be dimensionless. This has been fixed
Default condition for surface fields wrong size in funkySetFields
Due to a typo the constructed condition field was too short for surface-
fields (too long for volume-fields, but that didnt matter)
mappedFvPatch not treated like regular patches
The field-driver created patch fields there as calcuated when zeroGradient
would have been more appropriate
flip() for faceSet not correctly calculated
A SortableList was used which meant that the vector with the flip
values was not in the correct order
fset() crashes when faceSet has boundary faces
This problem was due to a non-special treatment of faces on the bound-
ary. Fixed (for faceZone as well).
Also boundary faces are now honored in expressionToFace if the ex-
pression is a surface-field (for the volume-field logic boundary faces will
never work)
groovyBC produced incorrect results with wallHeatFlux etc
The reason was that during construction refGradient, refValue etc
were not read correctly (if present).
This is now fixed in groovyBC and the other BCs (groovyBC for point-
Fields and groovyBCDirection)
Global variables not found in faField
The Lexer correctly identified the variable but the getField method
did not know how to get it.
Fixed
39
Wrong type of condition field in funkySetAreaFields
If no condition was evaluated the utility generated a pseudo-field of
the wrong length
40
cof and diag undefined
Added. Diag had to be reprogrammed as it is not implemented for
fields (probably for performance reasons).
Also some tensor operators were missing (probably lost during copy/-
paste)
"var =T*2;"
Now all the spaces are removed before assigning to variables. This will
also remove spaces on the inside thus making
"v ar =T*2;"
the same as the above expression. But it is unlikely that the call will
be used in this way
Missing div-operations
These valid div-operations were missing from the grammar:
41
Dimension checking makes expressionField fail
Reason is that during the calculation of the variables dimensions are
checked.
Now the functionObject switches the checking off. But a more general
solution is desirable
9.9.3 Enhancements
Topology-operators now support variables etc
The topology operators expressionToCell, expressionToFace and
expressionToPoint now support variables and the other supporting
keywords if being constructed with a dictionary (for instance from the
topoSet-utility)
42
The function internalFace() is 1 on all internal faces and 0 on all
patches
43
swak-expression an expression parsed by one of the swak-parsers.
The type of this expression does not necessarily have to be the
same as the one of the main expression.
It has been tried to make the names unique instead of short. Usually
function names from one library are prefixed with the same short string.
44
stdoutFromCommandProvider executes a program and takes the
standard output as the dictionary text
stdoutFromPythonScriptProvider executes a python-script and
takes the stdout as the dictionary text
The string must be in the format o a regular OpenFOAM-dictionary
with an entry functions from which the functionObjects are generated
Function object readAndUpdateFields
This FO in the simpleFunctionObjects reads a number of fields and
updates their boundary conditions at every timestep.
Main purpose is to let groovyBC do calculations and use the results for
post-processing purposes
Does not support surface-fields as these dont have a correctBoundaryConditions-
method.
Example of the usage in the angledDuctImplicit-case (the results are
of limited value because of the temperature boundary condition)
Source terms based on basicSource
Three source terms were added. These source terms are in the
swakSourceFields-library and can be used with solvers that use the
sourcesProperties-dictionary. The sources are
SwakSetValue sets values according to a mask or the mechanism
provided by basicSource
SwakExplicitSource Uses the calculated source term on the right
hand side of the equation
SwakImplicitSource Uses a calculated scalar-field to add an implicit
source term (source is without the actual field)
These fields are only implemented in the 2.x-version of swak because
the interface of basicSource is very different in 1.7 and a backport
was unnecessary
Function objects that stop a run gracefully
simpleFunctionObjects now has a function object writeAndEndFieldRange
that stops a run (and writes the last time) if a field is outside a specified
range.
A similar function object writeAndEndSwakExpression is in the
simpleSwakFunctionObjects that stops if a swak-expression evaluates
to true. writeAndEndPython does the same in pythonIntegration.
45
Note: after the run is written one more timestep is calculated (this
seems to be due to the fact that FOs are calculated at the start of
a timestep). Also there are issues if the next timestep is a scheduled
write-time (this only seem to be an issue with 1.7.x. It all works fine
on 2.1.x)
46
9.9.5 Infrastructure
Compilation script checks SWAK4FOAM_SRC
The environment variable SWAK4FOAM_SRC is needed for the swakCoded-
functionObject. The Allwmake-script now checks whether this variable
exists and prints a message with the correct value if it doesnt. It also
checks whether the value is correct and warns if it isnt
47