diff --git a/.gitignore b/.gitignore index a95cd603ba..296f8d0367 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,13 @@ # editor and misc backup files - anywhere *~ .*~ -*.orig *.bak +*.bak[0-9][0-9] +*.orig +*.orig[0-9][0-9] \#*\# + +# file-browser settings - anywhere .directory # CVS recovered versions - anywhere @@ -18,7 +22,7 @@ *.so *.jar -# ignore derived files +# derived files lex.yy.c # Corefiles @@ -30,7 +34,7 @@ core # lnInclude (symlink) folders - anywhere lnInclude -# build folder(s) - anywhere +# build folders - anywhere linux*Gcc*/ linux*Icc*/ linuxming*/ @@ -41,15 +45,14 @@ SunOS*Gcc*/ # reinstate wmake/rules that might look like build folders !wmake/rules/*/ -# but do continue to ignore the derived wmake files -wmake/rules/*/dirToString -wmake/rules/*/wmkdep - # doxygen generated documentation doc/[Dd]oxygen/html doc/[Dd]oxygen/latex doc/[Dd]oxygen/man +# Other HTML files e.g. ReleaseNotes-?.?.html +*.html + # source packages - anywhere *.tar.bz2 *.tar.gz diff --git a/Allwmake b/Allwmake index ca2113e522..ee6f075a0e 100755 --- a/Allwmake +++ b/Allwmake @@ -1,13 +1,21 @@ #!/bin/sh 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 ( cd wmake/src && make ) # build ThirdParty sources -( cd $WM_THIRD_PARTY_DIR && ./Allwmake ) +$WM_THIRD_PARTY_DIR/Allwmake +# build OpenFOAM libraries and applications src/Allwmake applications/Allwmake diff --git a/README b/README index bcce7c5da9..390dd8edb5 100644 --- a/README +++ b/README @@ -1,8 +1,8 @@ # -*- mode: org; -*- # -#+TITLE: *OpenFOAM README for version 1.5* +#+TITLE: OpenFOAM README for version 1.6 #+AUTHOR: OpenCFD Ltd. -#+DATE: 26 August 2008 +#+DATE: July 2009 #+LINK: http://www.opencfd.co.uk #+OPTIONS: author:nil ^:{} @@ -23,17 +23,15 @@ section "Running OpenFOAM in 32-bit mode". *** Qt (from http://trolltech.com/products/qt) - The ParaView 3.3 visualisation package requires that Qt version 4.3.x MUST - be installed on the system. Earlier or more recent versions (4.2.x or - 4.4.x) will NOT work. To check whether Qt4 is installed, and the version, - type: + The ParaView 3.6.1 visualisation package requires Qt to be installed on the + system. ParaView's producers state that ParaView is only officially + supported on Qt version 4.3.x. However, we have found in limited tests that + ParaView works satisfactorily with newer versions of Qt than 4.3.x. To + check whether Qt4 is installed, and the version, type: + qmake --version - The ParaView binary executables in the ThirdParty distribution will only - work with PRECISELY the same version of Qt with which it was compiled. The - 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 + Both 32-bit and 64-bit version of ParaView were compiled with Qt-4.4.3 (with + openSUSE-11.1). 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 versions and they will need to consult the section below on "Compiling ParaView and the PV3FoamReader module." @@ -41,9 +39,11 @@ The default versions of Qt used by some GNU/Linux releases are as follows. + ubuntu-7.10: Version 4.3.2 + ubuntu-8.04: Version 4.3.4 - + openSuSE-10.2: Version 4.2.1 - too old - + openSuSE-10.3: Version 4.3.1 - + openSuSE-11.0: Version 4.4.0 - too new + + ubuntu-9.04: Version 4.5.0 + + openSUSE-10.2: Version 4.2.1 - too old + + 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 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 the sources from TrollTech e.g.: 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. * Installation @@ -61,14 +61,13 @@ The environment variable settings are contained in files in an etc/ directory in the OpenFOAM release. e.g. in - + $HOME/OpenFOAM/OpenFOAM-/etc/ - + where corresponds to the version 1.4, 1.5, ... + + $HOME/OpenFOAM/OpenFOAM-1.6/etc/ 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 $HOME/.bashrc file: - + . $HOME/OpenFOAM/OpenFOAM-/etc/bashrc + + . $HOME/OpenFOAM/OpenFOAM-1.6/etc/bashrc Then update the environment variables by sourcing the $HOME/.bashrc file by typing in the terminal: @@ -78,7 +77,7 @@ 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: - + source $HOME/OpenFOAM/OpenFOAM-/etc/cshrc + + source $HOME/OpenFOAM/OpenFOAM-1.6/etc/cshrc Then update the environment variables by sourcing the $HOME/.cshrc file by typing in the terminal: @@ -94,13 +93,13 @@ appropriate resource file. Here is a bash/ksh/sh example: + export FOAM_INST_DIR=/data/app/OpenFOAM - + foamDotFile=$FOAM_INST_DIR/OpenFOAM-/etc/bashrc + + foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/bashrc + [ -f $foamDotFile ] && . $foamDotFile and a csh/tcsh example: + setenv FOAM_INST_DIR /data/app/OpenFOAM - + foamDotFile=$FOAM_INST_DIR/OpenFOAM-/etc/bashrc + + foamDotFile=$FOAM_INST_DIR/OpenFOAM-1.6/etc/bashrc + if ( -f $foamDotFile ) source $foamDotFile 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/. Install the compiler in - $WM_PROJECT_INST_DIR/ThirdParty/gcc-/platforms/$WM_ARCH$WM_COMPILER_ARCH/ + $WM_THIRD_PARTY_DIR/gcc-/platforms/$WM_ARCH$WM_COMPILER_ARCH/ 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 environment variables as in section 3. @@ -121,10 +120,12 @@ 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, but if problems occur with the build order it may be necessary to update the - environment variables and re-execute 'Allwmake'. If you experience - difficulties with building the source-pack, or your platform is not currently - supported, please contact to negotiate a support - contract and we will do the port and maintain it for future releases. + environment variables and re-execute './Allwmake'. + + If you experience difficulties with building the source-pack, or your platform + is not currently supported, please contact to + negotiate a support contract and we will do the port and maintain it for + future releases. * Testing the installation To check your installation setup, execute the 'foamInstallationTest' script @@ -135,33 +136,37 @@ * Getting Started Create a project directory within the $HOME/OpenFOAM directory named - - (e.g. 'chris-1.5' for user chris and OpenFOAM version 1.5) + -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: - + 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 'run' directory. If the OpenFOAM environment variables are set correctly, then the following command will be correct: - + cp -r $WM_PROJECT_DIR/tutorials - $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run + + cp -r $WM_PROJECT_DIR/tutorials $FOAM_RUN 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 + icoFoam + paraFoam -* Compiling Paraview 3.3 and the PV3FoamReader module - A version of Qt 4.3.x must be installed to compile ParaView. The compilation - 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 - directory, namely cmake-2.4.6 and gcc-4.3.1. Execute the following: - + cd $FOAM_INST_DIR/ThirdParty - + rm -rf ParaView3.3-cvs/platforms - + buildParaView3.3-cvs + Refer to the OpenFOAM User Guide at http://www.OpenFOAM.org/doc/user.html for + more information. + +* Compiling Paraview 3.6.1 and the PV3FoamReader module + If there are problems encountered with ParaView, then it may be necessary to + compile ParaView from sources. The compilation + is a fairly simple process using the makeParaView script + (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 usual manner as follows: @@ -169,6 +174,21 @@ + ./Allwclean + ./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 + + The user must then recompile the PV3FoamReader module as normal (see above). + * Documentation http://www.OpenFOAM.org/doc diff --git a/ReleaseNotes-1.5 b/ReleaseNotes-1.5 deleted file mode 100644 index fab8b8826e..0000000000 --- a/ReleaseNotes-1.5 +++ /dev/null @@ -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. diff --git a/ReleaseNotes-1.6 b/ReleaseNotes-1.6 new file mode 100644 index 0000000000..545021a6b3 --- /dev/null +++ b/ReleaseNotes-1.6 @@ -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 /.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(). + + =randomise= randomises a 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 . + + =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. diff --git a/applications/Allwmake b/applications/Allwmake index 2a7eeae124..82a2ec0df4 100755 --- a/applications/Allwmake +++ b/applications/Allwmake @@ -1,5 +1,14 @@ #!/bin/sh 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 wmake all solvers diff --git a/applications/solvers/combustion/PDRFoam/PDRFoam.C b/applications/solvers/combustion/PDRFoam/PDRFoam.C index 61171f27b3..6bad9d485c 100644 --- a/applications/solvers/combustion/PDRFoam/PDRFoam.C +++ b/applications/solvers/combustion/PDRFoam/PDRFoam.C @@ -26,8 +26,8 @@ Application PDRFoam Description - Compressible premixed/partially-premixed combustion solver with turbulence - modelling. + Solver for compressible premixed/partially-premixed combustion with + turbulence modelling. Combusting RANS code using the b-Xi two-equation model. Xi may be obtained by either the solution of the Xi transport diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C index 5adde282fa..aa9fd58b70 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C @@ -25,10 +25,11 @@ License \*---------------------------------------------------------------------------*/ #include "PDRkEpsilon.H" -#include "wallFvPatch.H" #include "PDRDragModel.H" #include "addToRunTimeSelectionTable.H" +#include "backwardsCompatibilityWallFunctions.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -82,29 +83,29 @@ PDRkEpsilon::PDRkEpsilon 1.92 ) ), - alphak_ + sigmak_ ( dimensioned::lookupOrAddToDict ( - "alphak", + "sigmak", coeffDict_, 1.0 ) ), - alphaEps_ + sigmaEps_ ( dimensioned::lookupOrAddToDict ( - "alphaEps", + "sigmaEps", coeffDict_, - 0.76923 + 1.3 ) ), - alphah_ + Prt_ ( dimensioned::lookupOrAddToDict ( - "alphah", + "Prt", coeffDict_, 1.0 ) @@ -147,9 +148,26 @@ PDRkEpsilon::PDRkEpsilon IOobject::NO_WRITE ), 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(); } @@ -214,9 +232,9 @@ bool PDRkEpsilon::read() Cmu_.readIfPresent(coeffDict_); C1_.readIfPresent(coeffDict_); C2_.readIfPresent(coeffDict_); - alphak_.readIfPresent(coeffDict_); - alphaEps_.readIfPresent(coeffDict_); - alphah_.readIfPresent(coeffDict_); + sigmak_.readIfPresent(coeffDict()); + sigmaEps_.readIfPresent(coeffDict()); + Prt_.readIfPresent(coeffDict()); return true; } @@ -233,7 +251,12 @@ void PDRkEpsilon::correct() { // Re-calculate viscosity mut_ = rho_*Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_); -# include "wallViscosityI.H" + mut_.correctBoundaryConditions(); + + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); + return; } @@ -250,6 +273,9 @@ void PDRkEpsilon::correct() volScalarField G = 2*mut_*(tgradU() && dev(symm(tgradU()))); tgradU.clear(); + // Update espsilon and G at the wall + epsilon_.boundaryField().updateCoeffs(); + // Add the blockage generation term so that it is included consistently // in both the k and epsilon equations const volScalarField& betav = U_.db().lookupObject("betav"); @@ -259,8 +285,6 @@ void PDRkEpsilon::correct() volScalarField GR = drag.Gk(); -# include "wallFunctionsI.H" - // Dissipation equation tmp epsEqn ( @@ -273,10 +297,10 @@ void PDRkEpsilon::correct() - fvm::Sp(C2_*betav*rho_*epsilon_/k_, epsilon_) ); -# include "wallDissipationI.H" - epsEqn().relax(); + epsEqn().boundaryManipulate(epsilon_.boundaryField()); + solve(epsEqn); bound(epsilon_, epsilon0_); @@ -298,12 +322,13 @@ void PDRkEpsilon::correct() solve(kEqn); bound(k_, k0_); - // Re-calculate viscosity mut_ = rho_*Cmu_*sqr(k_)/epsilon_; + mut_.correctBoundaryConditions(); -# include "wallViscosityI.H" - + // Re-calculate thermal diffusivity + alphat_ = mut_/Prt_; + alphat_.correctBoundaryConditions(); } diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H index 7a8f7ae54d..5e919efcc4 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H @@ -29,6 +29,20 @@ Description Standard k-epsilon turbulence model with additional source terms 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 \f$ \kappa-\epsilon \f$ equation for the generation of turbulence due to interaction with unresolved obstacles. @@ -68,16 +82,21 @@ class PDRkEpsilon { // Private data + // Model coefficients + dimensionedScalar Cmu_; dimensionedScalar C1_; dimensionedScalar C2_; - dimensionedScalar alphak_; - dimensionedScalar alphaEps_; - dimensionedScalar alphah_; + dimensionedScalar sigmak_; + dimensionedScalar sigmaEps_; + dimensionedScalar Prt_; + + // Fields volScalarField k_; volScalarField epsilon_; volScalarField mut_; + volScalarField alphat_; public: @@ -85,6 +104,7 @@ public: //- Runtime type information TypeName("PDRkEpsilon"); + // Constructors //- Construct from components @@ -97,7 +117,7 @@ public: ); - // Destructor + //- Destructor virtual ~PDRkEpsilon() {} @@ -114,7 +134,7 @@ public: { return tmp ( - new volScalarField("DkEff", alphak_*mut_ + mu()) + new volScalarField("DkEff", mut_/sigmak_ + mu()) ); } @@ -123,7 +143,7 @@ public: { return tmp ( - new volScalarField("DepsilonEff", alphaEps_*mut_ + mu()) + new volScalarField("DepsilonEff", mut_/sigmaEps_ + mu()) ); } @@ -132,7 +152,7 @@ public: { return tmp ( - new volScalarField("alphaEff", alphah_*mut_ + alpha()) + new volScalarField("alphaEff", alphat_ + alpha()) ); } diff --git a/applications/solvers/combustion/XiFoam/UEqn.H b/applications/solvers/combustion/XiFoam/UEqn.H index 2a7753e14e..9697c6e1ed 100644 --- a/applications/solvers/combustion/XiFoam/UEqn.H +++ b/applications/solvers/combustion/XiFoam/UEqn.H @@ -7,6 +7,8 @@ rho*g ); + UEqn.relax(); + if (momentumPredictor) { solve(UEqn == -fvc::grad(p)); diff --git a/applications/solvers/combustion/XiFoam/XiFoam.C b/applications/solvers/combustion/XiFoam/XiFoam.C index 4c544b433e..15442ddb4f 100644 --- a/applications/solvers/combustion/XiFoam/XiFoam.C +++ b/applications/solvers/combustion/XiFoam/XiFoam.C @@ -26,8 +26,8 @@ Application XiFoam Description - Compressible premixed/partially-premixed combustion solver with turbulence - modelling. + Solver for compressible premixed/partially-premixed combustion with + turbulence modelling. Combusting RANS code using the b-Xi two-equation model. Xi may be obtained by either the solution of the Xi transport @@ -87,12 +87,12 @@ int main(int argc, char *argv[]) runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; - #include "rhoEqn.H" - #include "UEqn.H" - - // --- PISO loop - for (int corr=1; corr<=nCorr; corr++) + // --- Pressure-velocity PIMPLE corrector loop + for (int oCorr=0; oCorrcorrect(); + turbulence->correct(); + } rho = thermo.rho(); diff --git a/applications/solvers/combustion/XiFoam/bEqn.H b/applications/solvers/combustion/XiFoam/bEqn.H index 33ef24bfe6..d06ec2e5f0 100644 --- a/applications/solvers/combustion/XiFoam/bEqn.H +++ b/applications/solvers/combustion/XiFoam/bEqn.H @@ -52,7 +52,7 @@ if (ign.ignited()) + mvConvection->fvmDiv(phi, b) + fvm::div(phiSt, b, "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 = 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; diff --git a/applications/solvers/combustion/XiFoam/ftEqn.H b/applications/solvers/combustion/XiFoam/ftEqn.H index 519cbd7cbe..46d7aeae82 100644 --- a/applications/solvers/combustion/XiFoam/ftEqn.H +++ b/applications/solvers/combustion/XiFoam/ftEqn.H @@ -1,7 +1,7 @@ tmp > mvConvection ( fv::convectionScheme::New - ( + ( mesh, fields, phi, @@ -17,6 +17,6 @@ if (composition.contains("ft")) ( fvm::ddt(rho, ft) + mvConvection->fvmDiv(phi, ft) - - fvm::laplacian(turbulence->muEff(), ft) + - fvm::laplacian(turbulence->alphaEff(), ft) ); } diff --git a/applications/solvers/combustion/XiFoam/hEqn.H b/applications/solvers/combustion/XiFoam/hEqn.H index ebce30e24e..513ae60441 100644 --- a/applications/solvers/combustion/XiFoam/hEqn.H +++ b/applications/solvers/combustion/XiFoam/hEqn.H @@ -1,5 +1,5 @@ { - solve + fvScalarMatrix hEqn ( fvm::ddt(rho, h) + mvConvection->fvmDiv(phi, h) @@ -8,5 +8,8 @@ DpDt ); + hEqn.relax(); + hEqn.solve(); + thermo.correct(); } diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C index 88b8f703d9..e3f9c0b118 100644 --- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C +++ b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C @@ -26,7 +26,7 @@ Application dieselFoam Description - Diesel engine spray and combustion code. + Solver for diesel engine spray and combustion. \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C index d5eeefc98b..86460c1e9a 100644 --- a/applications/solvers/combustion/dieselFoam/dieselFoam.C +++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C @@ -26,7 +26,7 @@ Application dieselFoam Description - Diesel spray and combustion code. + Solver for diesel spray and combustion. \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index 35921313c3..f989c43d41 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -26,7 +26,7 @@ Application reactingFoam Description - Chemical reaction code. + Solver for combustion with chemical reactions. \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C index 680bd784e0..777718b3ea 100644 --- a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C @@ -26,7 +26,8 @@ Application rhoReactingFoam 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 "rhoEqn.H" - #include "UEqn.H" for (label ocorr=1; ocorr <= nOuterCorr; ocorr++) { + #include "UEqn.H" #include "YEqn.H" #include "hEqn.H" diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwclean b/applications/solvers/compressible/rhoCentralFoam/Allwclean index e90223203b..21ee42fadb 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwclean +++ b/applications/solvers/compressible/rhoCentralFoam/Allwclean @@ -1,5 +1,8 @@ #!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x wclean libso BCs wclean +# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoCentralFoam/createFields.H b/applications/solvers/compressible/rhoCentralFoam/createFields.H index daf3a88435..fc65b3e5b4 100644 --- a/applications/solvers/compressible/rhoCentralFoam/createFields.H +++ b/applications/solvers/compressible/rhoCentralFoam/createFields.H @@ -7,7 +7,7 @@ autoPtr pThermo basicPsiThermo& thermo = pThermo(); volScalarField& p = thermo.p(); -volScalarField& h = thermo.h(); +volScalarField& e = thermo.e(); const volScalarField& T = thermo.T(); const volScalarField& psi = thermo.psi(); const volScalarField& mu = thermo.mu(); @@ -70,7 +70,7 @@ volScalarField rhoE IOobject::NO_READ, IOobject::NO_WRITE ), - rho*(h + 0.5*magSqr(U)) - p + rho*(e + 0.5*magSqr(U)) ); surfaceScalarField pos diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index f418f17637..f01a2d5a8a 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -76,10 +76,10 @@ int main(int argc, char *argv[]) surfaceScalarField rPsi_neg = fvc::interpolate(rPsi, neg, "reconstruct(T)"); - surfaceScalarField h_pos = - fvc::interpolate(h, pos, "reconstruct(T)"); - surfaceScalarField h_neg = - fvc::interpolate(h, neg, "reconstruct(T)"); + surfaceScalarField e_pos = + fvc::interpolate(e, pos, "reconstruct(T)"); + surfaceScalarField e_neg = + fvc::interpolate(e, neg, "reconstruct(T)"); surfaceVectorField U_pos = rhoU_pos/rho_pos; 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(); surfaceScalarField phiEp = - aphiv_pos*rho_pos*(h_pos + 0.5*magSqr(U_pos)) - + aphiv_neg*rho_neg*(h_neg + 0.5*magSqr(U_neg)) + aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos) + + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg) + aSf*p_pos - aSf*p_neg; volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T())); @@ -156,7 +156,7 @@ int main(int argc, char *argv[]) { solve ( - fvm::ddt(rho, U) - fvc::ddt(rho,U) + fvm::ddt(rho, U) - fvc::ddt(rho, U) - fvm::laplacian(mu, U) - fvc::div(tauMC) ); @@ -180,28 +180,27 @@ int main(int argc, char *argv[]) - fvc::div(sigmaDotU) ); - h = (rhoE + p)/rho - 0.5*magSqr(U); - h.correctBoundaryConditions(); + e = rhoE/rho - 0.5*magSqr(U); + e.correctBoundaryConditions(); thermo.correct(); rhoE.boundaryField() = rho.boundaryField()* ( - h.boundaryField() + 0.5*magSqr(U.boundaryField()) - ) - - p.boundaryField(); + e.boundaryField() + 0.5*magSqr(U.boundaryField()) + ); if (!inviscid) { volScalarField k("k", thermo.Cp()*mu/Pr); solve ( - fvm::ddt(rho, h) - fvc::ddt(rho, h) - - fvm::laplacian(thermo.alpha(), h) - + fvc::laplacian(thermo.alpha(), h) + fvm::ddt(rho, e) - fvc::ddt(rho, e) + - fvm::laplacian(thermo.alpha(), e) + + fvc::laplacian(thermo.alpha(), e) - fvc::laplacian(k, T) ); thermo.correct(); - rhoE = rho*(h + 0.5*magSqr(U)) - p; + rhoE = rho*(e + 0.5*magSqr(U)); } p.dimensionedInternalField() = diff --git a/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C b/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C index 89c7c817e9..f5a57f15e8 100644 --- a/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C +++ b/applications/solvers/discreteMethods/dsmc/dsmcFoam/dsmcFoam.C @@ -26,7 +26,8 @@ Application dsmcFoam Description - Direct Simulation Monte Carlo Solver for 3D, transient, multi-species flows + Direct simulation Monte Carlo (DSMC) solver for 3D, transient, multi- + species flows \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C index ea10d9129f..66619cfc67 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C +++ b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C @@ -26,7 +26,7 @@ Application mdEquilibrationFoam Description - Equilibrates and/or preconditions MD systems + Equilibrates and/or preconditions molecular dynamics systems \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C index 9fafafe1c9..4f2eea1ccc 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C +++ b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C @@ -26,7 +26,7 @@ Application mdFoam Description - molecular dynamics solver for fluid dynamics + Molecular dynamics solver for fluid dynamics \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C b/applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C index fb6ad9571a..931616bf06 100644 --- a/applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C +++ b/applications/solvers/heatTransfer/buoyantPisoFoam/buoyantPisoFoam.C @@ -26,9 +26,11 @@ Application buoyantPisoFoam Description - Transient Solver for buoyant, turbulent flow of compressible fluids for - ventilation and heat-transfer. Turbulence is modelled using a run-time - selectable compressible RAS or LES model. + Transient solver for buoyant, turbulent flow of compressible fluids for + ventilation and heat-transfer. + + Turbulence is modelled using a run-time selectable compressible RAS or + LES model. \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C b/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C index 3fb6dee9fc..bd1989f433 100644 --- a/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C +++ b/applications/solvers/incompressible/shallowWaterFoam/shallowWaterFoam.C @@ -27,6 +27,7 @@ Application Description 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 component of the velocity normal to gravity is removed. diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C index 5d3705430f..4242452440 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C @@ -26,13 +26,17 @@ Application porousExplicitSourceReactingParcelFoam 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 - porous media - point mass sources - polynomial based, incompressible thermodynamics (f(T)) Note: ddtPhiCorr not used here when porous zones are active - - not well defined for porous calcs + - not well defined for porous calculations \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C index 98ec825db4..625a306466 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C @@ -23,11 +23,13 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - kinematicParcelFoam + uncoupledKinematicParcelFoam Description - Transient solver for a single kinematicCloud. Uses pre-calculated velocity - field to evolve a cloud. + Transient solver for the passive transport of a single kinematic + particle could. + + Uses a pre- calculated velocity field to evolve the cloud. \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H b/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H index 9eb468f916..f9794a914f 100644 --- a/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H +++ b/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H @@ -16,52 +16,93 @@ RASProperties.lookup("turbulence") ); - dictionary kEpsilonCoeffs + dictionary kEpsilonDict ( - RASProperties.subDict("kEpsilonCoeffs") + RASProperties.subDictPtr("kEpsilonCoeffs") ); - - scalar Cmu + dimensionedScalar 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("printCoeffs", false)) + { + Info<< "kEpsilonCoeffs" << kEpsilonDict << nl + << "wallFunctionCoeffs" << wallFunctionDict << endl; + } + + nearWallDist y(mesh); diff --git a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H b/applications/solvers/multiphase/bubbleFoam/kEpsilon.H index b1c8951b04..576e3253ab 100644 --- a/applications/solvers/multiphase/bubbleFoam/kEpsilon.H +++ b/applications/solvers/multiphase/bubbleFoam/kEpsilon.H @@ -16,7 +16,11 @@ if(turbulence) ( fvm::ddt(beta, epsilon) + fvm::div(phib, epsilon) - - fvm::laplacian(alphaEps*nuEffb, epsilon) + - fvm::laplacian + ( + alphaEps*nuEffb, epsilon, + "laplacian(DepsilonEff,epsilon)" + ) == C1*beta*G*epsilon/k - fvm::Sp(C2*beta*epsilon/k, epsilon) @@ -35,7 +39,11 @@ if(turbulence) ( fvm::ddt(beta, k) + fvm::div(phib, k) - - fvm::laplacian(alphak*nuEffb, k) + - fvm::laplacian + ( + alphak*nuEffb, k, + "laplacian(DkEff,k)" + ) == beta*G - fvm::Sp(beta*epsilon/k, k) diff --git a/applications/solvers/multiphase/bubbleFoam/wallFunctions.H b/applications/solvers/multiphase/bubbleFoam/wallFunctions.H index 8650460bc1..38b7297b10 100644 --- a/applications/solvers/multiphase/bubbleFoam/wallFunctions.H +++ b/applications/solvers/multiphase/bubbleFoam/wallFunctions.H @@ -1,8 +1,9 @@ { labelList cellBoundaryFaceCount(epsilon.size(), 0); - scalar Cmu25 = ::pow(Cmu, 0.25); - scalar Cmu75 = ::pow(Cmu, 0.75); + scalar Cmu25 = ::pow(Cmu.value(), 0.25); + scalar Cmu75 = ::pow(Cmu.value(), 0.75); + scalar kappa_ = kappa.value(); const fvPatchList& patches = mesh.boundary(); @@ -53,14 +54,14 @@ epsilon[faceCelli] += Cmu75*::pow(k[faceCelli], 1.5) - /(kappa*y[patchi][facei]); + /(kappa_*y[patchi][facei]); if (yPlus > 11.6) { G[faceCelli] += nuw[facei]*magFaceGradU[facei] *Cmu25*::sqrt(k[faceCelli]) - /(kappa*y[patchi][facei]); + /(kappa_*y[patchi][facei]); } } } diff --git a/applications/solvers/multiphase/bubbleFoam/wallViscosity.H b/applications/solvers/multiphase/bubbleFoam/wallViscosity.H index cd9c005302..21ea94d8d7 100644 --- a/applications/solvers/multiphase/bubbleFoam/wallViscosity.H +++ b/applications/solvers/multiphase/bubbleFoam/wallViscosity.H @@ -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(); @@ -19,14 +22,14 @@ scalar yPlus = Cmu25*y[patchi][facei] *::sqrt(k[faceCelli]) - /nub.value(); + /nub_; if (yPlus > 11.6) { nutw[facei] = - yPlus*nub.value()*kappa - /::log(E*yPlus) - - nub.value(); + yPlus*nub_*kappa_ + /::log(E_*yPlus) + - nub_; } else { diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C index afe1114d22..9a802e0f69 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -27,11 +27,13 @@ Application Description Solver for 2 compressible, isothermal immiscible fluids using a VOF - (volume of fluid) phase-fraction based interface capturing approach. - The momentum and other fluid properties are of the "mixture" and a single - momentum equation is solved. + (volume of fluid) phase-fraction based interface capturing approach, + with optional mesh motion and mesh topology changes including adaptive + 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. \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index 1ab9361f0b..f352885294 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -28,10 +28,11 @@ Application Description Solver for 2 compressible, isothermal immiscible fluids using a VOF (volume of fluid) phase-fraction based interface capturing approach. + 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. + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index c752b300e1..0b1fe938b9 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.C @@ -28,10 +28,11 @@ Application Description Solver for 2 incompressible, isothermal immiscible fluids using a VOF (volume of fluid) phase-fraction based interface capturing approach. + 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. + Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. For a two-fluid approach see twoPhaseEulerFoam. diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C index d08eec4159..b97e1d5725 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C @@ -28,8 +28,10 @@ Application Description Solver for 2 incompressible, isothermal immiscible fluids with phase-change (e.g. cavitation). Uses a VOF (volume of fluid) phase-fraction based - interface capturing approach. The momentum and other fluid properties are - of the "mixture" and a single momentum equation is solved. + interface capturing approach. + + 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 but other mechanisms of phase-change are supported within this solver diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C index e2c9c643a6..95dd2659e4 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C @@ -27,7 +27,7 @@ Application Description 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. diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H index 916acde39e..9f0ca00596 100644 --- a/applications/solvers/multiphase/settlingFoam/createFields.H +++ b/applications/solvers/multiphase/settlingFoam/createFields.H @@ -228,57 +228,103 @@ RASProperties.lookup("turbulence") ); - const dictionary& kEpsilonCoeffs + dictionary kEpsilonDict ( - RASProperties.subDict("kEpsilonCoeffs") + RASProperties.subDictPtr("kEpsilonCoeffs") ); - - scalar Cmu + dimensionedScalar 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("printCoeffs", false)) + { + Info<< "kEpsilonCoeffs" << kEpsilonDict << nl + << "wallFunctionCoeffs" << wallFunctionDict << endl; + } + + nearWallDist y(mesh); Info<< "Reading field k\n" << endl; diff --git a/applications/solvers/multiphase/settlingFoam/kEpsilon.H b/applications/solvers/multiphase/settlingFoam/kEpsilon.H index 0c0930dd10..742fcde708 100644 --- a/applications/solvers/multiphase/settlingFoam/kEpsilon.H +++ b/applications/solvers/multiphase/settlingFoam/kEpsilon.H @@ -26,7 +26,7 @@ if(turbulence) + fvm::div(phi, epsilon) - fvm::laplacian ( - alphaEps*mut + mul, epsilon, + alphaEps*mut + mul, epsilon, "laplacian(DepsilonEff,epsilon)" ) == @@ -49,7 +49,11 @@ if(turbulence) ( fvm::ddt(rho, k) + fvm::div(phi, k) - - fvm::laplacian(alphak*mut + mul, k, "laplacian(DkEff,k)") + - fvm::laplacian + ( + alphak*mut + mul, k, + "laplacian(DkEff,k)" + ) == G - fvm::SuSp(Gcoef + 2.0/3.0*rho*divU, k) diff --git a/applications/solvers/multiphase/settlingFoam/wallFunctions.H b/applications/solvers/multiphase/settlingFoam/wallFunctions.H index 411a897499..ae323691e3 100644 --- a/applications/solvers/multiphase/settlingFoam/wallFunctions.H +++ b/applications/solvers/multiphase/settlingFoam/wallFunctions.H @@ -1,8 +1,9 @@ { labelList cellBoundaryFaceCount(epsilon.size(), 0); - scalar Cmu25 = ::pow(Cmu, 0.25); - scalar Cmu75 = ::pow(Cmu, 0.75); + scalar Cmu25 = ::pow(Cmu.value(), 0.25); + scalar Cmu75 = ::pow(Cmu.value(), 0.75); + scalar kappa_ = kappa.value(); const fvPatchList& patches = mesh.boundary(); @@ -55,14 +56,14 @@ epsilon[faceCelli] += Cmu75*rho[faceCelli]*::pow(k[faceCelli], 1.5) - /(kappa*y[patchi][facei]); + /(kappa_*y[patchi][facei]); if (yPlus > 11.6) { G[faceCelli] += mutw[facei]*magFaceGradU[facei] *Cmu25*::sqrt(k[faceCelli]) - /(kappa*y[patchi][facei]); + /(kappa_*y[patchi][facei]); } } } diff --git a/applications/solvers/multiphase/settlingFoam/wallViscosity.H b/applications/solvers/multiphase/settlingFoam/wallViscosity.H index 665d4bbf74..35d6f9ba8b 100644 --- a/applications/solvers/multiphase/settlingFoam/wallViscosity.H +++ b/applications/solvers/multiphase/settlingFoam/wallViscosity.H @@ -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(); @@ -26,7 +28,7 @@ { mutw[facei] = muw[facei] - *(yPlus*kappa/::log(E*yPlus) - 1); + *(yPlus*kappa_/::log(E_*yPlus) - 1); } else { diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean index c61cba1ad1..cc138bc068 100755 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Allwclean @@ -1,4 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + wclean libso phaseModel wclean libso interfacialModels wclean libso kineticTheoryModels wclean + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options b/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options index 3e7b346fe2..1bf97d106c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I../bubbleFoam \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -IturbulenceModel \ @@ -6,7 +7,7 @@ EXE_INC = \ -IinterfacialModels/lnInclude \ -IphaseModel/lnInclude \ -Iaveraging - + EXE_LIBS = \ -lEulerianInterfacialModels \ -lfiniteVolume \ diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H index 8a17615715..e422fe845b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H @@ -91,34 +91,6 @@ 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 ( transportProperties.lookup("Cvm") @@ -156,114 +128,7 @@ alpha*rhoa + beta*rhob ); - IOdictionary RASProperties - ( - 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 - ); - + #include "createRASTurbulence.H" Info<< "Calculating field DDtUa and DDtUb\n" << endl; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/kEpsilon.H b/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/kEpsilon.H deleted file mode 100644 index 9479d6a47f..0000000000 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/kEpsilon.H +++ /dev/null @@ -1,61 +0,0 @@ -if(turbulence) -{ - if (mesh.changing()) - { - y.correct(); - } - - tmp 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; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/wallDissipation.H b/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/wallDissipation.H deleted file mode 100644 index 5c84c9e7ac..0000000000 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/wallDissipation.H +++ /dev/null @@ -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(p)) - { - epsEqn.setValues - ( - p.faceCells(), - epsilon.boundaryField()[patchi].patchInternalField() - ); - } - } -} - -// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/wallFunctions.H b/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/wallFunctions.H deleted file mode 100644 index ea7d1a9b14..0000000000 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/wallFunctions.H +++ /dev/null @@ -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(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(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(curPatch)) - { - forAll(curPatch, facei) - { - label faceCelli = curPatch.faceCells()[facei]; - - epsilon[faceCelli] /= cellBoundaryFaceCount[faceCelli]; - G[faceCelli] /= cellBoundaryFaceCount[faceCelli]; - } - } - } -} diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/wallViscosity.H b/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/wallViscosity.H deleted file mode 100644 index cd9c005302..0000000000 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/turbulenceModel/wallViscosity.H +++ /dev/null @@ -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(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; - } - } - } - } -} diff --git a/applications/test/PackedList/Make/options b/applications/test/PackedList/Make/options index e69de29bb2..42da6e3418 100644 --- a/applications/test/PackedList/Make/options +++ b/applications/test/PackedList/Make/options @@ -0,0 +1,7 @@ +/* + check for consistent behaviour with non-optimized code + */ + +EXE_INC = \ + -DFULLDEBUG -g -O0 + diff --git a/applications/test/PackedList/PackedListTest.C b/applications/test/PackedList/PackedListTest.C index 05f3a077f8..9bf29923fe 100644 --- a/applications/test/PackedList/PackedListTest.C +++ b/applications/test/PackedList/PackedListTest.C @@ -28,320 +28,146 @@ Description \*---------------------------------------------------------------------------*/ +#include "argList.H" #include "uLabel.H" +#include "IOobject.H" #include "IOstreams.H" +#include "IFstream.H" #include "PackedBoolList.H" +#include + using namespace Foam; +template +inline void reportInfo() +{ + unsigned offset = PackedList::packing(); + + unsigned useSHL = ((1u << (nBits * offset)) - 1); + unsigned useSHR = (~0u >> (sizeof(unsigned)*CHAR_BIT - nBits * offset)); + + Info<< nl + << "PackedList<" << nBits << ">" << nl + << " max_value: " << PackedList::max_value() << nl + << " packing: " << PackedList::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::maskLower(PackedList::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: 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"; - PackedList<3> list1(5,1); - list1.print(Info); + argList::validOptions.insert("mask", ""); + argList::validOptions.insert("count", ""); + argList::validOptions.insert("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); + argList args(argc, argv, false, true); - Info<< "\ntest operator== between references\n"; - if (list1[1] == list1[8]) + if (args.optionFound("mask")) { - 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"; - } - - 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"; - } + args.printUsage(); } + forAll(args.additionalArgs(), argI) { - 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); + const string& srcFile = args.additionalArgs()[argI]; + Info<< nl << "reading " << srcFile << nl; - Info<< "\ntest operator[] non-const with out-of-range index\n"; - if (list1[20]) + IFstream ifs(srcFile); + List