Merge branch 'master' into dsmc

This commit is contained in:
graham
2009-07-29 14:16:27 +01:00
2034 changed files with 13566 additions and 16444 deletions

17
.gitignore vendored
View File

@ -4,9 +4,13 @@
# editor and misc backup files - anywhere # editor and misc backup files - anywhere
*~ *~
.*~ .*~
*.orig
*.bak *.bak
*.bak[0-9][0-9]
*.orig
*.orig[0-9][0-9]
\#*\# \#*\#
# file-browser settings - anywhere
.directory .directory
# CVS recovered versions - anywhere # CVS recovered versions - anywhere
@ -18,7 +22,7 @@
*.so *.so
*.jar *.jar
# ignore derived files # derived files
lex.yy.c lex.yy.c
# Corefiles # Corefiles
@ -30,7 +34,7 @@ core
# lnInclude (symlink) folders - anywhere # lnInclude (symlink) folders - anywhere
lnInclude lnInclude
# build folder(s) - anywhere # build folders - anywhere
linux*Gcc*/ linux*Gcc*/
linux*Icc*/ linux*Icc*/
linuxming*/ linuxming*/
@ -41,15 +45,14 @@ SunOS*Gcc*/
# reinstate wmake/rules that might look like build folders # reinstate wmake/rules that might look like build folders
!wmake/rules/*/ !wmake/rules/*/
# but do continue to ignore the derived wmake files
wmake/rules/*/dirToString
wmake/rules/*/wmkdep
# doxygen generated documentation # doxygen generated documentation
doc/[Dd]oxygen/html doc/[Dd]oxygen/html
doc/[Dd]oxygen/latex doc/[Dd]oxygen/latex
doc/[Dd]oxygen/man doc/[Dd]oxygen/man
# Other HTML files e.g. ReleaseNotes-?.?.html
*.html
# source packages - anywhere # source packages - anywhere
*.tar.bz2 *.tar.bz2
*.tar.gz *.tar.gz

View File

@ -1,13 +1,21 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
set -x
if [ "$PWD" != "$WM_PROJECT_DIR" ]
then
echo "Error: Current directory in not \$WM_PROJECT_DIR"
echo " The environment variable are not consistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
fi
# wmake is required for subsequent targets # wmake is required for subsequent targets
( cd wmake/src && make ) ( cd wmake/src && make )
# build ThirdParty sources # build ThirdParty sources
( cd $WM_THIRD_PARTY_DIR && ./Allwmake ) $WM_THIRD_PARTY_DIR/Allwmake
# build OpenFOAM libraries and applications
src/Allwmake src/Allwmake
applications/Allwmake applications/Allwmake

98
README
View File

@ -1,8 +1,8 @@
# -*- mode: org; -*- # -*- mode: org; -*-
# #
#+TITLE: *OpenFOAM README for version 1.5* #+TITLE: OpenFOAM README for version 1.6
#+AUTHOR: OpenCFD Ltd. #+AUTHOR: OpenCFD Ltd.
#+DATE: 26 August 2008 #+DATE: July 2009
#+LINK: http://www.opencfd.co.uk #+LINK: http://www.opencfd.co.uk
#+OPTIONS: author:nil ^:{} #+OPTIONS: author:nil ^:{}
@ -23,17 +23,15 @@
section "Running OpenFOAM in 32-bit mode". section "Running OpenFOAM in 32-bit mode".
*** Qt (from http://trolltech.com/products/qt) *** Qt (from http://trolltech.com/products/qt)
The ParaView 3.3 visualisation package requires that Qt version 4.3.x MUST The ParaView 3.6.1 visualisation package requires Qt to be installed on the
be installed on the system. Earlier or more recent versions (4.2.x or system. ParaView's producers state that ParaView is only officially
4.4.x) will NOT work. To check whether Qt4 is installed, and the version, supported on Qt version 4.3.x. However, we have found in limited tests that
type: ParaView works satisfactorily with newer versions of Qt than 4.3.x. To
check whether Qt4 is installed, and the version, type:
+ qmake --version + qmake --version
The ParaView binary executables in the ThirdParty distribution will only Both 32-bit and 64-bit version of ParaView were compiled with Qt-4.4.3 (with
work with PRECISELY the same version of Qt with which it was compiled. The openSUSE-11.1). If the user finds that a ParaView binary fails to run, then
64-bit version of ParaView was compiled with Qt-4.3.1 (with openSuSE-10.3)
and the 32-bit version of ParaView was compiled with Qt-4.3.2 (with
ubuntu-7.10). If the user finds that a ParaView binary fails to run, then
it is almost certainly due to a conflict in compiled and installed Qt it is almost certainly due to a conflict in compiled and installed Qt
versions and they will need to consult the section below on "Compiling versions and they will need to consult the section below on "Compiling
ParaView and the PV3FoamReader module." ParaView and the PV3FoamReader module."
@ -41,9 +39,11 @@
The default versions of Qt used by some GNU/Linux releases are as follows. The default versions of Qt used by some GNU/Linux releases are as follows.
+ ubuntu-7.10: Version 4.3.2 + ubuntu-7.10: Version 4.3.2
+ ubuntu-8.04: Version 4.3.4 + ubuntu-8.04: Version 4.3.4
+ openSuSE-10.2: Version 4.2.1 - too old + ubuntu-9.04: Version 4.5.0
+ openSuSE-10.3: Version 4.3.1 + openSUSE-10.2: Version 4.2.1 - too old
+ openSuSE-11.0: Version 4.4.0 - too new + openSUSE-10.3: Version 4.3.1
+ openSUSE-11.0: Version 4.4.0
+ openSUSE-11.1: Version 4.4.3
Compilation and running of ParaView has been successful using the libraries Compilation and running of ParaView has been successful using the libraries
downloaded in the "libqt4-dev" package on ubuntu. downloaded in the "libqt4-dev" package on ubuntu.
@ -51,7 +51,7 @@
If you don't have an appropriate version of Qt installed you can download If you don't have an appropriate version of Qt installed you can download
the sources from TrollTech e.g.: the sources from TrollTech e.g.:
ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.3.5.tar.bz2 ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.3.5.tar.bz2
and compile and install in /usr/local or some other location that does to and compile and install in /usr/local or some other location that does not
conflict with the pre-installed version. conflict with the pre-installed version.
* Installation * Installation
@ -61,14 +61,13 @@
The environment variable settings are contained in files in an etc/ directory The environment variable settings are contained in files in an etc/ directory
in the OpenFOAM release. e.g. in in the OpenFOAM release. e.g. in
+ $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/ + $HOME/OpenFOAM/OpenFOAM-1.6/etc/
+ where <VERSION> corresponds to the version 1.4, 1.5, ...
1) EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the 1) EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the
etc/bashrc file by adding the following line to the end of your etc/bashrc file by adding the following line to the end of your
$HOME/.bashrc file: $HOME/.bashrc file:
+ . $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/bashrc + . $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc
Then update the environment variables by sourcing the $HOME/.bashrc file by Then update the environment variables by sourcing the $HOME/.bashrc file by
typing in the terminal: typing in the terminal:
@ -78,7 +77,7 @@
2) OR, if running tcsh or csh, source the etc/cshrc file by adding the 2) OR, if running tcsh or csh, source the etc/cshrc file by adding the
following line to the end of your $HOME/.cshrc file: following line to the end of your $HOME/.cshrc file:
+ source $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/cshrc + source $HOME/OpenFOAM/OpenFOAM-1.6/etc/cshrc
Then update the environment variables by sourcing the $HOME/.cshrc file by Then update the environment variables by sourcing the $HOME/.cshrc file by
typing in the terminal: typing in the terminal:
@ -94,13 +93,13 @@
appropriate resource file. Here is a bash/ksh/sh example: appropriate resource file. Here is a bash/ksh/sh example:
+ export FOAM_INST_DIR=/data/app/OpenFOAM + export FOAM_INST_DIR=/data/app/OpenFOAM
+ foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc + foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/bashrc
+ [ -f $foamDotFile ] && . $foamDotFile + [ -f $foamDotFile ] && . $foamDotFile
and a csh/tcsh example: and a csh/tcsh example:
+ setenv FOAM_INST_DIR /data/app/OpenFOAM + setenv FOAM_INST_DIR /data/app/OpenFOAM
+ foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc + foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/bashrc
+ if ( -f $foamDotFile ) source $foamDotFile + if ( -f $foamDotFile ) source $foamDotFile
The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts
@ -113,7 +112,7 @@
which may be obtained from http://gcc.gnu.org/. which may be obtained from http://gcc.gnu.org/.
Install the compiler in Install the compiler in
$WM_PROJECT_INST_DIR/ThirdParty/gcc-<GCC_VERSION>/platforms/$WM_ARCH$WM_COMPILER_ARCH/ $WM_THIRD_PARTY_DIR/gcc-<GCC_VERSION>/platforms/$WM_ARCH$WM_COMPILER_ARCH/
and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and
$WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the $WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the
environment variables as in section 3. environment variables as in section 3.
@ -121,10 +120,12 @@
Now go to the top-level source directory $WM_PROJECT_DIR and execute the Now go to the top-level source directory $WM_PROJECT_DIR and execute the
top-level build script './Allwmake'. In principle this will build everything, top-level build script './Allwmake'. In principle this will build everything,
but if problems occur with the build order it may be necessary to update the but if problems occur with the build order it may be necessary to update the
environment variables and re-execute 'Allwmake'. If you experience environment variables and re-execute './Allwmake'.
difficulties with building the source-pack, or your platform is not currently
supported, please contact <enquiries@OpenCFD.co.uk> to negotiate a support If you experience difficulties with building the source-pack, or your platform
contract and we will do the port and maintain it for future releases. is not currently supported, please contact <enquiries@OpenCFD.co.uk> to
negotiate a support contract and we will do the port and maintain it for
future releases.
* Testing the installation * Testing the installation
To check your installation setup, execute the 'foamInstallationTest' script To check your installation setup, execute the 'foamInstallationTest' script
@ -135,33 +136,37 @@
* Getting Started * Getting Started
Create a project directory within the $HOME/OpenFOAM directory named Create a project directory within the $HOME/OpenFOAM directory named
<USER>-<VERSION> (e.g. 'chris-1.5' for user chris and OpenFOAM version 1.5) <USER>-1.6 (e.g. 'chris-1.6' for user chris and OpenFOAM version 1.6)
and create a directory named 'run' within it, e.g. by typing: and create a directory named 'run' within it, e.g. by typing:
+ mkdir -p $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run + mkdir -p $FOAM_RUN/run
Copy the 'tutorial' examples directory in the OpenFOAM distribution to the Copy the 'tutorial' examples directory in the OpenFOAM distribution to the
'run' directory. If the OpenFOAM environment variables are set correctly, 'run' directory. If the OpenFOAM environment variables are set correctly,
then the following command will be correct: then the following command will be correct:
+ cp -r $WM_PROJECT_DIR/tutorials + cp -r $WM_PROJECT_DIR/tutorials $FOAM_RUN
$HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
Run the first example case of incompressible laminar flow in a cavity: Run the first example case of incompressible laminar flow in a cavity:
+ cd $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run/tutorials/icoFoam/cavity + cd $FOAM_RUN/tutorials/incompressible/icoFoam/cavity
+ blockMesh + blockMesh
+ icoFoam + icoFoam
+ paraFoam + paraFoam
* Compiling Paraview 3.3 and the PV3FoamReader module Refer to the OpenFOAM User Guide at http://www.OpenFOAM.org/doc/user.html for
A version of Qt 4.3.x must be installed to compile ParaView. The compilation more information.
is a fairly simple process using the supplied buildParaView3.3-cvs script that
has worked is our tests with other packages supplied in the ThirdParty * Compiling Paraview 3.6.1 and the PV3FoamReader module
directory, namely cmake-2.4.6 and gcc-4.3.1. Execute the following: If there are problems encountered with ParaView, then it may be necessary to
+ cd $FOAM_INST_DIR/ThirdParty compile ParaView from sources. The compilation
+ rm -rf ParaView3.3-cvs/platforms is a fairly simple process using the makeParaView script
+ buildParaView3.3-cvs (found in ThirdParty directory), which has worked in our tests with other
packages supplied in the ThirdParty directory, namely cmake-2.6.4 and
gcc-4.3.3. Execute the following:
+ cd $WM_THIRD_PARTY_DIR
+ rm -rf paraview-3.6.1/platforms
+ ./makeParaView
The PV3FoamReader module is an OpenFOAM utility that can be compiled in the The PV3FoamReader module is an OpenFOAM utility that can be compiled in the
usual manner as follows: usual manner as follows:
@ -169,6 +174,21 @@
+ ./Allwclean + ./Allwclean
+ ./Allwmake + ./Allwmake
*** Compiling Paraview with a local version of Qt
If the user still encounters problems with ParaView, it may relate to the
version of Qt, in which case, it is recommended that the user first
downloads a supported version of Qt /e.g./ 4.3.5 as described in the section
on "Qt". The user should unpack the source pack in the $WM_THIRD_PARTY_DIR.
Then the user can build Qt by executing from within $WM_THIRD_PARTY_DIR:
+ makeQt
The user should then compile ParaView using the local version of Qt by
executing makeParaView with the -qmake option, giving the full path of the
newly built qmake as an argument:
+ makeParaView -qmake <path_to_qmake>
The user must then recompile the PV3FoamReader module as normal (see above).
* Documentation * Documentation
http://www.OpenFOAM.org/doc http://www.OpenFOAM.org/doc

View File

@ -1,176 +0,0 @@
# -*- mode: org; -*-
#
#+TITLE: *OpenFOAM release notes for version 1.5*
#+AUTHOR: OpenCFD Ltd.
#+DATE: 07 October 2008
#+LINK: http://www.opencfd.co.uk
#+OPTIONS: author:nil ^:{}
* Overview
OpenFOAM-1.5 is is a significant upgrade to version 1.4 in ways which are
outlined below. This release passes all our standard tests and the tutorials
have been broadly checked. If there are any bugs, please report them using
the instructions set out in: http://www.OpenFOAM.org/bugs.html.
Most of the developments for this release are in: new applications, e.g. for
multiphase flow and cavitation, buoyancy-flow and heat transfer, high speed
flows and even molecular dynamics; new utilities, e.g. for meshing and case
monitoring; and, new modelling, e.g. in Lagrangian particle tracking,
radiation and rotating frames of reference. With these new applications come
numerous new example cases.
* GNU/Linux version
The 64bit binary packs of the OpenFOAM release were compiled on a machine
running SuSE GNU/Linux version 10.3 and the 32bit on a machine running Ubuntu
GNU/Linux version 7.1 and also tested on Ubuntu 8.04. We recommend that
users run OpenFOAM on one of these or a similar recent version of GNU/Linux.
This release has also been successfully compiled and tested on older GNU/Linux
releases but this requires the installation of Qt 4.3.? for ParaView-3 to run.
* C++ Compiler version
+ Released compiled with GCC 4.3.1, the latest version.
+ Built in support for the Intel C++ 10.? compiler (untested).
+ The choice of the compiler is controlled by the setting of the $WM_COMPILER
and $WM_COMPILER_ARCH environment variables in the OpenFOAM-1.5/etc/bashrc
(or cshrc) file.
+ The location of the installation of the compiler is controlled by the
$compilerInstall environment variable in the OpenFOAM-1.5/etc/settings.sh
(or settings.csh) file.
* Developments to solvers (applications)
+ New rhoCentralFoam solver for high-speed, viscous, compressible flows using
non-oscillatory, central-upwind schemes.
+ New interDyMFoam solver for 2 incompressible, isothermal, immiscible fluids
using a VoF phase-fraction based interface capturing approach, with optional
mesh motion and mesh topology changes including adaptive mesh
(un)refinement. Useful for simulations such as tank filling, sloshing ---
using solid body motion e.g. SDA or SKA (6DoF) --- and slamming (using the
mesh motion solver) and other large-scale applications that benefit from the
efficiency gain of adaptive mesh (un)refinement of the interface.
+ New compressibleInterFoam solver for 2 compressible, isothermal, immiscible
fluids using a volume of fluid (VoF) phase-fraction approach for
interface-capturing. The momentum and other fluid properties are of the
"mixture" and a single momentum equation is solved. Turbulence is modelled
using a run-time selectable incompressible LES model.
+ New interPhaseChangeFoam solver for 2 incompressible, isothermal, immiscible
fluids with phase-change, e.g. cavitation. Uses VoF interface capturing,
with momentum and other fluid properties described for the ``mixture'' and a
single momentum equation is solved. The set of phase-change models provided
are designed to simulate cavitation but other mechanisms of phase-change are
supported within this solver framework.
+ New rasCavitatingFoam solver for transient cavitation using a barotropic
compressibility model, with RAS turbulence.
+ New lesCavitatingFoam solver for transient cavitation using a barotropic
compressibility model, with LES turbulence.
+ New chtMultiRegionFoam solver that couples conjugate heat transfer in a
solid to a buoyancy-driven flow simulation.
+ New PDRFoam solver for compressible premixed/partially-premixed turbulent
combustion that includes porosity/distributed resistance (PDR) modelling to
handle regions containing solid blockages which cannot be resolved by the
mesh. Requires the PDR fields.
+ New lesBuoyantFoam solver for transient, buoyant, turbulent flow of
compressible fluids for ventilation and heat-transfer. Turbulence is
modelled using a run-time selectable compressible LES model.
+ New rhoPimpleFoam solver for transient, turbulent flow of compressible
fluids for ventilation and heat-transfer. Uses the flexible PIMPLE
(PISO-SIMPLE) solution for time-resolved and pseudo-transient simulations.
+ New buoyantSimpleRadiationFoam solver for steady-state, buoyant, turbulent
flow of compressible fluids with radiation, for ventilation and
heat-transfer.
+ New rhoTurbTwinParcelFoam solver for transient for compressible, turbulent
flow with two thermo-clouds.
+ New gnemdFOAM solver for general purpose molecular dynamics that simulates
atoms in arbitrary shaped domains and average atomic/molecular quantities to
the mesh to create field data.
+ New mdEqulibrationFoam solver to equilibrates and/or preconditions molecular
dynamics systems.
+ Demonstration SRFSimpleFoam solver based on simpleFoam that incorporates the
SRF extensions (see below) for rotating flows.
* Automatic mesher
New snappyHexMesh utility that generates split-hex meshes automatically from
triangulated (STL) surface geometries. The mesh approximately conforms to
the surface by iteratively refining a starting mesh and morphing the
resulting split-hex mesh to the surface. An optional phase will shrink back
the resulting mesh and insert cell layers. It has a flexible specification
of mesh refinement level and robust surface handling with a pre-specified
final mesh quality. It runs in parallel with a load balancing step every
iteration.
* Developments to utilities
+ New extrude2DMesh utility that extrudes 2D meshes into a 3D mesh. 2D meshes
are described by faces with 2 points, so can be used in combination with 2D
meshes converted with ccm26ToFoam.
+ New couplePatches functionality integrated into createPatch, which
optionally synchronises ("couples") points and faces of coupled (cyclic,
processor) patches.
+ New applyBoundaryLayer pre-processing utility to apply 1/7th power-law
boundary layers at walls, starting from uniform or potential flow solutions.
+ New execFlowFunctionObjects utility executes functionObjects as a
post-processing activity, e.g. probes, sampling, force calculation.
+ New changeDictionary utility makes batch changes to OpenFOAM input files,
e.g. to change boundary conditions of field files.
+ New foamCalc utility, a generic post-processing field calculator tool
+ New molConfig pre-processing utility for molecular dynamics cases. Fills
zones of a mesh with single crystal lattices of specified structure,
density, orientation, alignment and temperature.
+ Extended splitMeshRegions utility to split multi-zone meshes, e.g. defined
through cellZones, into separate meshes.
+ Extended the foamToVTK, decomposePar, reconstructPar and mapFields utilities
to include support for multiple particle clouds in parallel processing.
* Migration from ParaView 2.4 to ParaView 3.x
+ Rewritten OpenFOAM Reader Module for version 3, a major redesign of
ParaView.
+ New features include viewing patch names, reading of Lagrangian data,
handling of cell, face and point sets, multiple views.
* Model development
+ Overhauled the lagrangian library to support multiple clouds.
+ New lagrangianIntermediate library incorporating a hierarchy of parcel and
cloud types, accommodating kinematic, thermodynamic and reacting
applications, including coupling to the new radiation library. Sub-models
are added at the relevant level of physics, e.g.:
- kinematic: injection, wall interaction, drag, dispersion;
- thermo: heat transfer;
- reacting: reacting composition, mass transfer, surface reactions.
+ New single rotating frame of reference (SRF) library for rotating flow
applications, e.g. turbo-machinery.
+ New radiation library including the P1 model and associated Marshak boundary
conditions for incident radiation.
+ New displacementInterpolation motion solver for flexible mesh scaling.
+ New molecularDynamics Lagrangian library to calculate intermolecular forces
between spherically symmetrical monatomic species in arbitrary geometries.
* New functionObjects
To aid common monitoring and post-processing activities.
+ forces: calculate the force and moment on a patch or set of patches, e.g. to
calculate the lift, drag and moment of an object in the flow.
+ forceCoeffs: calculate the normalised force and moment on a patch or set of
patches, e.g. to calculate the lift, drag and moment coefficients of an
object in the flow.
+ fieldAverage: calculate field arithmetic mean and prime-squared averages for
a list of fields.
+ foamCalcFunctions: calculate field components, div, mag, magGrad or magSqr.
* Improvements to boundary conditions
+ Generalised jumpCyclic type: cyclic condition with an additional prescribed
jump in value.
+ fan type: specialisation of jumpCyclic, applying a prescribed jump in
pressure to simulate a fan within a mesh.
+ Generalised advective outflow boundary condition based on solving D/Dt(psi,
U) = 0 at the boundary.
+ Additional turbulent flow inlet to specify mixing length and frequency.
+ Generalisation of time varying set of boundary conditions.
* Other
+ New argument-free command execution, e.g typing "icoFoam" without root and
case directory arguments.
+ Extended time command line options.
+ Many enhancements to dictionary including macro substitution, optional
merging and default/overwrite behaviour, enhanced "#include" file handling
and the framework to support function evaluation.
+ Cross-links between applications and Doxygen documentation with the "-doc"
argument.
+ Non-blocking, non-buffered, parallel transfers with potential scaling
benefits for larger number of processors.

374
ReleaseNotes-1.6 Normal file
View File

@ -0,0 +1,374 @@
# -*- mode: org; -*-
#
#+TITLE: OpenFOAM release notes for version 1.6
#+AUTHOR: OpenCFD Ltd.
#+DATE: July 2009
#+LINK: http://www.opencfd.co.uk
#+OPTIONS: author:nil ^:{}
* Overview
OpenFOAM-1.6 is a significant upgrade to version 1.5 in ways that are
outlined below. This release passes all our standard tests and the
tutorials have been broadly checked. If there are any bugs, please report
them using the instructions set out here:
http://www.OpenFOAM.org/bugs.html.
* GNU/Linux version
The 32bit and 64bit binary packs of the OpenFOAM release were compiled on
a machine running openSUSE GNU/Linux version 11.1 and also tested on
Ubuntu 9. We recommend that users run OpenFOAM on one of these, or on a
similarly recent version of GNU/Linux. This release has also been
successfully compiled and tested on older GNU/Linux releases, but this
requires the installation of Qt 4.3.? (the sources for which are supplied
with OpenFOAM-1.6, see README) for ParaView-3 to run.
* C++ Compiler version
+ Release compiled with GCC 4.3.3.
+ Built-in support for the Intel C++ 10.? compiler (untested).
+ The choice of the compiler is controlled by the setting of the
~$WM_COMPILER~ and ~$WM_COMPILER_ARCH~ environment variables in the
/OpenFOAM-1.6/etc/bashrc/ (or /cshrc/) file.
+ The location of the compiler installation is controlled by the
~$compilerInstall~ environment variable in the
/OpenFOAM-1.6/etc/settings.sh/ (or /settings.csh/) file.
* Library developments
*** Core library
***** Dictionary improvements/changes
+ Dictionaries can use words (unquoted) or regular expressions (quoted)
for their keywords. When searching, an exact match has priority over a
regular expression match. Multiple regular expressions are matched in
reverse order.
+ The *new* =#includeIfPresent= directive is similar to the =#include=
directive, but does not generate an error if the file does not exist.
+ The default =#inputMode= is now '=merge=', which corresponds to the most
general usage. The =#inputMode warn= corresponds to the previous default
behaviour.
+ The *new* =#inputMode protect= can be used to conditionally merge
default values into existing dictionaries.
+ *New* =digest()= method to calculate and return the SHA1 message digest.
***** Regular Expressions
The addition of regular expressions marks a major improvement in
usability.
+ *New* =regExp= class provides support for accessing POSIX extended
regular expresssions from within OpenFOAM.
+ *New* =wordRe= class can contain a =word= or a =regExp= .
+ *New* =stringListOps= to search string lists based on regular
expressions, =wordRe= or =wordReList=.
+ =Istream= and =Ostream= now retain backslashes when reading/writing
strings.
***** Convenience changes
+ =IOobject= has a *new* constructor for creating an =IOobject= from a
single-path specification (eg, see =blockMesh -dict= option).
+ =argList= has *new* convenience methods for accessing options more
directly: =option()=, =optionFound()=, =optionLookup()=, =optionRead()=,
=optionReadIfPresent()=.
+ The *new* =readList(Istream&)= can read a bracket-delimited list or
handle a single value as a list of size 1. This can be a useful
convenience when processing command-line options.
+ Export *new* environment variable =FOAM_CASENAME= that contains the
name part of the =FOAM_CASE= environment variable.
*** Turbulence modelling
+ Major development of turbulence model libraries to give extra flexibility
at the solver level. For solvers that can support either RAS/LES
computations, the selection is made in the
/constant/turbulenceProperties/, by setting the =simulationType= keyword
to:
- =laminar=,
- =RASModel=,
- =LESModel=.
+ Depending on the selection, the model is the instantiated from /constant//
- /RASProperties/,
- /LESProperties/.
***** RAS wall functions
Wall functions are now run-time selectable per patch for RAS.
+ Velocity:
- Apply to turbulent viscosities =nut= or =mut=,
- Apply to =k=, =Q=, =R=,
- Apply to =epsilon=, =omega=.
+ Temperature:
- Apply to turbulent thermal diffusivity, =alphat= (compressible only).
+ To apply wall functions:
- To recapture the functionality of previous OpenFOAM versions (v1.5 and
earlier) assign:
- for velocity:
- =nut=: =nutWallFunction=,
- =mut=: =muWallFunction=,
- =epsilon=: =epsilonWallFunction=,
- =omega=: =omegaWallFunction=,
- =k=, =q=, =R=: =kqRWallFunction=.
- for temperature:
- =alphat=: =alphatWallFunction=.
- New =alphaSgsJayatillekeWallFunction= thermal wall function for
compressible LES.
***** *New* LES turbulence models
+ Spalart-Allmaras DDES.
+ Spalart-Allmaras IDDES.
***** Upgrading:
+ *New* utility - =applyWallFunctionBoundaryConditions=.
+ Solvers will automatically update existing cases.
- New fields created based on the presence of the =nut/mut= field.
- Boundary conditions include scoping, i.e compressibility:: for
compressible solvers.
- Modified fields will be backed-up to /<field>.old/.
+ NOTE:
- Fields are only updated for those fields associated with the current
turbulence model selection, i.e. if fields exist for use with other
models, they will not be updated.
- The new specification is not backwards compatible.
*** Thermo-physical Models
+ Old compressibility-based thermo package renamed
=basicThermo= \rightarrow =basicPsiThermo=.
+ *New* =basicRhoThermo= thermo package.
- Additional density field stored.
- General form - can be used for other types of media, e.g. liquids.
- Additional polynomial-based thermodynamics:
- Equation of state: =icoPolynomial=,
- Transport: =polynomialTransport=,
- Thermo: =hPolynomialThermo=.
+ Removed earlier hard-coding of gas thermophysics for chemistry modelling:
- =reactingMixture= now templated on thermo package,
- =chemistryModel= now templated on thermo package,
- =chemistrySolver= now templated on thermo package.
+ *New* =fvDOM= radition model
- finite volume, discrete ordinates method.
+ *New* (reinstated) =eThermo= thermodynamics package
- internal energy-based thermodynamics.
*** Lagrangian
***** Intermediate
+ Overhaul of the underlying framework.
+ Reacting now split into reacting and reacting multiphase.
+ New structure for variable composition.
+ Many new sub-models, including:
- Injection
- =PatchInjection= - injection local to patch face cells,
- =FieldActivatedInjection= - injection based on satisfying external
criterion,
- LookupTableInjection - explicity define injection locations and all
parcel properties.
- Post-processing
- patch post-processing - collect data for parcels impacting user,
defined patches.
- Patch interaction
- generalised behaviour for parcel interaction with patch.
- Phase change
- liquid evaporation.
***** Coal combustion
+ *New* library - extension of reacting-multiphase functionality.
- Surface reaction/combustion models.
*** Discrete methods
+ *New* library offering DSMC simulation functionality - see =dsmcFoam=
below.
+ Significant development of the libraries offering molecular dynamics
simulation functionality - see =mdFoam= and =mdEquilibrationFoam= below.
*** Numerics
+ *new* polynomial-fit higher-order interpolation schemes:
- =biLinearFit=
- =linearFit=
- =quadraticLinearFit=
- =quadraticFit=
- =linearPureUpwindFit=
- =quadraticLinearPureUpwindFit=
- =quadraticLinearUpwindFit=
- =quadraticUpwindFit=
- =cubicUpwindFit=
+ *new* polynomial-fit higher-order Sn-Grad: =quadraticFitSnGrad=.
*** *New* surfMesh library
Provides a more efficient storage mechanism than possible with =triSurface=
without restrictions on the shape of the face (templated parameter).
+ =MeshedSurface= class - with zero or more contiguous =surfZones= .
+ =UnsortedMeshedSurface= class - unordered surface zones (as per
=triSurface=).
+ =surfMesh= class - for reading/writing in native OpenFOAM format.
* Solvers
*** Solver restructuring
The upgrade to the turbulence models means that the simulation type, i.e.
laminar, RAS or LES can be selected at run time. This has allowed a reduction
in the number of solvers, simplifying the overall code structure
+ Solvers which support laminar, RAS and LES:
- =turbFoam=, =oodles= \rightarrow =pisoFoam=.
- =turbDyMFoam= \rightarrow =pimpleDyMFoam=.
- =rhoTurbFoam=, =coodles= \rightarrow =rhoPisoFoam=.
- =xoodles= \rightarrow absorbed into =XiFoam=.
- =buoyantFoam=, =lesBuoyantFoam= \rightarrow =buoyantPisoFoam=.
- =interFoam=, =rasInterFoam=, =lesInterFoam= \rightarrow =interFoam=.
- =lesCavitatingFoam=, =rasCavitatingFoam= \rightarrow =cavitatingFoam=.
+ Solvers which support LES only:
- =channelOodles= \rightarrow =channelFoam= (LES).
+ =pd= replaced by static pressure =p=. All solvers in which buoyancy affects
might be strong have been converted from using =pd= to =p= with improved
numerics to give equally good accuracy and stability. This change is
prompted by the need to remove the confusion surrounding the meaning and
purpose of =pd=.
+ =g= (acceleration due to gravity) is now a *new*
=uniformDimensionedVectorField= which has the behaviour of a field, is
registered to an =objectRegistry=, but stores only a single value. Thus
=g= and other =UniformDimensionedFields= can be created and looked-up
elsewhere in the code, /e.g./ in =fvPatchFields=.
*** Solver control improvements
Now uses consistent dictionary entries for the solver controls.
+ This Allows dictionary substitutions and regular expressions in
/system/fvSolution/.
+ The old solver control syntax is still supported (warning emitted), but
the *new* =foamUpgradeFvSolution= utility can be used to convert
/system/fvSolution/ to the new format.
*** *New* Solvers
+ =buoyantBoussinesqSimpleFoam= Steady state heat transfer solver using a
Boussinesq approximation for buoyancy, with laminar, RAS or LES turbulence
modelling.
+ =buoyantBoussinesqPisoFoam= Transient heat transfer solver using a
Boussinesq approximation for buoyancy, with laminar, RAS or LES turbulence
modelling.
+ =coalChemistryFoam= Transient, reacting lagrangian solver, employing a coal
cloud and a thermo cloud, with chemistry, and laminar, RAS or LES turbulence
modelling.
+ =porousExplicitSourceReactingParcelFoam= Transient, reacting lagrangian
solver, employing a single phase reacting cloud, with porous media, explicit
mass sources, and laminar, RAS or LES turbulence modelling.
+ =rhoReactingFoam= Density-based thermodynamics variant of the reactingFoam
solver, i.e. now applicable to liquid systems.
+ =dsmcFoam= DSMC (Direct Simulation Monte-Carlo) solver for rarefied gas
dynamics simulations, able to simulate mixtures of an arbitrary number of
gas species. The variable hard sphere collision model with Larsen-Borgnakke
internal energy redistribution (see "Molecular Gas Dynamics and the Direct
Simulation of Gas Flows" G.A. Bird, 1994) is available; other run-time
selectable collision models can be easily added.
*** Updated solvers
+ =mdFoam= Molecular Dynamics (MD) solver able to simulate a mixture of an
arbitrary number of mono-atomic and small, rigid polyatomic (i.e. H2O, N2)
molecular species, with 6 degree of freedom motion, in complex geometries. A
molecule of any species can be built by specifying its sites of mass and
charge. All molecules interact with short-range dispersion forces and
pairwise electrostatic interactions using methods described in: Fennell and
Gezelter, J. Chem. Phys. 124, 234104 (2006).
+ =mdEquilibrationFoam= Similar to mdFoam, but employs velocity scaling to
adjust the simulation temperature to a target value. Useful to equilibrate a
case before simulation.
+ =chtMultiRegionFoam= New boundary condition allows independent decomposition
of coupled regions without any constraint on the decomposition.
* Boundary conditions
+ Improved set of direct mapped boundary conditions.
+ =buoyantPressureFvPatchScalarField=, the *new* buoyancy pressure boundary
condition now supports =p= and =pd= for backward compatibility.
+ =uniformDensityHydrostaticPressure= is an additional pressure boundary
condition to aid the transition from =pd= to =p= as it behaves similarly to
specifying a uniform =pd= at an outlet for example.
+ =activeBaffleVelocity= dynamically combines cyclic and wall patches so that
the flow through the patch can be controlled /e.g./ by pressure drop.
+ =rotatingWallVelocity= specifies a rotating velocity, given the rotational
speed, origin and axis.
* Utilities
*** Improvements
+ =blockMesh= has a *new* =-dict= option for specifying an alternative
dictionary for the block mesh description. The '=convertToMeters=' entry
is now optional, and the alternative '=scale=' entry can be used for
less typing.
+ =foamToEnsight= has a *new* =-noPatches= option to suppress generation
of patches.
+ =foamToEnsightParts= has *new* =-noMesh= and =-index= options that can
be useful when post-processing results incrementally.
+ =snappyHexMesh= has lower memory footprint. New distributed triangulated
surface type for meshing surfaces with extremely large triangle count.
Now supports multi-region meshing of arbitrarily complex regions.
*** *New* utilities
+ =particleTracks= - generate particle tracks for lagrangian calculations.
+ =dsmcInitialise= - preprocessing utility to create initial configurations
of DSMC particles in a geometry.
+ =surfaceRedistributePar= - preprocessing utility to create distributed
triangulated surface.
*** *New* foamCalc functions
+ =interpolate= performs fvc::interpolate(<field>).
+ =randomise= randomises a <field> by a given perturbation.
+ =addSubtract= provides simple add/subtract field functionality.
*** Usage
+ =timeSelector= can now combine =-time ranges= and =-latestTime= options.
For example, -time '0.01:0.09' -latestTime vs. -time '0.01:'.
More reliable behaviour for cases missing /constant// or /0// directories.
When the =-noZero= option is enabled, =-latestTime= will not select the
=0/= directory unless the =-zeroTime= option is given.
This helps avoid ill effects caused by accidentally using the
/0// directory in certain utilities (eg, =reconstructPar=).
+ =-region= option added to more utilities.
*** Improvements to Paraview reader module
+ =PV3FoamReader= added mesh region handling. The region name is parsed
from the filename. Eg, /case{region}.OpenFOAM/.
+ =paraFoam= with a *new* =-region= option for specifying an alternative
region. A *new* =-touch= option to generate the /.OpenFOAM/ file only.
Only creates (and removes) /.OpenFOAM/ files if they didn't already
exist, which is useful in connection with the =-touch= option.
* Post-processing
+ Sampling on iso-surfaces, interpolated or non-interpolated.
+ Sampling on surface defined by distance to surface (=distanceSurface=).
+ Cutting planes for arbitrary meshes.
+ Output to any surface geometry format supported by the =surfMesh= library.
*** Function objects
***** Improvements for function objects and time-looping
+ The =functionObjectList= retains the order of the =functionObject=
order, which allows a chaining of operations. It is thus internally more
efficient when /system/controlDict/ uses =functions {..}= instead of
=functions (..)=, but both forms are supported.
+ The =functionObject= now has an additional =end()= method that is called
when =Time::loop()= or =Time::run()= determine that the time-loop exits.
Accordingly, one of these two idioms should be used in solver code:
1. =while (runTime.loop() { ... }=,
2. =while (runTime.run()) { runTime++; ... }=.
+ *New* =functionObjectList= now tracks the SHA1 message digest of the
sub-directories. This avoids reloading a =functionObject= when
something unrelated in /system/controlDict/ changed.
***** *New* function objects:
+ =systemCall= - executes a list of system instructions.
+ =fieldMinMax= - computes the min/max of a <field>.
+ =staticPressure= - converts kinematic pressure to static pressure.
+ =dsmcFields= - calculates intensive fields (velocity and temperature)
from averaged extensive fields (i.e. momentum and energy).
***** Usage
+ Improved output control: =timeStep= or =outputTime=.
* Tutorial restructuring
to reflect solver application structure.
* Third-party Software
+ =gcc= upgraded to version 4.3.3.
+ =OpenMPI= upgraded to version 1.3.3.
+ =ParaView= upgraded to version 3.6.1.
+ =Scotch= *new* decomposition method: \\
Scotch (http://gforge.inria.fr/projects/scotch/) is a general multi-level
decomposition method originating from the ScAlApplix project (Inria). It is
a framework for general recursive partitioning methods and a such comparable
to Metis but with a permissive licence.
The corresponding decomposition method (in =decomposeParDict=) is
=scotch=. An optional =strategy= string can be supplied to change the
decomposition methods; initial testing shows the default strategy producing
decompositions comparable in quality to Metis.

View File

@ -1,5 +1,14 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
if [ "$PWD" != "$WM_PROJECT_DIR/applications" ]
then
echo "Error: Current directory in not \$WM_PROJECT_DIR/applications"
echo " The environment variable are not consistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
fi
set -x set -x
wmake all solvers wmake all solvers

View File

@ -26,8 +26,8 @@ Application
PDRFoam PDRFoam
Description Description
Compressible premixed/partially-premixed combustion solver with turbulence Solver for compressible premixed/partially-premixed combustion with
modelling. turbulence modelling.
Combusting RANS code using the b-Xi two-equation model. Combusting RANS code using the b-Xi two-equation model.
Xi may be obtained by either the solution of the Xi transport Xi may be obtained by either the solution of the Xi transport

View File

@ -25,10 +25,11 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "PDRkEpsilon.H" #include "PDRkEpsilon.H"
#include "wallFvPatch.H"
#include "PDRDragModel.H" #include "PDRDragModel.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "backwardsCompatibilityWallFunctions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
@ -82,29 +83,29 @@ PDRkEpsilon::PDRkEpsilon
1.92 1.92
) )
), ),
alphak_ sigmak_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
( (
"alphak", "sigmak",
coeffDict_, coeffDict_,
1.0 1.0
) )
), ),
alphaEps_ sigmaEps_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
( (
"alphaEps", "sigmaEps",
coeffDict_, coeffDict_,
0.76923 1.3
) )
), ),
alphah_ Prt_
( (
dimensioned<scalar>::lookupOrAddToDict dimensioned<scalar>::lookupOrAddToDict
( (
"alphah", "Prt",
coeffDict_, coeffDict_,
1.0 1.0
) )
@ -147,9 +148,26 @@ PDRkEpsilon::PDRkEpsilon
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_) Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_)
),
alphat_
(
IOobject
(
"alphat",
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
autoCreateAlphat("alphat", mesh_)
) )
{ {
# include "wallViscosityI.H" mut_ = Cmu_*rho_*sqr(k_)/(epsilon_ + epsilonSmall_);
mut_.correctBoundaryConditions();
alphat_ = mut_/Prt_;
alphat_.correctBoundaryConditions();
printCoeffs(); printCoeffs();
} }
@ -214,9 +232,9 @@ bool PDRkEpsilon::read()
Cmu_.readIfPresent(coeffDict_); Cmu_.readIfPresent(coeffDict_);
C1_.readIfPresent(coeffDict_); C1_.readIfPresent(coeffDict_);
C2_.readIfPresent(coeffDict_); C2_.readIfPresent(coeffDict_);
alphak_.readIfPresent(coeffDict_); sigmak_.readIfPresent(coeffDict());
alphaEps_.readIfPresent(coeffDict_); sigmaEps_.readIfPresent(coeffDict());
alphah_.readIfPresent(coeffDict_); Prt_.readIfPresent(coeffDict());
return true; return true;
} }
@ -233,7 +251,12 @@ void PDRkEpsilon::correct()
{ {
// Re-calculate viscosity // Re-calculate viscosity
mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_);
# include "wallViscosityI.H" mut_.correctBoundaryConditions();
// Re-calculate thermal diffusivity
alphat_ = mut_/Prt_;
alphat_.correctBoundaryConditions();
return; return;
} }
@ -250,6 +273,9 @@ void PDRkEpsilon::correct()
volScalarField G = 2*mut_*(tgradU() && dev(symm(tgradU()))); volScalarField G = 2*mut_*(tgradU() && dev(symm(tgradU())));
tgradU.clear(); tgradU.clear();
// Update espsilon and G at the wall
epsilon_.boundaryField().updateCoeffs();
// Add the blockage generation term so that it is included consistently // Add the blockage generation term so that it is included consistently
// in both the k and epsilon equations // in both the k and epsilon equations
const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav"); const volScalarField& betav = U_.db().lookupObject<volScalarField>("betav");
@ -259,8 +285,6 @@ void PDRkEpsilon::correct()
volScalarField GR = drag.Gk(); volScalarField GR = drag.Gk();
# include "wallFunctionsI.H"
// Dissipation equation // Dissipation equation
tmp<fvScalarMatrix> epsEqn tmp<fvScalarMatrix> epsEqn
( (
@ -273,10 +297,10 @@ void PDRkEpsilon::correct()
- fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_) - fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_)
); );
# include "wallDissipationI.H"
epsEqn().relax(); epsEqn().relax();
epsEqn().boundaryManipulate(epsilon_.boundaryField());
solve(epsEqn); solve(epsEqn);
bound(epsilon_, epsilon0_); bound(epsilon_, epsilon0_);
@ -298,12 +322,13 @@ void PDRkEpsilon::correct()
solve(kEqn); solve(kEqn);
bound(k_, k0_); bound(k_, k0_);
// Re-calculate viscosity // Re-calculate viscosity
mut_ = rho_*Cmu_*sqr(k_)/epsilon_; mut_ = rho_*Cmu_*sqr(k_)/epsilon_;
mut_.correctBoundaryConditions();
# include "wallViscosityI.H" // Re-calculate thermal diffusivity
alphat_ = mut_/Prt_;
alphat_.correctBoundaryConditions();
} }

View File

@ -29,6 +29,20 @@ Description
Standard k-epsilon turbulence model with additional source terms Standard k-epsilon turbulence model with additional source terms
corresponding to PDR basic drag model (\link basic.H \endlink) corresponding to PDR basic drag model (\link basic.H \endlink)
The default model coefficients correspond to the following:
@verbatim
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
C3 -0.33; // only for compressible
sigmak 1.0; // only for compressible
sigmaEps 1.3;
Prt 1.0; // only for compressible
}
@endverbatim
The turbulence source term \f$ G_{R} \f$ appears in the The turbulence source term \f$ G_{R} \f$ appears in the
\f$ \kappa-\epsilon \f$ equation for the generation of turbulence due to \f$ \kappa-\epsilon \f$ equation for the generation of turbulence due to
interaction with unresolved obstacles. interaction with unresolved obstacles.
@ -68,16 +82,21 @@ class PDRkEpsilon
{ {
// Private data // Private data
// Model coefficients
dimensionedScalar Cmu_; dimensionedScalar Cmu_;
dimensionedScalar C1_; dimensionedScalar C1_;
dimensionedScalar C2_; dimensionedScalar C2_;
dimensionedScalar alphak_; dimensionedScalar sigmak_;
dimensionedScalar alphaEps_; dimensionedScalar sigmaEps_;
dimensionedScalar alphah_; dimensionedScalar Prt_;
// Fields
volScalarField k_; volScalarField k_;
volScalarField epsilon_; volScalarField epsilon_;
volScalarField mut_; volScalarField mut_;
volScalarField alphat_;
public: public:
@ -85,6 +104,7 @@ public:
//- Runtime type information //- Runtime type information
TypeName("PDRkEpsilon"); TypeName("PDRkEpsilon");
// Constructors // Constructors
//- Construct from components //- Construct from components
@ -97,7 +117,7 @@ public:
); );
// Destructor //- Destructor
virtual ~PDRkEpsilon() virtual ~PDRkEpsilon()
{} {}
@ -114,7 +134,7 @@ public:
{ {
return tmp<volScalarField> return tmp<volScalarField>
( (
new volScalarField("DkEff", alphak_*mut_ + mu()) new volScalarField("DkEff", mut_/sigmak_ + mu())
); );
} }
@ -123,7 +143,7 @@ public:
{ {
return tmp<volScalarField> return tmp<volScalarField>
( (
new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu())
); );
} }
@ -132,7 +152,7 @@ public:
{ {
return tmp<volScalarField> return tmp<volScalarField>
( (
new volScalarField("alphaEff", alphah_*mut_ + alpha()) new volScalarField("alphaEff", alphat_ + alpha())
); );
} }

View File

@ -7,6 +7,8 @@
rho*g rho*g
); );
UEqn.relax();
if (momentumPredictor) if (momentumPredictor)
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));

View File

@ -26,8 +26,8 @@ Application
XiFoam XiFoam
Description Description
Compressible premixed/partially-premixed combustion solver with turbulence Solver for compressible premixed/partially-premixed combustion with
modelling. turbulence modelling.
Combusting RANS code using the b-Xi two-equation model. Combusting RANS code using the b-Xi two-equation model.
Xi may be obtained by either the solution of the Xi transport Xi may be obtained by either the solution of the Xi transport
@ -87,12 +87,12 @@ int main(int argc, char *argv[])
runTime++; runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H" // --- Pressure-velocity PIMPLE corrector loop
#include "UEqn.H" for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{ {
#include "rhoEqn.H"
#include "UEqn.H"
#include "ftEqn.H" #include "ftEqn.H"
#include "bEqn.H" #include "bEqn.H"
#include "huEqn.H" #include "huEqn.H"
@ -103,10 +103,14 @@ int main(int argc, char *argv[])
hu == h; hu == h;
} }
#include "pEqn.H" // --- PISO loop
} for (int corr=1; corr<=nCorr; corr++)
{
#include "pEqn.H"
}
turbulence->correct(); turbulence->correct();
}
rho = thermo.rho(); rho = thermo.rho();

View File

@ -52,7 +52,7 @@ if (ign.ignited())
+ mvConvection->fvmDiv(phi, b) + mvConvection->fvmDiv(phi, b)
+ fvm::div(phiSt, b, "div(phiSt,b)") + fvm::div(phiSt, b, "div(phiSt,b)")
- fvm::Sp(fvc::div(phiSt), b) - fvm::Sp(fvc::div(phiSt), b)
- fvm::laplacian(turbulence->muEff(), b) - fvm::laplacian(turbulence->alphaEff(), b)
); );
@ -90,7 +90,7 @@ if (ign.ignited())
// ~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~
surfaceScalarField phiXi = surfaceScalarField phiXi =
phiSt phiSt
- fvc::interpolate(fvc::laplacian(turbulence->muEff(), b)/mgb)*nf - fvc::interpolate(fvc::laplacian(turbulence->alphaEff(), b)/mgb)*nf
+ fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf; + fvc::interpolate(rho)*fvc::interpolate(Su*(1.0/Xi - Xi))*nf;

View File

@ -1,7 +1,7 @@
tmp<fv::convectionScheme<scalar> > mvConvection tmp<fv::convectionScheme<scalar> > mvConvection
( (
fv::convectionScheme<scalar>::New fv::convectionScheme<scalar>::New
( (
mesh, mesh,
fields, fields,
phi, phi,
@ -17,6 +17,6 @@ if (composition.contains("ft"))
( (
fvm::ddt(rho, ft) fvm::ddt(rho, ft)
+ mvConvection->fvmDiv(phi, ft) + mvConvection->fvmDiv(phi, ft)
- fvm::laplacian(turbulence->muEff(), ft) - fvm::laplacian(turbulence->alphaEff(), ft)
); );
} }

View File

@ -1,5 +1,5 @@
{ {
solve fvScalarMatrix hEqn
( (
fvm::ddt(rho, h) fvm::ddt(rho, h)
+ mvConvection->fvmDiv(phi, h) + mvConvection->fvmDiv(phi, h)
@ -8,5 +8,8 @@
DpDt DpDt
); );
hEqn.relax();
hEqn.solve();
thermo.correct(); thermo.correct();
} }

View File

@ -26,7 +26,7 @@ Application
dieselFoam dieselFoam
Description Description
Diesel engine spray and combustion code. Solver for diesel engine spray and combustion.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,7 @@ Application
dieselFoam dieselFoam
Description Description
Diesel spray and combustion code. Solver for diesel spray and combustion.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,7 @@ Application
reactingFoam reactingFoam
Description Description
Chemical reaction code. Solver for combustion with chemical reactions.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,8 @@ Application
rhoReactingFoam rhoReactingFoam
Description Description
Chemical reaction code using density based thermodynamics package. Solver for combustion with chemical reactions using density based
thermodynamics package.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -68,10 +69,10 @@ int main(int argc, char *argv[])
#include "chemistry.H" #include "chemistry.H"
#include "rhoEqn.H" #include "rhoEqn.H"
#include "UEqn.H"
for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) for (label ocorr=1; ocorr <= nOuterCorr; ocorr++)
{ {
#include "UEqn.H"
#include "YEqn.H" #include "YEqn.H"
#include "hEqn.H" #include "hEqn.H"

View File

@ -1,5 +1,8 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso BCs wclean libso BCs
wclean wclean
# ----------------------------------------------------------------- end-of-file

View File

@ -7,7 +7,7 @@ autoPtr<basicPsiThermo> pThermo
basicPsiThermo& thermo = pThermo(); basicPsiThermo& thermo = pThermo();
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
volScalarField& h = thermo.h(); volScalarField& e = thermo.e();
const volScalarField& T = thermo.T(); const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi(); const volScalarField& psi = thermo.psi();
const volScalarField& mu = thermo.mu(); const volScalarField& mu = thermo.mu();
@ -70,7 +70,7 @@ volScalarField rhoE
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
rho*(h + 0.5*magSqr(U)) - p rho*(e + 0.5*magSqr(U))
); );
surfaceScalarField pos surfaceScalarField pos

View File

@ -76,10 +76,10 @@ int main(int argc, char *argv[])
surfaceScalarField rPsi_neg = surfaceScalarField rPsi_neg =
fvc::interpolate(rPsi, neg, "reconstruct(T)"); fvc::interpolate(rPsi, neg, "reconstruct(T)");
surfaceScalarField h_pos = surfaceScalarField e_pos =
fvc::interpolate(h, pos, "reconstruct(T)"); fvc::interpolate(e, pos, "reconstruct(T)");
surfaceScalarField h_neg = surfaceScalarField e_neg =
fvc::interpolate(h, neg, "reconstruct(T)"); fvc::interpolate(e, neg, "reconstruct(T)");
surfaceVectorField U_pos = rhoU_pos/rho_pos; surfaceVectorField U_pos = rhoU_pos/rho_pos;
surfaceVectorField U_neg = rhoU_neg/rho_neg; surfaceVectorField U_neg = rhoU_neg/rho_neg;
@ -132,8 +132,8 @@ int main(int argc, char *argv[])
+ (a_pos*p_pos + a_neg*p_neg)*mesh.Sf(); + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf();
surfaceScalarField phiEp = surfaceScalarField phiEp =
aphiv_pos*rho_pos*(h_pos + 0.5*magSqr(U_pos)) aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos)
+ aphiv_neg*rho_neg*(h_neg + 0.5*magSqr(U_neg)) + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg)
+ aSf*p_pos - aSf*p_neg; + aSf*p_pos - aSf*p_neg;
volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T())); volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T()));
@ -156,7 +156,7 @@ int main(int argc, char *argv[])
{ {
solve solve
( (
fvm::ddt(rho, U) - fvc::ddt(rho,U) fvm::ddt(rho, U) - fvc::ddt(rho, U)
- fvm::laplacian(mu, U) - fvm::laplacian(mu, U)
- fvc::div(tauMC) - fvc::div(tauMC)
); );
@ -180,28 +180,27 @@ int main(int argc, char *argv[])
- fvc::div(sigmaDotU) - fvc::div(sigmaDotU)
); );
h = (rhoE + p)/rho - 0.5*magSqr(U); e = rhoE/rho - 0.5*magSqr(U);
h.correctBoundaryConditions(); e.correctBoundaryConditions();
thermo.correct(); thermo.correct();
rhoE.boundaryField() = rhoE.boundaryField() =
rho.boundaryField()* rho.boundaryField()*
( (
h.boundaryField() + 0.5*magSqr(U.boundaryField()) e.boundaryField() + 0.5*magSqr(U.boundaryField())
) );
- p.boundaryField();
if (!inviscid) if (!inviscid)
{ {
volScalarField k("k", thermo.Cp()*mu/Pr); volScalarField k("k", thermo.Cp()*mu/Pr);
solve solve
( (
fvm::ddt(rho, h) - fvc::ddt(rho, h) fvm::ddt(rho, e) - fvc::ddt(rho, e)
- fvm::laplacian(thermo.alpha(), h) - fvm::laplacian(thermo.alpha(), e)
+ fvc::laplacian(thermo.alpha(), h) + fvc::laplacian(thermo.alpha(), e)
- fvc::laplacian(k, T) - fvc::laplacian(k, T)
); );
thermo.correct(); thermo.correct();
rhoE = rho*(h + 0.5*magSqr(U)) - p; rhoE = rho*(e + 0.5*magSqr(U));
} }
p.dimensionedInternalField() = p.dimensionedInternalField() =

View File

@ -26,7 +26,8 @@ Application
dsmcFoam dsmcFoam
Description Description
Direct Simulation Monte Carlo Solver for 3D, transient, multi-species flows Direct simulation Monte Carlo (DSMC) solver for 3D, transient, multi-
species flows
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,7 @@ Application
mdEquilibrationFoam mdEquilibrationFoam
Description Description
Equilibrates and/or preconditions MD systems Equilibrates and/or preconditions molecular dynamics systems
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,7 @@ Application
mdFoam mdFoam
Description Description
molecular dynamics solver for fluid dynamics Molecular dynamics solver for fluid dynamics
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -26,9 +26,11 @@ Application
buoyantPisoFoam buoyantPisoFoam
Description Description
Transient Solver for buoyant, turbulent flow of compressible fluids for Transient solver for buoyant, turbulent flow of compressible fluids for
ventilation and heat-transfer. Turbulence is modelled using a run-time ventilation and heat-transfer.
selectable compressible RAS or LES model.
Turbulence is modelled using a run-time selectable compressible RAS or
LES model.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -27,6 +27,7 @@ Application
Description Description
Transient solver for inviscid shallow-water equations with rotation. Transient solver for inviscid shallow-water equations with rotation.
If the geometry is 3D then it is assumed to be one layers of cells and the If the geometry is 3D then it is assumed to be one layers of cells and the
component of the velocity normal to gravity is removed. component of the velocity normal to gravity is removed.

View File

@ -26,13 +26,17 @@ Application
porousExplicitSourceReactingParcelFoam porousExplicitSourceReactingParcelFoam
Description Description
Transient PISO solver for compressible, laminar or turbulent flow with
reacting Lagrangian parcels for porous media, including explicit sources
The solver includes:
- reacting parcel cloud - reacting parcel cloud
- porous media - porous media
- point mass sources - point mass sources
- polynomial based, incompressible thermodynamics (f(T)) - polynomial based, incompressible thermodynamics (f(T))
Note: ddtPhiCorr not used here when porous zones are active Note: ddtPhiCorr not used here when porous zones are active
- not well defined for porous calcs - not well defined for porous calculations
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -23,11 +23,13 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application Application
kinematicParcelFoam uncoupledKinematicParcelFoam
Description Description
Transient solver for a single kinematicCloud. Uses pre-calculated velocity Transient solver for the passive transport of a single kinematic
field to evolve a cloud. particle could.
Uses a pre- calculated velocity field to evolve the cloud.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -16,52 +16,93 @@
RASProperties.lookup("turbulence") RASProperties.lookup("turbulence")
); );
dictionary kEpsilonCoeffs dictionary kEpsilonDict
( (
RASProperties.subDict("kEpsilonCoeffs") RASProperties.subDictPtr("kEpsilonCoeffs")
); );
dimensionedScalar Cmu
scalar Cmu
( (
readScalar(kEpsilonCoeffs.lookup("Cmu")) dimensionedScalar::lookupOrAddToDict
(
"Cmu",
kEpsilonDict,
0.09
)
); );
scalar C1 dimensionedScalar C1
( (
readScalar(kEpsilonCoeffs.lookup("C1")) dimensionedScalar::lookupOrAddToDict
(
"C1",
kEpsilonDict,
1.44
)
); );
scalar C2 dimensionedScalar C2
( (
readScalar(kEpsilonCoeffs.lookup("C2")) dimensionedScalar::lookupOrAddToDict
(
"C2",
kEpsilonDict,
1.92
)
); );
scalar alphak dimensionedScalar alphak
( (
readScalar(kEpsilonCoeffs.lookup("alphak")) dimensionedScalar::lookupOrAddToDict
(
"alphaEps",
kEpsilonDict,
1.0
)
); );
scalar alphaEps dimensionedScalar alphaEps
( (
readScalar(kEpsilonCoeffs.lookup("alphaEps")) dimensionedScalar::lookupOrAddToDict
(
"alphaEps",
kEpsilonDict,
0.76923
)
); );
dictionary wallFunctionCoeffs dictionary wallFunctionDict
( (
RASProperties.subDict("wallFunctionCoeffs") RASProperties.subDictPtr("wallFunctionCoeffs")
); );
scalar kappa dimensionedScalar kappa
( (
readScalar(wallFunctionCoeffs.lookup("kappa")) dimensionedScalar::lookupOrAddToDict
(
"kappa",
wallFunctionDict,
0.4187
)
); );
scalar E dimensionedScalar E
( (
readScalar(wallFunctionCoeffs.lookup("E")) dimensionedScalar::lookupOrAddToDict
(
"E",
wallFunctionDict,
9.0
)
); );
if (RASProperties.lookupOrDefault<Switch>("printCoeffs", false))
{
Info<< "kEpsilonCoeffs" << kEpsilonDict << nl
<< "wallFunctionCoeffs" << wallFunctionDict << endl;
}
nearWallDist y(mesh); nearWallDist y(mesh);

View File

@ -16,7 +16,11 @@ if(turbulence)
( (
fvm::ddt(beta, epsilon) fvm::ddt(beta, epsilon)
+ fvm::div(phib, epsilon) + fvm::div(phib, epsilon)
- fvm::laplacian(alphaEps*nuEffb, epsilon) - fvm::laplacian
(
alphaEps*nuEffb, epsilon,
"laplacian(DepsilonEff,epsilon)"
)
== ==
C1*beta*G*epsilon/k C1*beta*G*epsilon/k
- fvm::Sp(C2*beta*epsilon/k, epsilon) - fvm::Sp(C2*beta*epsilon/k, epsilon)
@ -35,7 +39,11 @@ if(turbulence)
( (
fvm::ddt(beta, k) fvm::ddt(beta, k)
+ fvm::div(phib, k) + fvm::div(phib, k)
- fvm::laplacian(alphak*nuEffb, k) - fvm::laplacian
(
alphak*nuEffb, k,
"laplacian(DkEff,k)"
)
== ==
beta*G beta*G
- fvm::Sp(beta*epsilon/k, k) - fvm::Sp(beta*epsilon/k, k)

View File

@ -1,8 +1,9 @@
{ {
labelList cellBoundaryFaceCount(epsilon.size(), 0); labelList cellBoundaryFaceCount(epsilon.size(), 0);
scalar Cmu25 = ::pow(Cmu, 0.25); scalar Cmu25 = ::pow(Cmu.value(), 0.25);
scalar Cmu75 = ::pow(Cmu, 0.75); scalar Cmu75 = ::pow(Cmu.value(), 0.75);
scalar kappa_ = kappa.value();
const fvPatchList& patches = mesh.boundary(); const fvPatchList& patches = mesh.boundary();
@ -53,14 +54,14 @@
epsilon[faceCelli] += epsilon[faceCelli] +=
Cmu75*::pow(k[faceCelli], 1.5) Cmu75*::pow(k[faceCelli], 1.5)
/(kappa*y[patchi][facei]); /(kappa_*y[patchi][facei]);
if (yPlus > 11.6) if (yPlus > 11.6)
{ {
G[faceCelli] += G[faceCelli] +=
nuw[facei]*magFaceGradU[facei] nuw[facei]*magFaceGradU[facei]
*Cmu25*::sqrt(k[faceCelli]) *Cmu25*::sqrt(k[faceCelli])
/(kappa*y[patchi][facei]); /(kappa_*y[patchi][facei]);
} }
} }
} }

View File

@ -1,5 +1,8 @@
{ {
scalar Cmu25 = ::pow(Cmu, 0.25); scalar Cmu25 = ::pow(Cmu.value(), 0.25);
scalar kappa_ = kappa.value();
scalar E_ = E.value();
scalar nub_ = nub.value();
const fvPatchList& patches = mesh.boundary(); const fvPatchList& patches = mesh.boundary();
@ -19,14 +22,14 @@
scalar yPlus = scalar yPlus =
Cmu25*y[patchi][facei] Cmu25*y[patchi][facei]
*::sqrt(k[faceCelli]) *::sqrt(k[faceCelli])
/nub.value(); /nub_;
if (yPlus > 11.6) if (yPlus > 11.6)
{ {
nutw[facei] = nutw[facei] =
yPlus*nub.value()*kappa yPlus*nub_*kappa_
/::log(E*yPlus) /::log(E_*yPlus)
- nub.value(); - nub_;
} }
else else
{ {

View File

@ -27,11 +27,13 @@ Application
Description Description
Solver for 2 compressible, isothermal immiscible fluids using a VOF Solver for 2 compressible, isothermal immiscible fluids using a VOF
(volume of fluid) phase-fraction based interface capturing approach. (volume of fluid) phase-fraction based interface capturing approach,
The momentum and other fluid properties are of the "mixture" and a single with optional mesh motion and mesh topology changes including adaptive
momentum equation is solved. re-meshing.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. The momentum and other fluid properties are of the "mixture" and a
single momentum equation is solved. Turbulence modelling is generic,
i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -28,10 +28,11 @@ Application
Description Description
Solver for 2 compressible, isothermal immiscible fluids using a VOF Solver for 2 compressible, isothermal immiscible fluids using a VOF
(volume of fluid) phase-fraction based interface capturing approach. (volume of fluid) phase-fraction based interface capturing approach.
The momentum and other fluid properties are of the "mixture" and a single The momentum and other fluid properties are of the "mixture" and a single
momentum equation is solved. momentum equation is solved.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -28,10 +28,11 @@ Application
Description Description
Solver for 2 incompressible, isothermal immiscible fluids using a VOF Solver for 2 incompressible, isothermal immiscible fluids using a VOF
(volume of fluid) phase-fraction based interface capturing approach. (volume of fluid) phase-fraction based interface capturing approach.
The momentum and other fluid properties are of the "mixture" and a single The momentum and other fluid properties are of the "mixture" and a single
momentum equation is solved. momentum equation is solved.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
For a two-fluid approach see twoPhaseEulerFoam. For a two-fluid approach see twoPhaseEulerFoam.

View File

@ -28,8 +28,10 @@ Application
Description Description
Solver for 2 incompressible, isothermal immiscible fluids with phase-change Solver for 2 incompressible, isothermal immiscible fluids with phase-change
(e.g. cavitation). Uses a VOF (volume of fluid) phase-fraction based (e.g. cavitation). Uses a VOF (volume of fluid) phase-fraction based
interface capturing approach. The momentum and other fluid properties are interface capturing approach.
of the "mixture" and a single momentum equation is solved.
The momentum and other fluid properties are of the "mixture" and a
single momentum equation is solved.
The set of phase-change models provided are designed to simulate cavitation The set of phase-change models provided are designed to simulate cavitation
but other mechanisms of phase-change are supported within this solver but other mechanisms of phase-change are supported within this solver

View File

@ -27,7 +27,7 @@ Application
Description Description
Solver for n incompressible fluids which captures the interfaces and Solver for n incompressible fluids which captures the interfaces and
includes surface-tension and contact-angle effects for each. includes surface-tension and contact-angle effects for each phase.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.

View File

@ -228,57 +228,103 @@
RASProperties.lookup("turbulence") RASProperties.lookup("turbulence")
); );
const dictionary& kEpsilonCoeffs dictionary kEpsilonDict
( (
RASProperties.subDict("kEpsilonCoeffs") RASProperties.subDictPtr("kEpsilonCoeffs")
); );
dimensionedScalar Cmu
scalar Cmu
( (
readScalar(kEpsilonCoeffs.lookup("Cmu")) dimensionedScalar::lookupOrAddToDict
(
"Cmu",
kEpsilonDict,
0.09
)
); );
scalar C1 dimensionedScalar C1
( (
readScalar(kEpsilonCoeffs.lookup("C1")) dimensionedScalar::lookupOrAddToDict
(
"C1",
kEpsilonDict,
1.44
)
); );
scalar C2 dimensionedScalar C2
( (
readScalar(kEpsilonCoeffs.lookup("C2")) dimensionedScalar::lookupOrAddToDict
(
"C2",
kEpsilonDict,
1.92
)
); );
scalar C3 dimensionedScalar C3
( (
readScalar(kEpsilonCoeffs.lookup("C3")) dimensionedScalar::lookupOrAddToDict
(
"C3",
kEpsilonDict,
0.85
)
); );
scalar alphak dimensionedScalar alphak
( (
readScalar(kEpsilonCoeffs.lookup("alphak")) dimensionedScalar::lookupOrAddToDict
(
"alphaEps",
kEpsilonDict,
1.0
)
); );
scalar alphaEps dimensionedScalar alphaEps
( (
readScalar(kEpsilonCoeffs.lookup("alphaEps")) dimensionedScalar::lookupOrAddToDict
(
"alphaEps",
kEpsilonDict,
0.76923
)
); );
const dictionary& wallFunctionCoeffs dictionary wallFunctionDict
( (
RASProperties.subDict("wallFunctionCoeffs") RASProperties.subDictPtr("wallFunctionCoeffs")
); );
scalar kappa dimensionedScalar kappa
( (
readScalar(wallFunctionCoeffs.lookup("kappa")) dimensionedScalar::lookupOrAddToDict
(
"kappa",
wallFunctionDict,
0.4187
)
); );
scalar E dimensionedScalar E
( (
readScalar(wallFunctionCoeffs.lookup("E")) dimensionedScalar::lookupOrAddToDict
(
"E",
wallFunctionDict,
9.0
)
); );
if (RASProperties.lookupOrDefault<Switch>("printCoeffs", false))
{
Info<< "kEpsilonCoeffs" << kEpsilonDict << nl
<< "wallFunctionCoeffs" << wallFunctionDict << endl;
}
nearWallDist y(mesh); nearWallDist y(mesh);
Info<< "Reading field k\n" << endl; Info<< "Reading field k\n" << endl;

View File

@ -26,7 +26,7 @@ if(turbulence)
+ fvm::div(phi, epsilon) + fvm::div(phi, epsilon)
- fvm::laplacian - fvm::laplacian
( (
alphaEps*mut + mul, epsilon, alphaEps*mut + mul, epsilon,
"laplacian(DepsilonEff,epsilon)" "laplacian(DepsilonEff,epsilon)"
) )
== ==
@ -49,7 +49,11 @@ if(turbulence)
( (
fvm::ddt(rho, k) fvm::ddt(rho, k)
+ fvm::div(phi, k) + fvm::div(phi, k)
- fvm::laplacian(alphak*mut + mul, k, "laplacian(DkEff,k)") - fvm::laplacian
(
alphak*mut + mul, k,
"laplacian(DkEff,k)"
)
== ==
G G
- fvm::SuSp(Gcoef + 2.0/3.0*rho*divU, k) - fvm::SuSp(Gcoef + 2.0/3.0*rho*divU, k)

View File

@ -1,8 +1,9 @@
{ {
labelList cellBoundaryFaceCount(epsilon.size(), 0); labelList cellBoundaryFaceCount(epsilon.size(), 0);
scalar Cmu25 = ::pow(Cmu, 0.25); scalar Cmu25 = ::pow(Cmu.value(), 0.25);
scalar Cmu75 = ::pow(Cmu, 0.75); scalar Cmu75 = ::pow(Cmu.value(), 0.75);
scalar kappa_ = kappa.value();
const fvPatchList& patches = mesh.boundary(); const fvPatchList& patches = mesh.boundary();
@ -55,14 +56,14 @@
epsilon[faceCelli] += epsilon[faceCelli] +=
Cmu75*rho[faceCelli]*::pow(k[faceCelli], 1.5) Cmu75*rho[faceCelli]*::pow(k[faceCelli], 1.5)
/(kappa*y[patchi][facei]); /(kappa_*y[patchi][facei]);
if (yPlus > 11.6) if (yPlus > 11.6)
{ {
G[faceCelli] += G[faceCelli] +=
mutw[facei]*magFaceGradU[facei] mutw[facei]*magFaceGradU[facei]
*Cmu25*::sqrt(k[faceCelli]) *Cmu25*::sqrt(k[faceCelli])
/(kappa*y[patchi][facei]); /(kappa_*y[patchi][facei]);
} }
} }
} }

View File

@ -1,5 +1,7 @@
{ {
scalar Cmu25 = ::pow(Cmu, 0.25); scalar Cmu25 = ::pow(Cmu.value(), 0.25);
scalar kappa_ = kappa.value();
scalar E_ = E.value();
const fvPatchList& patches = mesh.boundary(); const fvPatchList& patches = mesh.boundary();
@ -26,7 +28,7 @@
{ {
mutw[facei] = mutw[facei] =
muw[facei] muw[facei]
*(yPlus*kappa/::log(E*yPlus) - 1); *(yPlus*kappa_/::log(E_*yPlus) - 1);
} }
else else
{ {

View File

@ -1,4 +1,10 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso phaseModel wclean libso phaseModel
wclean libso interfacialModels wclean libso interfacialModels
wclean libso kineticTheoryModels wclean libso kineticTheoryModels
wclean wclean
# ----------------------------------------------------------------- end-of-file

View File

@ -1,4 +1,5 @@
EXE_INC = \ EXE_INC = \
-I../bubbleFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-IturbulenceModel \ -IturbulenceModel \
@ -6,7 +7,7 @@ EXE_INC = \
-IinterfacialModels/lnInclude \ -IinterfacialModels/lnInclude \
-IphaseModel/lnInclude \ -IphaseModel/lnInclude \
-Iaveraging -Iaveraging
EXE_LIBS = \ EXE_LIBS = \
-lEulerianInterfacialModels \ -lEulerianInterfacialModels \
-lfiniteVolume \ -lfiniteVolume \

View File

@ -91,34 +91,6 @@
alpha*Ua + beta*Ub alpha*Ua + beta*Ub
); );
Info<< "Reading field k\n" << endl;
volScalarField k
(
IOobject
(
"k",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field epsilon\n" << endl;
volScalarField epsilon
(
IOobject
(
"epsilon",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
dimensionedScalar Cvm dimensionedScalar Cvm
( (
transportProperties.lookup("Cvm") transportProperties.lookup("Cvm")
@ -156,114 +128,7 @@
alpha*rhoa + beta*rhob alpha*rhoa + beta*rhob
); );
IOdictionary RASProperties #include "createRASTurbulence.H"
(
IOobject
(
"RASProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
Switch turbulence
(
RASProperties.lookup("turbulence")
);
dictionary kEpsilonCoeffs
(
RASProperties.subDict("kEpsilonCoeffs")
);
scalar Cmu
(
readScalar(kEpsilonCoeffs.lookup("Cmu"))
);
scalar C1
(
readScalar(kEpsilonCoeffs.lookup("C1"))
);
scalar C2
(
readScalar(kEpsilonCoeffs.lookup("C2"))
);
scalar alphak
(
readScalar(kEpsilonCoeffs.lookup("alphak"))
);
scalar alphaEps
(
readScalar(kEpsilonCoeffs.lookup("alphaEps"))
);
dictionary wallFunctionCoeffs
(
RASProperties.subDict("wallFunctionCoeffs")
);
scalar kappa
(
readScalar(wallFunctionCoeffs.lookup("kappa"))
);
scalar E
(
readScalar(wallFunctionCoeffs.lookup("E"))
);
nearWallDist y(mesh);
Info<< "Calculating field nutb\n" << endl;
volScalarField nutb
(
IOobject
(
"nutb",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Cmu*sqr(k)/epsilon
);
Info<< "Calculating field nuEffa\n" << endl;
volScalarField nuEffa
(
IOobject
(
"nuEffa",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
sqr(Ct)*nutb + nua
);
Info<< "Calculating field nuEffb\n" << endl;
volScalarField nuEffb
(
IOobject
(
"nuEffb",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
nutb + nub
);
Info<< "Calculating field DDtUa and DDtUb\n" << endl; Info<< "Calculating field DDtUa and DDtUb\n" << endl;

View File

@ -1,61 +0,0 @@
if(turbulence)
{
if (mesh.changing())
{
y.correct();
}
tmp<volTensorField> tgradUb = fvc::grad(Ub);
volScalarField G = 2*nutb*(tgradUb() && dev(symm(tgradUb())));
tgradUb.clear();
# include "wallFunctions.H"
// Dissipation equation
fvScalarMatrix epsEqn
(
fvm::ddt(beta, epsilon)
+ fvm::div(phib, epsilon)
- fvm::laplacian
(
alphaEps*nuEffb,
epsilon,
"laplacian((alphaEps*nuEffb),epsilon)"
)
==
C1*beta*G*epsilon/k
- fvm::Sp(C2*beta*epsilon/k, epsilon)
);
# include "wallDissipation.H"
epsEqn.relax();
epsEqn.solve();
epsilon.max(dimensionedScalar("zero", epsilon.dimensions(), 1.0e-15));
// Turbulent kinetic energy equation
fvScalarMatrix kEqn
(
fvm::ddt(beta, k)
+ fvm::div(phib, k)
- fvm::laplacian(alphak*nuEffb, k, "laplacian((alphak*nuEffb),k)")
==
beta*G
- fvm::Sp(beta*epsilon/k, k)
);
kEqn.relax();
kEqn.solve();
k.max(dimensionedScalar("zero", k.dimensions(), 1.0e-8));
//- Re-calculate turbulence viscosity
nutb = Cmu*sqr(k)/epsilon;
# include "wallViscosity.H"
}
nuEffa = sqr(Ct)*nutb + nua;
nuEffb = nutb + nub;

View File

@ -1,51 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Global
wallDissipation
Description
Set wall dissipation in the epsilon matrix
\*---------------------------------------------------------------------------*/
{
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
{
const fvPatch& p = patches[patchi];
if (isType<wallFvPatch>(p))
{
epsEqn.setValues
(
p.faceCells(),
epsilon.boundaryField()[patchi].patchInternalField()
);
}
}
}
// ************************************************************************* //

View File

@ -1,86 +0,0 @@
{
labelList cellBoundaryFaceCount(epsilon.size(), 0);
scalar Cmu25 = ::pow(Cmu, 0.25);
scalar Cmu75 = ::pow(Cmu, 0.75);
const fvPatchList& patches = mesh.boundary();
//- Initialise the near-wall P field to zero
forAll(patches, patchi)
{
const fvPatch& currPatch = patches[patchi];
if (isType<wallFvPatch>(currPatch))
{
forAll(currPatch, facei)
{
label faceCelli = currPatch.faceCells()[facei];
epsilon[faceCelli] = 0.0;
G[faceCelli] = 0.0;
}
}
}
//- Accumulate the wall face contributions to epsilon and G
// Increment cellBoundaryFaceCount for each face for averaging
forAll(patches, patchi)
{
const fvPatch& currPatch = patches[patchi];
if (isType<wallFvPatch>(currPatch))
{
const scalarField& nuw = nutb.boundaryField()[patchi];
scalarField magFaceGradU = mag(U.boundaryField()[patchi].snGrad());
forAll(currPatch, facei)
{
label faceCelli = currPatch.faceCells()[facei];
scalar yPlus =
Cmu25*y[patchi][facei]
*::sqrt(k[faceCelli])
/nub.value();
// For corner cells (with two boundary or more faces),
// epsilon and G in the near-wall cell are calculated
// as an average
cellBoundaryFaceCount[faceCelli]++;
epsilon[faceCelli] +=
Cmu75*::pow(k[faceCelli], 1.5)
/(kappa*y[patchi][facei]);
if (yPlus > 11.6)
{
G[faceCelli] +=
nuw[facei]*magFaceGradU[facei]
*Cmu25*::sqrt(k[faceCelli])
/(kappa*y[patchi][facei]);
}
}
}
}
// perform the averaging
forAll(patches, patchi)
{
const fvPatch& curPatch = patches[patchi];
if (isType<wallFvPatch>(curPatch))
{
forAll(curPatch, facei)
{
label faceCelli = curPatch.faceCells()[facei];
epsilon[faceCelli] /= cellBoundaryFaceCount[faceCelli];
G[faceCelli] /= cellBoundaryFaceCount[faceCelli];
}
}
}
}

View File

@ -1,38 +0,0 @@
{
scalar Cmu25 = ::pow(Cmu, 0.25);
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
{
const fvPatch& currPatch = patches[patchi];
if (isType<wallFvPatch>(currPatch))
{
scalarField& nutw = nutb.boundaryField()[patchi];
forAll(currPatch, facei)
{
label faceCelli = currPatch.faceCells()[facei];
// calculate yPlus
scalar yPlus =
Cmu25*y[patchi][facei]
*::sqrt(k[faceCelli])
/nub.value();
if (yPlus > 11.6)
{
nutw[facei] =
yPlus*nub.value()*kappa
/::log(E*yPlus)
- nub.value();
}
else
{
nutw[facei] = 0.0;
}
}
}
}
}

View File

@ -0,0 +1,7 @@
/*
check for consistent behaviour with non-optimized code
*/
EXE_INC = \
-DFULLDEBUG -g -O0

View File

@ -28,320 +28,146 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "argList.H"
#include "uLabel.H" #include "uLabel.H"
#include "IOobject.H"
#include "IOstreams.H" #include "IOstreams.H"
#include "IFstream.H"
#include "PackedBoolList.H" #include "PackedBoolList.H"
#include <climits>
using namespace Foam; using namespace Foam;
template<unsigned nBits>
inline void reportInfo()
{
unsigned offset = PackedList<nBits>::packing();
unsigned useSHL = ((1u << (nBits * offset)) - 1);
unsigned useSHR = (~0u >> (sizeof(unsigned)*CHAR_BIT - nBits * offset));
Info<< nl
<< "PackedList<" << nBits << ">" << nl
<< " max_value: " << PackedList<nBits>::max_value() << nl
<< " packing: " << PackedList<nBits>::packing() << nl
<< " utilization: " << (nBits * offset) << nl;
Info<< " Masking:" << nl
<< " shift << " << unsigned(nBits * offset) << nl
<< " shift >> " << unsigned((sizeof(unsigned)*CHAR_BIT) - nBits * offset)
<< nl;
hex(Info);
Info<< " maskLower: " << PackedList<nBits>::maskLower(PackedList<nBits>::packing())
<< nl
<< " useSHL: " << useSHL << nl
<< " useSHR: " << useSHR << nl;
if (useSHL != useSHR)
{
Info<< "WARNING: different results for SHL and SHR" << nl;
}
Info<< nl;
dec(Info);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program: // Main program:
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Info<< "PackedList max_bits() = " << PackedList<>::max_bits() << nl; argList::noParallel();
argList::validArgs.insert("file .. fileN");
Info<< "\ntest allocation with value\n"; argList::validOptions.insert("mask", "");
PackedList<3> list1(5,1); argList::validOptions.insert("count", "");
list1.print(Info); argList::validOptions.insert("info", "");
Info<< "\ntest assign uniform value\n"; argList args(argc, argv, false, true);
list1 = 3;
list1.print(Info);
Info<< "\ntest assign uniform value (with overflow)\n";
list1 = -1;
list1.print(Info);
Info<< "\ntest zero\n";
list1 = 0;
list1.print(Info);
Info<< "\ntest set() with default argument (max_value)\n";
list1.set(3);
list1.print(Info);
Info<< "\ntest assign between references\n";
list1[2] = 3;
list1[4] = list1[2];
list1.print(Info);
Info<< "\ntest assign between references, with chaining\n";
list1[0] = list1[4] = 1;
list1.print(Info);
Info<< "\ntest assign between references, with chaining and auto-vivify\n";
list1[1] = list1[8] = list1[10] = list1[14] = 2;
list1.print(Info);
Info<< "\ntest operator== between references\n"; if (args.optionFound("mask"))
if (list1[1] == list1[8])
{ {
Info<< "[1] == [8] (expected)\n"; Info<< "bit width: " << unsigned(sizeof(unsigned)*CHAR_BIT) << endl;
reportInfo<1>();
reportInfo<2>();
reportInfo<3>();
reportInfo<4>();
reportInfo<5>();
reportInfo<6>();
reportInfo<7>();
reportInfo<8>();
reportInfo<9>();
reportInfo<10>();
reportInfo<11>();
reportInfo<12>();
reportInfo<13>();
reportInfo<14>();
reportInfo<15>();
reportInfo<16>();
reportInfo<17>();
reportInfo<18>();
reportInfo<19>();
reportInfo<20>();
reportInfo<21>();
reportInfo<22>();
reportInfo<23>();
reportInfo<24>();
reportInfo<25>();
reportInfo<26>();
reportInfo<27>();
reportInfo<28>();
reportInfo<29>();
reportInfo<30>();
reportInfo<31>();
return 0;
} }
else else if (args.additionalArgs().empty())
{ {
Info<< "[1] != [8] (unexpected)\n"; args.printUsage();
}
if (list1[0] != list1[1])
{
Info<< "[0] != [1] (expected)\n";
}
else
{
Info<< "[0] == [1] (unexpected)\n";
}
Info<< "\ntest operator== with iterator\n";
{
PackedList<3>::iterator iter = list1[1];
if (iter != list1[8])
{
Info<< "iter != [8] (expected)\n";
}
else
{
Info<< "iter == [8] (unexpected)\n";
}
if (*iter != list1[8])
{
Info<< "*iter != [8] (unexpected)\n";
}
else
{
Info<< "*iter == [8] (expected)\n";
}
} }
forAll(args.additionalArgs(), argI)
{ {
const PackedList<3>& constLst = list1; const string& srcFile = args.additionalArgs()[argI];
Info<< "\ntest operator[] const with out-of-range index\n"; Info<< nl << "reading " << srcFile << nl;
constLst.print(Info);
if (constLst[20])
{
Info<< "[20] is true (unexpected)\n";
}
else
{
Info<< "[20] is false (expected) list size should be unchanged (const)\n";
}
constLst.print(Info);
Info<< "\ntest operator[] non-const with out-of-range index\n"; IFstream ifs(srcFile);
if (list1[20]) List<label> rawLst(ifs);
PackedBoolList packLst(rawLst);
Info<< "size: " << packLst.size() << nl;
if (args.optionFound("count"))
{ {
Info<< "[20] is true (unexpected)\n"; unsigned int rawCount = 0;
forAll(rawLst, elemI)
{
if (rawLst[elemI])
{
rawCount++;
}
}
Info<< "raw count: " << rawCount << nl
<< "packed count: " << packLst.count() << nl;
} }
else
if (args.optionFound("info"))
{ {
Info<< "[20] is false (expected) but list was resized?? (non-const)\n"; packLst.print(Info);
} }
list1.print(Info);
Info<< nl;
IOobject::writeDivider(Info);
} }
Info<< "\ntest operator[] with out-of-range index\n";
if (!list1[20])
{
Info<< "[20] is false, as expected\n";
}
list1.print(Info);
Info<< "\ntest resize with value (without reallocation)\n";
list1.resize(8, list1.max_value());
list1.print(Info);
Info<< "\ntest flip() function\n";
list1.flip();
list1.print(Info);
Info<< "\nre-flip()\n";
list1.flip();
list1.print(Info);
Info<< "\ntest set() function\n";
list1.set(1, 5);
list1.print(Info);
Info<< "\ntest assign bool\n";
list1 = false;
list1.print(Info);
Info<< "\ntest assign bool\n";
list1 = true;
list1.print(Info);
Info<< "\ntest resize without value (with reallocation)\n";
list1.resize(12);
list1.print(Info);
Info<< "\ntest resize with value (with reallocation)\n";
list1.resize(25, list1.max_value());
list1.print(Info);
Info<< "\ntest resize smaller (should not touch allocation)\n";
list1.resize(8);
list1.print(Info);
Info<< "\ntest append() operation\n";
list1.append(2);
list1.append(3);
list1.append(4);
list1.print(Info);
Info<< "\ntest reserve() operation\n";
list1.reserve(32);
list1.print(Info);
Info<< "\ntest shrink() operation\n";
list1.shrink();
list1.print(Info);
Info<< "\ntest setCapacity() operation\n";
list1.setCapacity(15);
list1.print(Info);
Info<< "\ntest setCapacity() operation\n";
list1.setCapacity(100);
list1.print(Info);
Info<< "\ntest operator[] assignment\n";
list1[16] = 5;
list1.print(Info);
Info<< "\ntest operator[] assignment with auto-vivify\n";
list1[36] = list1.max_value();
list1.print(Info);
Info<< "\ntest setCapacity smaller\n";
list1.setCapacity(24);
list1.print(Info);
Info<< "\ntest resize much smaller\n";
list1.resize(150);
list1.print(Info);
Info<< "\ntest trim\n";
list1.trim();
list1.print(Info);
// add in some misc values
list1[31] = 1;
list1[32] = 2;
list1[33] = 3;
Info<< "\ntest iterator\n";
PackedList<3>::iterator iter = list1.begin();
Info<< "begin():";
iter.print(Info) << "\n";
Info<< "iterator:" << iter() << "\n";
iter() = 5;
iter.print(Info);
list1.print(Info);
iter = list1[31];
Info<< "iterator:" << iter() << "\n";
iter.print(Info);
Info<< "\ntest get() method\n";
Info<< "get(10):" << list1.get(10) << " and list[10]:" << list1[10] << "\n";
list1.print(Info);
Info<< "\ntest iterator indexing\n";
Info<< "cend() ";
list1.cend().print(Info) << "\n";
{
Info<< "\ntest assignment of iterator\n";
list1.print(Info);
Info<< "cend()\n";
list1.end().print(Info);
PackedList<3>::iterator cit = list1[100];
Info<< "out-of-range: ";
cit.print(Info);
cit = list1[15];
Info<< "in-range: ";
cit.print(Info);
Info<< "out-of-range: ";
cit = list1[1000];
cit.print(Info);
}
for
(
PackedList<3>::iterator cit = list1[30];
cit != list1.end();
++cit
)
{
cit.print(Info);
}
Info<< "\ntest operator[] auto-vivify\n";
Info<< "size:" << list1.size() << "\n";
const unsigned int val = list1[45];
Info<< "list[45]:" << val << "\n";
Info<< "size after read:" << list1.size() << "\n";
list1[45] = list1.max_value();
Info<< "size after write:" << list1.size() << "\n";
Info<< "list[45]:" << list1[45] << "\n";
list1[49] = list1[100];
list1.print(Info);
Info<< "\ntest copy constructor + append\n";
PackedList<3> list2(list1);
list2.append(4);
Info<< "source list:\n";
list1.print(Info);
Info<< "destination list:\n";
list2.print(Info);
Info<< "\ntest pattern that fills all bits\n";
PackedList<4> list3(8, 8);
label pos = list3.size() - 1;
list3[pos--] = list3.max_value();
list3[pos--] = 0;
list3[pos--] = list3.max_value();
list3.print(Info);
Info<< "removed final value: " << list3.remove() << endl;
list3.print(Info);
List<bool> list4(4, true);
{
const List<bool>& constLst = list4;
Info<< "\ntest operator[] const with out-of-range index\n";
Info<< constLst << endl;
if (constLst[20])
{
Info<< "[20] is true (unexpected)\n";
}
else
{
Info<< "[20] is false (expected) list size should be unchanged (const)\n";
}
Info<< constLst << endl;
}
Info<< "\n\nDone.\n";
return 0; return 0;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,3 @@
PackedListTest1.C
EXE = $(FOAM_USER_APPBIN)/PackedListTest1

View File

@ -0,0 +1,347 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
Description
\*---------------------------------------------------------------------------*/
#include "uLabel.H"
#include "IOstreams.H"
#include "PackedBoolList.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
Info<< "PackedList max_bits() = " << PackedList<>::max_bits() << nl;
Info<< "\ntest allocation with value\n";
PackedList<3> list1(5,1);
list1.print(Info);
Info<< "\ntest assign uniform value\n";
list1 = 3;
list1.print(Info);
Info<< "\ntest assign uniform value (with overflow)\n";
list1 = -1;
list1.print(Info);
Info<< "\ntest zero\n";
list1 = 0;
list1.print(Info);
Info<< "\ntest set() with default argument (max_value)\n";
list1.set(3);
list1.print(Info);
Info<< "\ntest assign between references\n";
list1[2] = 3;
list1[4] = list1[2];
list1.print(Info);
Info<< "\ntest assign between references, with chaining\n";
list1[0] = list1[4] = 1;
list1.print(Info);
Info<< "\ntest assign between references, with chaining and auto-vivify\n";
list1[1] = list1[8] = list1[10] = list1[14] = 2;
list1.print(Info);
Info<< "\ntest operator== between references\n";
if (list1[1] == list1[8])
{
Info<< "[1] == [8] (expected)\n";
}
else
{
Info<< "[1] != [8] (unexpected)\n";
}
if (list1[0] != list1[1])
{
Info<< "[0] != [1] (expected)\n";
}
else
{
Info<< "[0] == [1] (unexpected)\n";
}
Info<< "\ntest operator== with iterator\n";
{
PackedList<3>::iterator iter = list1[1];
if (iter != list1[8])
{
Info<< "iter != [8] (expected)\n";
}
else
{
Info<< "iter == [8] (unexpected)\n";
}
if (*iter != list1[8])
{
Info<< "*iter != [8] (unexpected)\n";
}
else
{
Info<< "*iter == [8] (expected)\n";
}
}
{
const PackedList<3>& constLst = list1;
Info<< "\ntest operator[] const with out-of-range index\n";
constLst.print(Info);
if (constLst[20])
{
Info<< "[20] is true (unexpected)\n";
}
else
{
Info<< "[20] is false (expected) list size should be unchanged (const)\n";
}
constLst.print(Info);
Info<< "\ntest operator[] non-const with out-of-range index\n";
if (list1[20])
{
Info<< "[20] is true (unexpected)\n";
}
else
{
Info<< "[20] is false (expected) but list was resized?? (non-const)\n";
}
list1.print(Info);
}
Info<< "\ntest operator[] with out-of-range index\n";
if (!list1[20])
{
Info<< "[20] is false, as expected\n";
}
list1.print(Info);
Info<< "\ntest resize with value (without reallocation)\n";
list1.resize(8, list1.max_value());
list1.print(Info);
Info<< "\ntest flip() function\n";
list1.flip();
list1.print(Info);
Info<< "\nre-flip()\n";
list1.flip();
list1.print(Info);
Info<< "\ntest set() function\n";
list1.set(1, 5);
list1.print(Info);
Info<< "\ntest assign bool\n";
list1 = false;
list1.print(Info);
Info<< "\ntest assign bool\n";
list1 = true;
list1.print(Info);
Info<< "\ntest resize without value (with reallocation)\n";
list1.resize(12);
list1.print(Info);
Info<< "\ntest resize with value (with reallocation)\n";
list1.resize(25, list1.max_value());
list1.print(Info);
Info<< "\ntest resize smaller (should not touch allocation)\n";
list1.resize(8);
list1.print(Info);
Info<< "\ntest append() operation\n";
list1.append(2);
list1.append(3);
list1.append(4);
list1.print(Info);
Info<< "\ntest reserve() operation\n";
list1.reserve(32);
list1.print(Info);
Info<< "\ntest shrink() operation\n";
list1.shrink();
list1.print(Info);
Info<< "\ntest setCapacity() operation\n";
list1.setCapacity(15);
list1.print(Info);
Info<< "\ntest setCapacity() operation\n";
list1.setCapacity(100);
list1.print(Info);
Info<< "\ntest operator[] assignment\n";
list1[16] = 5;
list1.print(Info);
Info<< "\ntest operator[] assignment with auto-vivify\n";
list1[36] = list1.max_value();
list1.print(Info);
Info<< "\ntest setCapacity smaller\n";
list1.setCapacity(24);
list1.print(Info);
Info<< "\ntest resize much smaller\n";
list1.resize(150);
list1.print(Info);
Info<< "\ntest trim\n";
list1.trim();
list1.print(Info);
// add in some misc values
list1[31] = 1;
list1[32] = 2;
list1[33] = 3;
Info<< "\ntest iterator\n";
PackedList<3>::iterator iter = list1.begin();
Info<< "begin():";
iter.print(Info) << "\n";
Info<< "iterator:" << iter() << "\n";
iter() = 5;
iter.print(Info);
list1.print(Info);
iter = list1[31];
Info<< "iterator:" << iter() << "\n";
iter.print(Info);
Info<< "\ntest get() method\n";
Info<< "get(10):" << list1.get(10) << " and list[10]:" << list1[10] << "\n";
list1.print(Info);
Info<< "\ntest iterator indexing\n";
Info<< "cend() ";
list1.cend().print(Info) << "\n";
{
Info<< "\ntest assignment of iterator\n";
list1.print(Info);
Info<< "cend()\n";
list1.end().print(Info);
PackedList<3>::iterator cit = list1[100];
Info<< "out-of-range: ";
cit.print(Info);
cit = list1[15];
Info<< "in-range: ";
cit.print(Info);
Info<< "out-of-range: ";
cit = list1[1000];
cit.print(Info);
}
for
(
PackedList<3>::iterator cit = list1[30];
cit != list1.end();
++cit
)
{
cit.print(Info);
}
Info<< "\ntest operator[] auto-vivify\n";
Info<< "size:" << list1.size() << "\n";
const unsigned int val = list1[45];
Info<< "list[45]:" << val << "\n";
Info<< "size after read:" << list1.size() << "\n";
list1[45] = list1.max_value();
Info<< "size after write:" << list1.size() << "\n";
Info<< "list[45]:" << list1[45] << "\n";
list1[49] = list1[100];
list1.print(Info);
Info<< "\ntest copy constructor + append\n";
PackedList<3> list2(list1);
list2.append(4);
Info<< "source list:\n";
list1.print(Info);
Info<< "destination list:\n";
list2.print(Info);
Info<< "\ntest pattern that fills all bits\n";
PackedList<4> list3(8, 8);
label pos = list3.size() - 1;
list3[pos--] = list3.max_value();
list3[pos--] = 0;
list3[pos--] = list3.max_value();
list3.print(Info);
Info<< "removed final value: " << list3.remove() << endl;
list3.print(Info);
List<bool> list4(4, true);
{
const List<bool>& constLst = list4;
Info<< "\ntest operator[] const with out-of-range index\n";
Info<< constLst << endl;
if (constLst[20])
{
Info<< "[20] is true (unexpected)\n";
}
else
{
Info<< "[20] is false (expected) list size should be unchanged (const)\n";
}
Info<< constLst << endl;
}
Info<< "\n\nDone.\n";
return 0;
}
// ************************************************************************* //

View File

@ -29,6 +29,7 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "argList.H"
#include "IOstreams.H" #include "IOstreams.H"
#include "IOobject.H" #include "IOobject.H"
#include "IFstream.H" #include "IFstream.H"
@ -41,6 +42,15 @@ using namespace Foam;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::noParallel();
argList args(argc, argv);
Info<< nl
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
<< endl;
{ {
dictionary dict1(IFstream("testDict")()); dictionary dict1(IFstream("testDict")());
Info<< "dict1: " << dict1 << nl Info<< "dict1: " << dict1 << nl

View File

@ -14,6 +14,9 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#inputMode merge #inputMode merge
#includeIfPresent "someUnknownFile"
#includeIfPresent "$FOAM_CASE/someUnknownFile"
#includeIfPresent "$FOAM_CASE/someUnknownFile-$FOAM_CASENAME"
internalField uniform 1; internalField uniform 1;

View File

@ -0,0 +1,3 @@
fileNameCleanTest.C
EXE = $(FOAM_USER_APPBIN)/fileNameCleanTest

View File

@ -0,0 +1,104 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
fileNameCleanTest
Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "fileName.H"
#include "SubList.H"
#include "IOobject.H"
#include "IOstreams.H"
#include "OSspecific.H"
using namespace Foam;
void printCleaning(fileName& pathName)
{
Info<< "fileName = " << pathName << nl
<< " path() = " << pathName.path() << nl
<< " name() = " << pathName.name() << nl
<< " joined = " << pathName.path()/pathName.name() << nl << nl;
pathName.clean();
Info<< "cleaned = " << pathName << nl
<< " path() = " << pathName.path() << nl
<< " name() = " << pathName.name() << nl
<< " joined = " << pathName.path()/pathName.name() << nl << nl;
IOobject::writeDivider(Info);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noBanner();
argList::noParallel();
argList::validArgs.insert("fileName .. fileNameN");
argList args(argc, argv, false, true);
if (args.additionalArgs().empty())
{
args.printUsage();
}
if (args.optionFound("case"))
{
fileName pathName = args.option("case");
Info<< nl
<< "-case" << nl
<< "path = " << args.path() << nl
<< "root = " << args.rootPath() << nl
<< "case = " << args.caseName() << nl
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
<< endl;
printCleaning(pathName);
}
forAll(args.additionalArgs(), argI)
{
fileName pathName = args.additionalArgs()[argI];
printCleaning(pathName);
}
Info<< "\nEnd" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -27,6 +27,7 @@ Application
Description Description
Print the OpenFOAM version strings. Print the OpenFOAM version strings.
Simultaneously the smallest possible program to use a minimal bit of Simultaneously the smallest possible program to use a minimal bit of
the OpenFOAM library the OpenFOAM library
@ -37,9 +38,9 @@ Description
int main() int main()
{ {
std::cerr std::cout
<< "build " << Foam::FOAMbuild << "\n" << "version " << Foam::FOAMversion << "\n"
<< "version " << Foam::FOAMversion << "\n"; << "build " << Foam::FOAMbuild << "\n";
return 0; return 0;
} }

View File

@ -0,0 +1,3 @@
mvBakTest.C
EXE = $(FOAM_USER_APPBIN)/mvBakTest

View File

@ -0,0 +1,2 @@
/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */
/* EXE_LIBS = -lfiniteVolume */

View File

@ -23,46 +23,59 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Write primitive and binary block from OPstream using pvm.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "error.H" #include "OSspecific.H"
#include "argList.H"
#include "OPstream.H" using namespace Foam;
#include <pvm3.h>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
namespace Foam int main(int argc, char *argv[])
{ {
argList::noBanner();
argList::noParallel();
argList::validArgs.insert("file .. fileN");
argList::validOptions.erase("case");
argList::validOptions.insert("ext", "bak");
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // argList args(argc, argv, false, true);
OPstream::~OPstream() if (args.additionalArgs().empty())
{
if
(
pvm_psend
(
procID(toProcNo_),
msgType(),
buf_.begin(),
bufPosition_,
PVM_BYTE
) != PvmOk
)
{ {
FatalErrorIn("OPstream::~OPstream()") args.printUsage();
<< "pvm_psend cannot send outgoing message"
<< ::abort;
} }
label ok = 0;
forAll(args.additionalArgs(), argI)
{
const string& srcFile = args.additionalArgs()[argI];
if (args.optionFound("ext"))
{
if (mvBak(srcFile, args.option("ext")))
{
ok++;
}
}
else
{
if (mvBak(srcFile))
{
ok++;
}
}
}
Info<< "mvBak called for " << args.additionalArgs().size()
<< " files (moved " << ok << ")\n" << endl;
return 0;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Hex 2x2x2 refiner Refines a hex mesh by 2x2x2 cell splitting.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -23,9 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Utility to refine cells next to patches. Takes a patchName Utility to refine cells next to patches.
and number of layers to refine. Works out cells within these layers
and refines those in the wall-normal direction. Takes a patchName and number of layers to refine. Works out cells within
these layers and refines those in the wall-normal direction.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -23,10 +23,11 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Utility to split cells with flat faces. Uses a geometric cut with a plane Utility to split cells with flat faces.
dividing the edge angle into two so might produce funny cells. For hexes
it will use by default a cut from edge onto opposite edge (i.e. purely Uses a geometric cut with a plane dividing the edge angle into two so
topological). might produce funny cells. For hexes it will use by default a cut from
edge onto opposite edge (i.e. purely topological).
Options: Options:
- split cells from cellSet only - split cells from cellSet only

View File

@ -5,9 +5,8 @@
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
set -x set -x
# build libccmio and create lnInclude directory # build libccmio and create lnInclude directory
( cd $WM_THIRD_PARTY_DIR && ./AllwmakeLibccmio ) $WM_THIRD_PARTY_DIR/AllwmakeLibccmio
# if the library built properly, the headers should exist too # if the library built properly, the headers should exist too
if [ -e $FOAM_LIBBIN/libccmio.so ] if [ -e $FOAM_LIBBIN/libccmio.so ]

View File

@ -47,6 +47,7 @@ Description
#include "cyclicPolyPatch.H" #include "cyclicPolyPatch.H"
#include "Swap.H" #include "Swap.H"
#include "IFstream.H" #include "IFstream.H"
#include "readHexLabel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -92,6 +93,9 @@ DynamicList<label> cellGroupStartIndex;
DynamicList<label> cellGroupEndIndex; DynamicList<label> cellGroupEndIndex;
DynamicList<label> cellGroupType; DynamicList<label> cellGroupType;
// Special parsing of (incorrect) Cubit files
bool cubitFile = false;
void uniquify(word& name, HashSet<word>& patchNames) void uniquify(word& name, HashSet<word>& patchNames)
{ {
@ -622,11 +626,20 @@ endOfSection {space}")"{space}
BEGIN(readZoneGroupData); BEGIN(readZoneGroupData);
} }
<readZoneGroupData>{space}{label}{space}{word}{space}{word}{space}{label}? { <readZoneGroupData>{space}{hexLabel}{space}{word}{space}{word}{space}{label}? {
IStringStream zoneDataStream(YYText()); IStringStream zoneDataStream(YYText());
// cell zone-ID not in hexadecimal!!! Inconsistency // cell zone-ID not in hexadecimal!!! Inconsistency
label zoneID(readLabel(zoneDataStream)); label zoneID = -1;
if (cubitFile)
{
zoneID = readHexLabel(zoneDataStream);
}
else
{
zoneID = readLabel(zoneDataStream);
}
groupType.insert(zoneID, word(zoneDataStream)); groupType.insert(zoneID, word(zoneDataStream));
groupName.insert(zoneID, word(zoneDataStream)); groupName.insert(zoneID, word(zoneDataStream));
@ -752,6 +765,7 @@ int main(int argc, char *argv[])
argList::validOptions.insert("scale", "scale factor"); argList::validOptions.insert("scale", "scale factor");
argList::validOptions.insert("ignoreCellGroups", "cell group names"); argList::validOptions.insert("ignoreCellGroups", "cell group names");
argList::validOptions.insert("ignoreFaceGroups", "face group names"); argList::validOptions.insert("ignoreFaceGroups", "face group names");
argList::validOptions.insert("cubit", "");
argList args(argc, argv); argList args(argc, argv);
@ -774,6 +788,17 @@ int main(int argc, char *argv[])
args.optionLookup("ignoreFaceGroups")() >> ignoreFaceGroups; args.optionLookup("ignoreFaceGroups")() >> ignoreFaceGroups;
} }
cubitFile = args.options().found("cubit");
if (cubitFile)
{
Info<< nl
<< "Assuming Cubit generated file"
<< " (incorrect face orientation; hexadecimal zoneIDs)."
<< nl << endl;
}
# include "createTime.H" # include "createTime.H"
fileName fluentFile(args.additionalArgs()[0]); fileName fluentFile(args.additionalArgs()[0]);
@ -827,7 +852,10 @@ int main(int argc, char *argv[])
) )
{ {
fm[facei] = true; fm[facei] = true;
faces[facei] = faces[facei].reverseFace(); if (!cubitFile)
{
faces[facei] = faces[facei].reverseFace();
}
Swap(owner[facei], neighbour[facei]); Swap(owner[facei], neighbour[facei]);
} }
} }

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Reads .msh format generated by the Adventure system. Converts .msh file generated by the Adventure system.
Note: the .msh format does not contain any boundary information. It is Note: the .msh format does not contain any boundary information. It is
purely a description of the internal mesh. purely a description of the internal mesh.

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
read Neutral file format as written by Netgen4.4. Converts neutral file format as written by Netgen v4.4.
Example: Example:

View File

@ -23,8 +23,8 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Calculate the dual of a polyMesh. Adheres to all the feature&patch edges. Calculate the dual of a polyMesh. Adheres to all the feature and patch
edges.
Usage Usage

View File

@ -79,7 +79,7 @@ int main(int argc, char *argv[])
scaleFactor = 1; scaleFactor = 1;
} }
} }
if (args.optionFound("solids")) if (args.optionFound("solids"))
{ {
meshReaders::STARCD::keepSolids = true; meshReaders::STARCD::keepSolids = true;

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Reads .ele and .node and .face files as written by tetgen. Converts .ele and .node and .face files, written by tetgen.
Make sure to use add boundary attributes to the smesh file Make sure to use add boundary attributes to the smesh file
(5 fifth column in the element section) (5 fifth column in the element section)

View File

@ -100,7 +100,7 @@ void blockDescriptor::setEdge(label edgeI, label start, label end, label dim)
scalar gExp = calcGexp(expand_[edgeI], dim); scalar gExp = calcGexp(expand_[edgeI], dim);
// divide the line // divide the line
lineDivide divEdge(curvedEdges_[nCEI], dim, 1.0/gExp); lineDivide divEdge(curvedEdges_[nCEI], dim, 1.0/(gExp+SMALL));
pointField p = divEdge.points(); pointField p = divEdge.points();
scalarList d = divEdge.lambdaDivisions(); scalarList d = divEdge.lambdaDivisions();

View File

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x set -x
wclean libso extrudeModel wclean libso extrudeModel
wclean wclean
# ----------------------------------------------------------------- end-of-file

View File

@ -24,8 +24,8 @@ License
Description Description
Extrude mesh from existing patch (by default outwards facing normals; Extrude mesh from existing patch (by default outwards facing normals;
optional flips faces) optional flips faces) or from patch read from file.
or from patch read from file.
Note: Merges close points so be careful. Note: Merges close points so be careful.
Type of extrusion prescribed by run-time selectable model. Type of extrusion prescribed by run-time selectable model.

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -23,11 +23,11 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Makes internal faces into boundary faces. Does not duplicate points. Use Makes internal faces into boundary faces. Does not duplicate points, unlike
mergeOrSplitBaffles if you want this. mergeOrSplitBaffles.
Note: if any coupled patch face is selected for baffling automatically Note: if any coupled patch face is selected for baffling the opposite
the opposite member is selected for baffling as well. Note that this member has to be selected for baffling as well. Note that this
is the same as repatching. This was added only for convenience so is the same as repatching. This was added only for convenience so
you don't have to filter coupled boundary out of your set. you don't have to filter coupled boundary out of your set.
@ -128,6 +128,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("faceZone"); argList::validArgs.append("faceZone");
argList::validArgs.append("patch"); argList::validArgs.append("patch");
argList::validOptions.insert("additionalPatches", "(patch2 .. patchN)"); argList::validOptions.insert("additionalPatches", "(patch2 .. patchN)");
argList::validOptions.insert("internalFacesOnly", "");
argList::validOptions.insert("overwrite", ""); argList::validOptions.insert("overwrite", "");
# include "setRootCase.H" # include "setRootCase.H"
@ -183,6 +184,12 @@ int main(int argc, char *argv[])
bool overwrite = args.optionFound("overwrite"); bool overwrite = args.optionFound("overwrite");
bool internalFacesOnly = args.optionFound("internalFacesOnly");
if (internalFacesOnly)
{
Info<< "Not converting faces on non-coupled patches." << nl << endl;
}
// Read objects in time directory // Read objects in time directory
@ -234,7 +241,21 @@ int main(int argc, char *argv[])
// guarantees that when e.g. creating a cyclic all faces from one // guarantees that when e.g. creating a cyclic all faces from one
// side come first and faces from the other side next. // side come first and faces from the other side next.
// Whether first use of face (modify) or consecutive (add)
PackedBoolList modifiedFace(mesh.nFaces()); PackedBoolList modifiedFace(mesh.nFaces());
// Never modify coupled faces
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (pp.coupled())
{
forAll(pp, i)
{
modifiedFace[pp.start()+i] = 1;
}
}
}
label nModified = 0;
forAll(newPatches, i) forAll(newPatches, i)
{ {
@ -281,6 +302,8 @@ int main(int argc, char *argv[])
modifiedFace // modify or add status modifiedFace // modify or add status
); );
} }
nModified++;
} }
} }
@ -333,16 +356,27 @@ int main(int argc, char *argv[])
// Modify any boundary faces // Modify any boundary faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~
// Normal boundary:
// - move to new patch. Might already be back-to-back baffle
// you want to add cyclic to. Do warn though.
//
// Processor boundary:
// - do not move to cyclic
// - add normal patches though.
// For warning once per patch.
labelHashSet patchWarned;
forAll(patches, patchI) forAll(patches, patchI)
{ {
const polyPatch& pp = patches[patchI]; const polyPatch& pp = patches[patchI];
if (patches[newPatchI].coupled() && pp.coupled()) if (pp.coupled() && patches[newPatchI].coupled())
{ {
// Do not allow coupled faces to be moved to different coupled // Do not allow coupled faces to be moved to different coupled
// patches. // patches.
} }
else else if (pp.coupled() || !internalFacesOnly)
{ {
forAll(pp, i) forAll(pp, i)
{ {
@ -352,6 +386,19 @@ int main(int argc, char *argv[])
if (zoneFaceI != -1) if (zoneFaceI != -1)
{ {
if (patchWarned.insert(patchI))
{
WarningIn(args.executable())
<< "Found boundary face (in patch " << pp.name()
<< ") in faceZone " << fZone.name()
<< " to convert to baffle patch "
<< patches[newPatchI].name()
<< endl
<< " Run with -internalFacesOnly option"
<< " if you don't wish to convert"
<< " boundary faces." << endl;
}
modifyOrAddFace modifyOrAddFace
( (
meshMod, meshMod,
@ -364,6 +411,7 @@ int main(int argc, char *argv[])
fZone.flipMap()[zoneFaceI], // face flip in zone fZone.flipMap()[zoneFaceI], // face flip in zone
modifiedFace // modify or add status modifiedFace // modify or add status
); );
nModified++;
} }
} }
} }
@ -371,7 +419,7 @@ int main(int argc, char *argv[])
} }
Info<< "Converted " << returnReduce(modifiedFace.count(), sumOp<label>()) Info<< "Converted " << returnReduce(nModified, sumOp<label>())
<< " faces into boundary faces on patch " << patchName << nl << endl; << " faces into boundary faces on patch " << patchName << nl << endl;
if (!overwrite) if (!overwrite)

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,7 @@ Application
flattenMesh flattenMesh
Description Description
Flatten the front and back planes of a 2D cartesian mesh. Flattens the front and back planes of a 2D cartesian mesh.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -90,7 +90,7 @@ int main(int argc, char *argv[])
} }
} }
twoDCorr.correctPoints(points); twoDCorr.correctPoints(points);
// Set the precision of the points data to 10 // Set the precision of the points data to 10
IOstream::defaultPrecision(10); IOstream::defaultPrecision(10);

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Pick up cells with cell centre 'inside' of surface. Requires surface Picks up cells with cell centre 'inside' of surface. Requires surface
to be closed and singly connected. to be closed and singly connected.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,7 @@ Application
mergeOrSplitBaffles mergeOrSplitBaffles
Description Description
Detect faces that share points (baffles). Either merge them or Detects faces that share points (baffles). Either merge them or
duplicate the points. duplicate the points.
Notes: Notes:

View File

@ -23,7 +23,6 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Mirrors a mesh around a given plane. Mirrors a mesh around a given plane.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -23,9 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Utility to refine cells in multiple directions. Either supply -all Utility to refine cells in multiple directions.
option to refine all cells (3D refinement for 3D cases; 2D for 2D cases)
or reads a refineMeshDict with Either supply -all option to refine all cells (3D refinement for 3D
cases; 2D for 2D cases) or reads a refineMeshDict with
- cellSet to refine - cellSet to refine
- directions to refine - directions to refine

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -31,12 +31,11 @@ Description
#include "Time.H" #include "Time.H"
#include "polyMesh.H" #include "polyMesh.H"
#include "globalMeshData.H" #include "globalMeshData.H"
#include "topoSetSource.H"
#include "topoSet.H"
#include "IStringStream.H" #include "IStringStream.H"
#include "topoSet.H"
#include "cellSet.H" #include "cellSet.H"
#include "faceSet.H" #include "faceSet.H"
#include "pointSet.H"
#include "topoSetSource.H"
#include "OFstream.H" #include "OFstream.H"
#include "IFstream.H" #include "IFstream.H"
#include "demandDrivenData.H" #include "demandDrivenData.H"

View File

@ -23,8 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description Description
Splits mesh into multiple regions. Each region is defined as a domain Splits mesh into multiple regions.
whose cells can all be reached by cell-face-cell walking without crossing
Each region is defined as a domain whose cells can all be reached by
cell-face-cell walking without crossing
- boundary faces - boundary faces
- additional faces from faceset (-blockedFaces faceSet). - additional faces from faceset (-blockedFaces faceSet).
- any face inbetween differing cellZones (-cellZones) - any face inbetween differing cellZones (-cellZones)

View File

@ -27,7 +27,10 @@ Application
Description Description
Transforms the mesh points in the polyMesh directory according to the Transforms the mesh points in the polyMesh directory according to the
options: translate, rotate and scale options.
Usage
Options are:
-translate vector -translate vector
Translates the points by the given vector, Translates the points by the given vector,

View File

@ -26,9 +26,10 @@ Application
reconstructParMesh reconstructParMesh
Description Description
Reconstructs a mesh using geometric information only. Writes Reconstructs a mesh using geometric information only.
point/face/cell procAddressing so afterwards reconstructPar can be used to
reconstruct fields. Writes point/face/cell procAddressing so afterwards reconstructPar can be
used to reconstruct fields.
Note: Note:
- uses geometric matching tolerance (set with -mergeTol option) - uses geometric matching tolerance (set with -mergeTol option)

View File

@ -26,7 +26,17 @@ Application
redistributeMeshPar redistributeMeshPar
Description Description
Parallel redecomposition of mesh. Redistributes existing decomposed mesh and fields according to the current
settings in the decomposeParDict file.
Must be run on maximum number of source and destination processors.
Balances mesh and writes new mesh to new time directory.
Can also work like decomposePar:
mkdir processor0
cp -r constant processor0
mpirun -np ddd redistributeMeshPar -parallel
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\ /*--------------------------------*- C++ -*----------------------------------*\
| ========= | | | ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 | | \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org | | \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | | | \\/ M anipulation | |
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -36,8 +36,8 @@ Usage
@param -ascii \n @param -ascii \n
Write Ensight data in ASCII format instead of "C Binary" Write Ensight data in ASCII format instead of "C Binary"
@param -zeroTime \n @param -noZero \n
Include the often incomplete initial conditions. Exclude the often incomplete initial conditions.
@param -index \<start\>\n @param -index \<start\>\n
Ignore the time index contained in the time file and use a Ignore the time index contained in the time file and use a

Some files were not shown because too many files have changed in this diff Show More