diff --git a/Allwmake b/Allwmake
index d0110357f8..ca2113e522 100755
--- a/Allwmake
+++ b/Allwmake
@@ -5,15 +5,15 @@ set -x
# wmake is required for subsequent targets
( cd wmake/src && make )
+# build ThirdParty sources
( cd $WM_THIRD_PARTY_DIR && ./Allwmake )
-( cd src && ./Allwmake )
-
-( cd applications && ./Allwmake )
+src/Allwmake
+applications/Allwmake
if [ "$1" = doc ]
then
- ( cd doc && ./Allwmake )
+ doc/Allwmake
fi
# ----------------------------------------------------------------- end-of-file
diff --git a/README.html b/README.html
deleted file mode 100644
index cd1497fcad..0000000000
--- a/README.html
+++ /dev/null
@@ -1,197 +0,0 @@
-OpenFOAM README for version 1.5
-
-1 Copyright
-
-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.
-See the file COPYING in this directory, for a description of the GNU General Public License terms under which you can
-copy the files.
-
-2 System requirements
-
-OpenFOAM is developed and tested on Linux, but should work with other Unix style systems. To check your system setup,
-execute the foamSystemCheck script in the bin/ directory of the OpenFOAM installation. If no problems are reported,
-proceed to "3. Installation"; otherwise contact your system administrator.
-
-If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the section "Running OpenFOAM in 32-bit mode".
-
-2.1 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:
-
- * 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 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."
-
-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
-
-Compilation and running of ParaView has been successful using the libraries downloaded in the "libqt4-dev" package on
-ubuntu.
-
-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 conflict with the pre-installed version.
-
-3 Installation
-
-Download and unpack the files in the $HOME/OpenFOAM directory as described in: http://www.OpenFOAM.org/download.html
-
-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, …
-
- * 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
-
- Then update the environment variables by sourcing the $HOME/.bashrc file by typing in the terminal:
-
- + . $HOME/.bashrc
-
- * 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
-
- Then update the environment variables by sourcing the $HOME/.cshrc file by typing in the terminal:
-
- + source $HOME/.cshrc
-
-3.1 Installation in alternative locations
-
-OpenFOAM may also be installed in alternative locations. However, the installation directory should be network
-available (e.g., NFS) if parallel calculations are planned.
-
-The environment variable 'FOAM_INST_DIR' can be used to find and source the appropriate resource file. Here is a bash/
-ksh/sh example:
-
- * export FOAM_INST_DIR=/data/app/OpenFOAM
- * foamDotFile=$FOAM_INST_DIR/OpenFOAM-/etc/bashrc
- * [ -f $foamDotFile ] && . $foamDotFile
-
-and a csh/tcsh example:
-
- * setenv FOAM_INST_DIR /data/app/OpenFOAM
- * foamDotFile=$FOAM_INST_DIR/OpenFOAM-/etc/bashrc
- * if ( -f $foamDotFile ) source $foamDotFile
-
-The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts of the OpenFOAM installation.
-
-4 Building from Sources (Optional)
-
-If you cannot find an appropriate binary pack for your platform, you can build the complete OpenFOAM from the
-source-pack. You will first need to compile or obtain a recent version of gcc (we recomend gcc-4.3.?) for your
-platform, 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/ 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.
-
-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.
-
-5 Testing the installation
-
-To check your installation setup, execute the 'foamInstallationTest' script (in the bin/ directory of the OpenFOAM
-installation). If no problems are reported, proceed to getting started with OpenFOAM; otherwise, go back and check you
-have installed the software correctly and/or contact your system administrator.
-
-6 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) and create a directory named 'run' within it, e.g. by typing:
-
- * mkdir -p $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/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
-
-Run the first example case of incompressible laminar flow in a cavity:
-
- * cd $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run/tutorials/icoFoam/cavity
- * blockMesh
- * icoFoam
- * paraFoam
-
-7 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
-
-The PV3FoamReader module is an OpenFOAM utility that can be compiled in the usual manner as follows:
-
- * cd $FOAM_UTILITIES/postProcessing/graphics/PV3FoamReader
- * ./Allwclean
- * ./Allwmake
-
-8 Documentation
-
-http://www.OpenFOAM.org/doc
-
-9 Help
-
-http://www.OpenFOAM.org http://www.OpenFOAM.org/discussion.html
-
-10 Reporting Bugs in OpenFOAM
-
-http://www.OpenFOAM.org/bugs.html
-
-11 Running OpenFOAM in 32-bit mode on 64-bit machines
-
-Linux users with a 64-bit machine may install either the OpenFOAM 32-bit version (linux) or the OpenFOAM 64-bit version
-(linux64), or both. The 64-bit is the default mode on a 64-bit machine. To use an installed 32-bit version, the user
-must set the environment variable WM_ARCH_OPTION to 32 before sourcing the etc/bashrc (or etc/cshrc) file.
-
-Date: 26 August 2008
-
-HTML generated by org-mode 6.06b in emacs 23
-
diff --git a/ReleaseNotes-1.5 b/ReleaseNotes-1.5
index 387d65d9a0..fab8b8826e 100644
--- a/ReleaseNotes-1.5
+++ b/ReleaseNotes-1.5
@@ -10,7 +10,7 @@
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.
+ 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
diff --git a/ReleaseNotes-1.5.html b/ReleaseNotes-1.5.html
deleted file mode 100644
index d1c62c685b..0000000000
--- a/ReleaseNotes-1.5.html
+++ /dev/null
@@ -1,208 +0,0 @@
-OpenFOAM release notes for version 1.5
-
-1 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.
-
-2 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 re
-quires the installation of Qt 4.3.? for ParaView-3 to run.
-
-3 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.
-
-4 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.
-
-5 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.
-
-6 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.
-
-7 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.
-
-8 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.
-
-9 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.
-
-10 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.
-
-11 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.
-
-Date: 07 October 2008
-
-HTML generated by org-mode 6.06b in emacs 23
-
diff --git a/applications/Allwmake b/applications/Allwmake
index 0c58257068..2a7eeae124 100755
--- a/applications/Allwmake
+++ b/applications/Allwmake
@@ -2,7 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
-( cd solvers && wmake all )
-( cd utilities && wmake all )
+wmake all solvers
+wmake all utilities
# ----------------------------------------------------------------- end-of-file
diff --git a/applications/solvers/Lagrangian/kinematicParcelFoam/Make/options b/applications/solvers/Lagrangian/kinematicParcelFoam/Make/options
index 517724be31..c9727abd52 100644
--- a/applications/solvers/Lagrangian/kinematicParcelFoam/Make/options
+++ b/applications/solvers/Lagrangian/kinematicParcelFoam/Make/options
@@ -1,21 +1,21 @@
EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
- -lfiniteVolume \
- -lmeshTools \
-lthermophysicalFunctions \
-lbasicThermophysicalModels \
- /* -lcombustionThermophysicalModels */ \
-lspecie \
-lradiation \
- -lcompressibleRASModels
+ -lcompressibleRASModels \
+ -lcompressibleLESModels \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H b/applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H
index c5a992817f..3854911dd9 100644
--- a/applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H
+++ b/applications/solvers/Lagrangian/kinematicParcelFoam/createFields.H
@@ -32,12 +32,12 @@
mesh
);
-# include "compressibleCreatePhi.H"
+ #include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
- autoPtr turbulence
+ autoPtr turbulence
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rho,
U,
diff --git a/applications/solvers/Lagrangian/kinematicParcelFoam/kinematicParcelFoam.C b/applications/solvers/Lagrangian/kinematicParcelFoam/kinematicParcelFoam.C
index 57b3dc5d13..e72bac1484 100644
--- a/applications/solvers/Lagrangian/kinematicParcelFoam/kinematicParcelFoam.C
+++ b/applications/solvers/Lagrangian/kinematicParcelFoam/kinematicParcelFoam.C
@@ -26,14 +26,14 @@ Application
kinematicParcelFoam
Description
- Transient solver for a single kinematicCloud. Uses precalculated velocity
+ Transient solver for a single kinematicCloud. Uses pre-calculated velocity
field to evolve a cloud.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
+#include "turbulenceModel.H"
#include "basicKinematicCloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -49,7 +49,7 @@ int main(int argc, char *argv[])
#include "createFields.H"
#include "compressibleCourantNo.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
diff --git a/applications/solvers/combustion/PDRFoam/Make/options b/applications/solvers/combustion/PDRFoam/Make/options
index 9f019439a7..e765e61574 100644
--- a/applications/solvers/combustion/PDRFoam/Make/options
+++ b/applications/solvers/combustion/PDRFoam/Make/options
@@ -9,7 +9,8 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS/compressible/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C
index 222aa0ea92..0f32659545 100644
--- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C
+++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C
@@ -117,7 +117,7 @@ Foam::tmp Foam::PDRDragModels::basic::Dcu() const
{
const volScalarField& betav = U_.db().lookupObject("betav");
- return rho_*CR_*mag(U_) + (Csu*I)*betav*turbulence_.muEff()*Aw2_;
+ return (0.5*rho_)*CR_*mag(U_) + (Csu*I)*betav*turbulence_.muEff()*Aw2_;
}
@@ -125,8 +125,8 @@ Foam::tmp Foam::PDRDragModels::basic::Gk() const
{
const volScalarField& betav = U_.db().lookupObject("betav");
- return
- rho_*mag(U_)*(U_ & CT_ & U_)
+ return
+ (0.5*rho_)*mag(U_)*(U_ & CT_ & U_)
+ Csk*betav*turbulence_.muEff()*Aw2_*magSqr(U_);
}
diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C
index 463acf2448..a0e4bcfdb0 100644
--- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C
+++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C
@@ -50,7 +50,7 @@ PDRkEpsilon::PDRkEpsilon
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
- basicThermo& thermophysicalModel
+ const basicThermo& thermophysicalModel
)
:
RASModel(typeName, rho, U, phi, thermophysicalModel),
diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H
index 2e911ad6a6..15d52e7269 100644
--- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H
+++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H
@@ -77,20 +77,19 @@ public:
// Constructors
- //- from components
+ //- Construct from components
PDRkEpsilon
(
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi,
- basicThermo& thermophysicalModel
+ const basicThermo& thermophysicalModel
);
// Destructor
-
- ~PDRkEpsilon()
- {}
+ virtual ~PDRkEpsilon()
+ {}
// Member Functions
diff --git a/applications/solvers/combustion/PDRFoam/kEpsilon.H b/applications/solvers/combustion/PDRFoam/kEpsilon.H
deleted file mode 100644
index 7264443d6d..0000000000
--- a/applications/solvers/combustion/PDRFoam/kEpsilon.H
+++ /dev/null
@@ -1,54 +0,0 @@
-if(turbulence)
-{
- volScalarField divU = fvc::div(Uf & mesh.Sf());
-
- tmp tgradU = fvc::grad(Uf);
- volScalarField G = 2*mut*(tgradU() && dev(symm(tgradU())));
- tgradU.clear();
-
- // Add the blockage generation term so that it is included consistently
- // in both the k and epsilon equations
- volScalarField GR = rho*mag(U)*(U & CT & U);
-
-# include "wallFunctions.H"
-
- // Dissipation equation
- fvScalarMatrix epsEqn
- (
- betav*fvm::ddt(rho, epsilon)
- + fvm::div(phi, epsilon)
- - fvm::laplacian(fvc::interpolate(alphaEps*muEff), epsilon)
- ==
- C1*(betav*G + GR)*epsilon/k
- - fvm::SuSp((2.0/3.0*C1)*betav*rho*divU, epsilon)
- - fvm::Sp(C2*betav*rho*epsilon/k, epsilon)
- );
-
-# include "wallDissipation.H"
-
- epsEqn.solve();
- bound(epsilon, dimensionedScalar("0", epsilon.dimensions(), 1.0e-15));
-
-
- // Turbulent kinetic energy equation
- solve
- (
- betav*fvm::ddt(rho, k)
- + fvm::div(phi, k)
- - fvm::laplacian(fvc::interpolate(alphak*muEff), k)
- ==
- betav*G + GR
- - fvm::SuSp(2.0/3.0*betav*rho*divU, k)
- - fvm::Sp(betav*rho*epsilon/k, k)
- );
-
- bound(k, dimensionedScalar("0", k.dimensions(), 0.0));
-
- //- Re-calculate turbulence viscosity
- mut = Cmu*rho*sqr(k)/epsilon;
-
-# include "wallViscosity.H"
-
-}
-
-muEff = mut + thermo->mu();
diff --git a/applications/solvers/combustion/XiFoam/Make/options b/applications/solvers/combustion/XiFoam/Make/options
index 69ded9ae57..bc89c0a716 100644
--- a/applications/solvers/combustion/XiFoam/Make/options
+++ b/applications/solvers/combustion/XiFoam/Make/options
@@ -1,19 +1,20 @@
EXE_INC = \
-I$(LIB_SRC)/engine/lnInclude \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
+ -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
+ -I$(LIB_SRC)/sampling/lnInclude \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lengine \
- -lfiniteVolume \
- -lmeshTools \
-lcompressibleRASModels \
+ -lcompressibleLESModels \
-lbasicThermophysicalModels \
-lcombustionThermophysicalModels \
-lspecie \
- -llaminarFlameSpeedModels
+ -llaminarFlameSpeedModels \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/applications/solvers/combustion/XiFoam/XiFoam.C b/applications/solvers/combustion/XiFoam/XiFoam.C
index 8ee0f4d14f..2e5df8fe8c 100644
--- a/applications/solvers/combustion/XiFoam/XiFoam.C
+++ b/applications/solvers/combustion/XiFoam/XiFoam.C
@@ -52,7 +52,7 @@ Description
#include "fvCFD.H"
#include "hhuCombustionThermo.H"
-#include "compressible/RASModel/RASModel.H"
+#include "turbulenceModel.H"
#include "laminarFlameSpeed.H"
#include "ignition.H"
#include "Switch.H"
diff --git a/applications/solvers/combustion/XiFoam/createFields.H b/applications/solvers/combustion/XiFoam/createFields.H
index 737680fefa..8121886402 100644
--- a/applications/solvers/combustion/XiFoam/createFields.H
+++ b/applications/solvers/combustion/XiFoam/createFields.H
@@ -48,9 +48,9 @@
Info<< "Creating turbulence model\n" << endl;
- autoPtr turbulence
+ autoPtr turbulence
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rho,
U,
@@ -60,7 +60,7 @@
);
Info<< "Creating field DpDt\n" << endl;
- volScalarField DpDt =
+ volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
diff --git a/applications/solvers/combustion/Xoodles/Make/files b/applications/solvers/combustion/Xoodles/Make/files
deleted file mode 100644
index 3db9275c31..0000000000
--- a/applications/solvers/combustion/Xoodles/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-Xoodles.C
-
-EXE = $(FOAM_APPBIN)/Xoodles
diff --git a/applications/solvers/combustion/Xoodles/Make/options b/applications/solvers/combustion/Xoodles/Make/options
deleted file mode 100644
index 92932f16d0..0000000000
--- a/applications/solvers/combustion/Xoodles/Make/options
+++ /dev/null
@@ -1,23 +0,0 @@
-EXE_INC = \
- -I$(LIB_SRC)/engine/lnInclude \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/meshTools/lnInclude \
- -I$(LIB_SRC)/sampling/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/LES \
- -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
- -I../XiFoam
-
-
-EXE_LIBS = \
- -lengine \
- -lfiniteVolume \
- -lmeshTools \
- -lbasicThermophysicalModels \
- -lcombustionThermophysicalModels \
- -lspecie \
- -lcompressibleLESModels \
- -llaminarFlameSpeedModels
diff --git a/applications/solvers/combustion/Xoodles/Xoodles.C b/applications/solvers/combustion/Xoodles/Xoodles.C
deleted file mode 100644
index 48ceb34218..0000000000
--- a/applications/solvers/combustion/Xoodles/Xoodles.C
+++ /dev/null
@@ -1,122 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2008 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
- Xoodles
-
-Description
- Compressible premixed/partially-premixed combustion solver with large-eddy
- simulation (LES) turbulence modelling.
-
- Combusting LES code using the b-Xi two-equation model.
- Xi may be obtained by either the solution of the Xi transport
- equation or from an algebraic exression. Both approaches are
- based on Gulder's flame speed correlation which has been shown
- to be appropriate for LES by comparison with the results from the
- spectral model.
-
- Strain effects are encorporated directly into the Xi equation
- but not in the algebraic approximation. Further work need to be
- done on this issue, particularly regarding the enhanced removal rate
- caused by flame compression. Analysis using results of the spectral
- model will be required.
-
- For cases involving very lean Propane flames or other flames which are
- very strain-sensitive, a transport equation for the laminar flame
- speed is present. This equation is derived using heuristic arguments
- involving the strain time scale and the strain-rate at extinction.
- the transport velocity is the same as that for the Xi equation.
-
-\*---------------------------------------------------------------------------*/
-
-#include "fvCFD.H"
-#include "hhuCombustionThermo.H"
-#include "compressible/LESModel/LESModel.H"
-#include "laminarFlameSpeed.H"
-#include "ignition.H"
-#include "IFstream.H"
-#include "OFstream.H"
-
-#define divDevRhoReff divDevRhoBeff
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-int main(int argc, char *argv[])
-{
- #include "setRootCase.H"
-
- #include "createTime.H"
- #include "createMeshNoClear.H"
- #include "readEnvironmentalProperties.H"
- #include "createFields.H"
- #include "readPISOControls.H"
- #include "readCombustionProperties.H"
- #include "initContinuityErrs.H"
-
- Info<< "\nStarting time loop\n" << endl;
-
- for (runTime++; !runTime.end(); runTime++)
- {
- Info<< "Time = " << runTime.timeName() << nl << endl;
-
- #include "compressibleCourantNo.H"
-
- #include "rhoEqn.H"
-
- turbulence->correct();
-
- #include "UEqn.H"
-
- // --- PISO loop
- for (int corr=1; corr<=nCorr; corr++)
- {
- #include "ftEqn.H"
- #include "bEqn.H"
- #include "huEqn.H"
- #include "hEqn.H"
-
- if (!ign.ignited())
- {
- hu == h;
- }
-
- #include "pEqn.H"
- }
-
- runTime.write();
-
- rho = thermo->rho();
-
- Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
- << " ClockTime = " << runTime.elapsedClockTime() << " s"
- << nl << endl;
- }
-
- Info<< "End\n" << endl;
-
- return(0);
-}
-
-
-// ************************************************************************* //
diff --git a/applications/solvers/combustion/Xoodles/createFields.H b/applications/solvers/combustion/Xoodles/createFields.H
deleted file mode 100644
index 8a12db6f1b..0000000000
--- a/applications/solvers/combustion/Xoodles/createFields.H
+++ /dev/null
@@ -1,124 +0,0 @@
- Info<< "Reading thermophysical properties\n" << endl;
-
- autoPtr thermo
- (
- hhuCombustionThermo::New(mesh)
- );
- combustionMixture& composition = thermo->composition();
-
- volScalarField rho
- (
- IOobject
- (
- "rho",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::AUTO_WRITE
- ),
- thermo->rho()
- );
-
- volScalarField& p = thermo->p();
- const volScalarField& psi = thermo->psi();
- volScalarField& h = thermo->h();
- volScalarField& hu = thermo->hu();
-
- volScalarField& b = composition.Y("b");
- Info<< "min(b) = " << min(b).value() << endl;
-
- const volScalarField& T = thermo->T();
-
-
- Info<< "\nReading field U\n" << endl;
- volVectorField U
- (
- IOobject
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-# include "compressibleCreatePhi.H"
-
-
- Info<< "Creating turbulence model\n" << endl;
- autoPtr turbulence
- (
- compressible::LESModel::New(rho, U, phi, thermo())
- );
-
-
- Info<< "Creating field DpDt\n" << endl;
- volScalarField DpDt =
- fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
-
- Info<< "Creating field Xi\n" << endl;
- volScalarField Xi
- (
- IOobject
- (
- "Xi",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-
- Info<< "Creating the unstrained laminar flame speed\n" << endl;
- autoPtr unstrainedLaminarFlameSpeed
- (
- laminarFlameSpeed::New(thermo)
- );
-
-
- Info<< "Reading strained laminar flame speed field Su\n" << endl;
- volScalarField Su
- (
- IOobject
- (
- "Su",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
- dimensionedScalar SuMin = 0.01*Su.average();
- dimensionedScalar SuMax = 4*Su.average();
-
- Info<< "Calculating turbulent flame speed field St\n" << endl;
- volScalarField St
- (
- IOobject
- (
- "St",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::AUTO_WRITE
- ),
- Xi*Su
- );
-
-
- multivariateSurfaceInterpolationScheme::fieldTable fields;
-
- if (composition.contains("ft"))
- {
- fields.add(composition.Y("ft"));
- }
-
- fields.add(b);
- fields.add(h);
- fields.add(hu);
diff --git a/applications/solvers/combustion/coldEngineFoam/Make/options b/applications/solvers/combustion/coldEngineFoam/Make/options
index fef39c4afd..028498cc63 100644
--- a/applications/solvers/combustion/coldEngineFoam/Make/options
+++ b/applications/solvers/combustion/coldEngineFoam/Make/options
@@ -2,15 +2,16 @@ EXE_INC = \
-I../engineFoam \
-I../XiFoam \
-I$(LIB_SRC)/engine/lnInclude \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS/compressible/lnInclude
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lengine \
- -lfiniteVolume \
-lcompressibleRASModels \
+ -lcompressibleLESModels \
-lbasicThermophysicalModels \
- -lspecie
+ -lspecie \
+ -lfiniteVolume
diff --git a/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C b/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C
index b262b7b79c..2f077ca1cf 100644
--- a/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C
+++ b/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C
@@ -34,7 +34,7 @@ Description
#include "engineTime.H"
#include "engineMesh.H"
#include "basicThermo.H"
-#include "RASModel.H"
+#include "turbulenceModel.H"
#include "OFstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/coldEngineFoam/createFields.H b/applications/solvers/combustion/coldEngineFoam/createFields.H
index ed7c012d53..7a369df472 100644
--- a/applications/solvers/combustion/coldEngineFoam/createFields.H
+++ b/applications/solvers/combustion/coldEngineFoam/createFields.H
@@ -42,9 +42,9 @@
Info<< "Creating turbulence model\n" << endl;
- autoPtr turbulence
+ autoPtr turbulence
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rho,
U,
diff --git a/applications/solvers/combustion/dieselEngineFoam/Make/options b/applications/solvers/combustion/dieselEngineFoam/Make/options
index a5cbe01e35..20f008d331 100644
--- a/applications/solvers/combustion/dieselEngineFoam/Make/options
+++ b/applications/solvers/combustion/dieselEngineFoam/Make/options
@@ -1,7 +1,6 @@
EXE_INC = \
-I../engineFoam \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
@@ -14,11 +13,13 @@ EXE_INC = \
-I$(LIB_SRC)/../applications/solvers/combustion/XiFoam \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/ODE/lnInclude \
- -I$(LIB_SRC)/engine/lnInclude
+ -I$(LIB_SRC)/engine/lnInclude \
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
EXE_LIBS = \
-lengine \
-lcompressibleRASModels \
+ -lcompressibleLESModels \
-lcombustionThermophysicalModels \
-lfiniteVolume \
-llagrangian \
diff --git a/applications/solvers/combustion/dieselEngineFoam/createFields.H b/applications/solvers/combustion/dieselEngineFoam/createFields.H
index c07aa63cdb..cf0532b0f3 100644
--- a/applications/solvers/combustion/dieselEngineFoam/createFields.H
+++ b/applications/solvers/combustion/dieselEngineFoam/createFields.H
@@ -58,9 +58,9 @@ volScalarField kappa
);
Info << "Creating turbulence model.\n" << nl;
-autoPtr turbulence
+autoPtr turbulence
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rho,
U,
@@ -70,7 +70,7 @@ autoPtr turbulence
);
Info<< "Creating field DpDt\n" << endl;
-volScalarField DpDt =
+volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
Info << "Constructing chemical mechanism" << endl;
diff --git a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C
index f579825384..3882701c73 100644
--- a/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C
+++ b/applications/solvers/combustion/dieselEngineFoam/dieselEngineFoam.C
@@ -34,7 +34,7 @@ Description
#include "engineTime.H"
#include "engineMesh.H"
#include "hCombustionThermo.H"
-#include "compressible/RASModel/RASModel.H"
+#include "turbulenceModel.H"
#include "spray.H"
#include "chemistryModel.H"
#include "chemistrySolver.H"
diff --git a/applications/solvers/combustion/dieselFoam/Make/options b/applications/solvers/combustion/dieselFoam/Make/options
index 605042aa49..44d527b062 100644
--- a/applications/solvers/combustion/dieselFoam/Make/options
+++ b/applications/solvers/combustion/dieselFoam/Make/options
@@ -1,7 +1,7 @@
EXE_INC = \
-I../dieselEngineFoam \
-I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/dieselSpray/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \
@@ -17,8 +17,8 @@ EXE_INC = \
EXE_LIBS = \
-lcompressibleRASModels \
+ -lcompressibleLESModels \
-lcombustionThermophysicalModels \
- -lfiniteVolume \
-llagrangian \
-ldieselSpray \
-lliquids \
@@ -29,4 +29,5 @@ EXE_LIBS = \
-llaminarFlameSpeedModels \
-lchemistryModel \
-lODE \
- -lpdf
+ -lpdf \
+ -lfiniteVolume
diff --git a/applications/solvers/combustion/dieselFoam/dieselFoam.C b/applications/solvers/combustion/dieselFoam/dieselFoam.C
index 73abb05b51..899dd2928a 100644
--- a/applications/solvers/combustion/dieselFoam/dieselFoam.C
+++ b/applications/solvers/combustion/dieselFoam/dieselFoam.C
@@ -32,7 +32,7 @@ Description
#include "fvCFD.H"
#include "hCombustionThermo.H"
-#include "compressible/RASModel/RASModel.H"
+#include "turbulenceModel.H"
#include "spray.H"
#include "chemistryModel.H"
#include "chemistrySolver.H"
diff --git a/applications/solvers/combustion/engineFoam/Make/options b/applications/solvers/combustion/engineFoam/Make/options
index 73b365c001..3ee7cc666f 100644
--- a/applications/solvers/combustion/engineFoam/Make/options
+++ b/applications/solvers/combustion/engineFoam/Make/options
@@ -1,18 +1,19 @@
EXE_INC = \
+ -I../XiFoam \
-I$(LIB_SRC)/engine/lnInclude \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS/compressible/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
- -I../XiFoam
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lengine \
- -lfiniteVolume \
-lcompressibleRASModels \
+ -lcompressibleLESModels \
-lbasicThermophysicalModels \
-lcombustionThermophysicalModels \
-lspecie \
- -llaminarFlameSpeedModels
+ -llaminarFlameSpeedModels \
+ -lfiniteVolume
diff --git a/applications/solvers/combustion/engineFoam/engineFoam.C b/applications/solvers/combustion/engineFoam/engineFoam.C
index b7f94eb6f7..544b967a16 100644
--- a/applications/solvers/combustion/engineFoam/engineFoam.C
+++ b/applications/solvers/combustion/engineFoam/engineFoam.C
@@ -53,7 +53,7 @@ Description
#include "engineTime.H"
#include "engineMesh.H"
#include "hhuCombustionThermo.H"
-#include "RASModel.H"
+#include "turbulenceModel.H"
#include "laminarFlameSpeed.H"
#include "ignition.H"
#include "Switch.H"
diff --git a/applications/solvers/combustion/reactingFoam/Make/options b/applications/solvers/combustion/reactingFoam/Make/options
index 2753c31bf0..908472524a 100644
--- a/applications/solvers/combustion/reactingFoam/Make/options
+++ b/applications/solvers/combustion/reactingFoam/Make/options
@@ -1,18 +1,19 @@
EXE_INC = \
-I../XiFoam \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
- -I$(LIB_SRC)/ODE/lnInclude
+ -I$(LIB_SRC)/ODE/lnInclude \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lcompressibleRASModels \
+ -lcompressibleLESModels \
-lcombustionThermophysicalModels \
- -lfiniteVolume \
-lspecie \
-lbasicThermophysicalModels \
-lchemistryModel \
- -lODE
+ -lODE \
+ -lfiniteVolume
diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H
index c07aa63cdb..cf0532b0f3 100644
--- a/applications/solvers/combustion/reactingFoam/createFields.H
+++ b/applications/solvers/combustion/reactingFoam/createFields.H
@@ -58,9 +58,9 @@ volScalarField kappa
);
Info << "Creating turbulence model.\n" << nl;
-autoPtr turbulence
+autoPtr turbulence
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rho,
U,
@@ -70,7 +70,7 @@ autoPtr turbulence
);
Info<< "Creating field DpDt\n" << endl;
-volScalarField DpDt =
+volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
Info << "Constructing chemical mechanism" << endl;
diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C
index e4773559a6..ad91e392ee 100644
--- a/applications/solvers/combustion/reactingFoam/reactingFoam.C
+++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C
@@ -32,7 +32,7 @@ Description
#include "fvCFD.H"
#include "hCombustionThermo.H"
-#include "compressible/RASModel/RASModel.H"
+#include "turbulenceModel.H"
#include "chemistryModel.H"
#include "chemistrySolver.H"
#include "multivariateScheme.H"
diff --git a/applications/solvers/compressible/coodles/Make/files b/applications/solvers/compressible/coodles/Make/files
deleted file mode 100644
index fe1849f0ad..0000000000
--- a/applications/solvers/compressible/coodles/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-coodles.C
-
-EXE = $(FOAM_APPBIN)/coodles
diff --git a/applications/solvers/compressible/coodles/createFields.H b/applications/solvers/compressible/coodles/createFields.H
deleted file mode 100644
index 5b02f0c4db..0000000000
--- a/applications/solvers/compressible/coodles/createFields.H
+++ /dev/null
@@ -1,50 +0,0 @@
- Info<< "Reading thermophysical properties\n" << endl;
-
- autoPtr thermo
- (
- basicThermo::New(mesh)
- );
-
- volScalarField& p = thermo->p();
- volScalarField& h = thermo->h();
- const volScalarField& psi = thermo->psi();
-
- volScalarField rho
- (
- IOobject
- (
- "rho",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::AUTO_WRITE
- ),
- thermo->rho()
- );
-
- Info<< "\nReading field U\n" << endl;
- volVectorField U
- (
- IOobject
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-# include "compressibleCreatePhi.H"
-
-
- Info<< "Creating turbulence model\n" << endl;
- autoPtr turbulence
- (
- compressible::LESModel::New(rho, U, phi, thermo())
- );
-
- Info<< "Creating field DpDt\n" << endl;
- volScalarField DpDt =
- fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
diff --git a/applications/solvers/compressible/rhoPimpleFoam/Make/options b/applications/solvers/compressible/rhoPimpleFoam/Make/options
index c33e5a1da8..4858e53f30 100644
--- a/applications/solvers/compressible/rhoPimpleFoam/Make/options
+++ b/applications/solvers/compressible/rhoPimpleFoam/Make/options
@@ -1,12 +1,13 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/cfdTools \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
+ -I$(LIB_SRC)/finiteVolume/cfdTools \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
- -lfiniteVolume \
- -lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
- -lcompressibleRASModels
+ -lcompressibleRASModels \
+ -lcompressibleLESModels \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/applications/solvers/compressible/rhoPimpleFoam/createFields.H b/applications/solvers/compressible/rhoPimpleFoam/createFields.H
index 5704a66403..e836704cb1 100644
--- a/applications/solvers/compressible/rhoPimpleFoam/createFields.H
+++ b/applications/solvers/compressible/rhoPimpleFoam/createFields.H
@@ -44,9 +44,9 @@
);
Info<< "Creating turbulence model\n" << endl;
- autoPtr turbulence
+ autoPtr turbulence
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rho,
U,
@@ -59,5 +59,5 @@
Info<< "Creating field DpDt\n" << endl;
- volScalarField DpDt =
+ volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C
index 858d83749e..0d85a699bf 100644
--- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C
+++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C
@@ -26,8 +26,8 @@ Application
rhoPimpleFoam
Description
- Transient solver for turbulent flow of compressible fluids for
- ventilation and heat-transfer.
+ Transient solver for laminar or turbulent flow of compressible fluids
+ for HVAC and similar applications.
Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
pseudo-transient simulations.
@@ -36,8 +36,8 @@ Description
#include "fvCFD.H"
#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
-#include "fixedGradientFvPatchFields.H"
+#include "turbulenceModel.H"
+#include "bound.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/solvers/compressible/rhoPisoFoam/Make/files b/applications/solvers/compressible/rhoPisoFoam/Make/files
new file mode 100644
index 0000000000..3c89295014
--- /dev/null
+++ b/applications/solvers/compressible/rhoPisoFoam/Make/files
@@ -0,0 +1,3 @@
+rhoPisoFoam.C
+
+EXE = $(FOAM_APPBIN)/rhoPisoFoam
diff --git a/applications/solvers/compressible/coodles/Make/options b/applications/solvers/compressible/rhoPisoFoam/Make/options
similarity index 64%
rename from applications/solvers/compressible/coodles/Make/options
rename to applications/solvers/compressible/rhoPisoFoam/Make/options
index 9d53cd4819..5c62488b65 100644
--- a/applications/solvers/compressible/coodles/Make/options
+++ b/applications/solvers/compressible/rhoPisoFoam/Make/options
@@ -1,13 +1,13 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/LES \
- -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
+ -lcompressibleRASModels \
-lcompressibleLESModels
diff --git a/applications/solvers/compressible/coodles/UEqn.H b/applications/solvers/compressible/rhoPisoFoam/UEqn.H
similarity index 100%
rename from applications/solvers/compressible/coodles/UEqn.H
rename to applications/solvers/compressible/rhoPisoFoam/UEqn.H
diff --git a/applications/solvers/compressible/rhoTurbFoam/createFields.H b/applications/solvers/compressible/rhoPisoFoam/createFields.H
similarity index 88%
rename from applications/solvers/compressible/rhoTurbFoam/createFields.H
rename to applications/solvers/compressible/rhoPisoFoam/createFields.H
index a523aa36d5..614f01702d 100644
--- a/applications/solvers/compressible/rhoTurbFoam/createFields.H
+++ b/applications/solvers/compressible/rhoPisoFoam/createFields.H
@@ -40,18 +40,18 @@
Info<< "Creating turbulence model\n" << endl;
- autoPtr turbulence
+ autoPtr turbulence
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo()
)
- );
-
+ );
+
Info<< "Creating field DpDt\n" << endl;
- volScalarField DpDt =
+ volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
diff --git a/applications/solvers/compressible/coodles/hEqn.H b/applications/solvers/compressible/rhoPisoFoam/hEqn.H
similarity index 100%
rename from applications/solvers/compressible/coodles/hEqn.H
rename to applications/solvers/compressible/rhoPisoFoam/hEqn.H
diff --git a/applications/solvers/compressible/coodles/pEqn.H b/applications/solvers/compressible/rhoPisoFoam/pEqn.H
similarity index 100%
rename from applications/solvers/compressible/coodles/pEqn.H
rename to applications/solvers/compressible/rhoPisoFoam/pEqn.H
diff --git a/applications/solvers/compressible/coodles/coodles.C b/applications/solvers/compressible/rhoPisoFoam/rhoPisoFoam.C
similarity index 83%
rename from applications/solvers/compressible/coodles/coodles.C
rename to applications/solvers/compressible/rhoPisoFoam/rhoPisoFoam.C
index 0cb902336e..4a625bdb83 100644
--- a/applications/solvers/compressible/coodles/coodles.C
+++ b/applications/solvers/compressible/rhoPisoFoam/rhoPisoFoam.C
@@ -23,18 +23,16 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
- coodles
+ rhoPisoFoam
Description
- Compressible LES solver.
+ Transient PISO solver for compressible, laminar or turbulent flow.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicThermo.H"
-#include "compressible/LESModel/LESModel.H"
-
-#define divDevRhoReff divDevRhoBeff
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -45,16 +43,27 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
+ #include "readPISOControls.H"
#include "initContinuityErrs.H"
+ #include "readTimeControls.H"
+ #include "compressibleCourantNo.H"
+ #include "setInitialDeltaT.H"
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
- for (runTime++; !runTime.end(); runTime++)
+ while (runTime.run())
{
- Info<< "Time = " << runTime.timeName() << nl << endl;
-
+ #include "readTimeControls.H"
#include "readPISOControls.H"
#include "compressibleCourantNo.H"
+ #include "setDeltaT.H"
+
+ runTime++;
+
+ Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"
#include "UEqn.H"
diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options b/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options
index 6d8c3fe27a..61456e486a 100644
--- a/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options
+++ b/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options
@@ -1,13 +1,14 @@
EXE_INC = \
+ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/meshTools/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS
+ -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
- -lfiniteVolume \
- -lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
- -lcompressibleRASModels
+ -lcompressibleRASModels \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C b/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C
index cba0c2dce1..df2373512b 100644
--- a/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C
+++ b/applications/solvers/compressible/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C
@@ -33,7 +33,7 @@ Description
#include "fvCFD.H"
#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
+#include "RASModel.H"
#include "porousZones.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/solvers/compressible/rhoSimpleFoam/Make/options b/applications/solvers/compressible/rhoSimpleFoam/Make/options
index c33e5a1da8..d51be54abf 100644
--- a/applications/solvers/compressible/rhoSimpleFoam/Make/options
+++ b/applications/solvers/compressible/rhoSimpleFoam/Make/options
@@ -1,12 +1,13 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/cfdTools \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
+ -I$(LIB_SRC)/finiteVolume/cfdTools \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
- -lfiniteVolume \
- -lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
- -lcompressibleRASModels
+ -lcompressibleRASModels \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C
index edfe329902..efabfc9ef8 100644
--- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C
+++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C
@@ -26,27 +26,26 @@ Application
rhoSimpleFoam
Description
- Steady-state solver for turbulent flow of compressible fluids
+ Steady-state SIMPLE solver for laminar or turbulent flow of
+ compressible fluids.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
-#include "fixedGradientFvPatchFields.H"
+#include "RASModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
+ #include "setRootCase.H"
+ #include "createTime.H"
+ #include "createMesh.H"
+ #include "createFields.H"
+ #include "initContinuityErrs.H"
-# include "setRootCase.H"
-# include "createTime.H"
-# include "createMesh.H"
-# include "createFields.H"
-# include "initContinuityErrs.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@@ -54,17 +53,17 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
-# include "readSIMPLEControls.H"
-# include "initConvergenceCheck.H"
+ #include "readSIMPLEControls.H"
+ #include "initConvergenceCheck.H"
p.storePrevIter();
rho.storePrevIter();
// Pressure-velocity SIMPLE corrector
{
-# include "UEqn.H"
-# include "hEqn.H"
-# include "pEqn.H"
+ #include "UEqn.H"
+ #include "hEqn.H"
+ #include "pEqn.H"
}
turbulence->correct();
@@ -75,7 +74,7 @@ int main(int argc, char *argv[])
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
-# include "convergenceCheck.H"
+ #include "convergenceCheck.H"
}
Info<< "End\n" << endl;
diff --git a/applications/solvers/compressible/rhoTurbFoam/Make/files b/applications/solvers/compressible/rhoTurbFoam/Make/files
deleted file mode 100644
index eac0e20e76..0000000000
--- a/applications/solvers/compressible/rhoTurbFoam/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-rhoTurbFoam.C
-
-EXE = $(FOAM_APPBIN)/rhoTurbFoam
diff --git a/applications/solvers/compressible/rhoTurbFoam/Make/options b/applications/solvers/compressible/rhoTurbFoam/Make/options
deleted file mode 100644
index e7f320c747..0000000000
--- a/applications/solvers/compressible/rhoTurbFoam/Make/options
+++ /dev/null
@@ -1,12 +0,0 @@
-EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS
-
-EXE_LIBS = \
- -lfiniteVolume \
- -lmeshTools \
- -lbasicThermophysicalModels \
- -lspecie \
- -lcompressibleRASModels
diff --git a/applications/solvers/compressible/rhoTurbFoam/UEqn.H b/applications/solvers/compressible/rhoTurbFoam/UEqn.H
deleted file mode 100644
index 64dd52b1b0..0000000000
--- a/applications/solvers/compressible/rhoTurbFoam/UEqn.H
+++ /dev/null
@@ -1,11 +0,0 @@
- fvVectorMatrix UEqn
- (
- fvm::ddt(rho, U)
- + fvm::div(phi, U)
- + turbulence->divDevRhoReff(U)
- );
-
- if (momentumPredictor)
- {
- solve(UEqn == -fvc::grad(p));
- }
diff --git a/applications/solvers/compressible/rhoTurbFoam/hEqn.H b/applications/solvers/compressible/rhoTurbFoam/hEqn.H
deleted file mode 100644
index f72ef0c89c..0000000000
--- a/applications/solvers/compressible/rhoTurbFoam/hEqn.H
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- solve
- (
- fvm::ddt(rho, h)
- + fvm::div(phi, h)
- - fvm::laplacian(turbulence->alphaEff(), h)
- ==
- DpDt
- );
-
- thermo->correct();
-}
diff --git a/applications/solvers/compressible/rhoTurbFoam/pEqn.H b/applications/solvers/compressible/rhoTurbFoam/pEqn.H
deleted file mode 100644
index 05db89627d..0000000000
--- a/applications/solvers/compressible/rhoTurbFoam/pEqn.H
+++ /dev/null
@@ -1,68 +0,0 @@
-rho = thermo->rho();
-
-volScalarField rUA = 1.0/UEqn.A();
-U = rUA*UEqn.H();
-
-if (transonic)
-{
- surfaceScalarField phid
- (
- "phid",
- fvc::interpolate(thermo->psi())
- *(
- (fvc::interpolate(U) & mesh.Sf())
- + fvc::ddtPhiCorr(rUA, rho, U, phi)
- )
- );
-
- for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
- {
- fvScalarMatrix pEqn
- (
- fvm::ddt(psi, p)
- + fvm::div(phid, p)
- - fvm::laplacian(rho*rUA, p)
- );
-
- pEqn.solve();
-
- if (nonOrth == nNonOrthCorr)
- {
- phi == pEqn.flux();
- }
- }
-}
-else
-{
- phi =
- fvc::interpolate(rho)*
- (
- (fvc::interpolate(U) & mesh.Sf())
- + fvc::ddtPhiCorr(rUA, rho, U, phi)
- );
-
- for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
- {
- fvScalarMatrix pEqn
- (
- fvm::ddt(psi, p)
- + fvc::div(phi)
- - fvm::laplacian(rho*rUA, p)
- );
-
- pEqn.solve();
-
- if (nonOrth == nNonOrthCorr)
- {
- phi += pEqn.flux();
- }
- }
-}
-
-#include "rhoEqn.H"
-#include "compressibleContinuityErrs.H"
-
-U -= rUA*fvc::grad(p);
-U.correctBoundaryConditions();
-
-DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
diff --git a/applications/solvers/compressible/rhoTurbFoam/rhoTurbFoam.C b/applications/solvers/compressible/rhoTurbFoam/rhoTurbFoam.C
deleted file mode 100644
index 1e5ea33405..0000000000
--- a/applications/solvers/compressible/rhoTurbFoam/rhoTurbFoam.C
+++ /dev/null
@@ -1,96 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2008 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
- rhoTurbFoam
-
-Description
- Transient solver for compressible, turbulent flow.
-
-\*---------------------------------------------------------------------------*/
-
-#include "fvCFD.H"
-#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-int main(int argc, char *argv[])
-{
-
-# include "setRootCase.H"
-
-# include "createTime.H"
-# include "createMesh.H"
-# include "createFields.H"
-# include "readPISOControls.H"
-# include "initContinuityErrs.H"
-# include "readTimeControls.H"
-# include "compressibleCourantNo.H"
-# include "setInitialDeltaT.H"
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
- Info<< "\nStarting time loop\n" << endl;
-
- while (runTime.run())
- {
-# include "readTimeControls.H"
-# include "readPISOControls.H"
-# include "compressibleCourantNo.H"
-# include "setDeltaT.H"
-
- runTime++;
-
- Info<< "Time = " << runTime.timeName() << nl << endl;
-
-# include "rhoEqn.H"
-# include "UEqn.H"
-
- // --- PISO loop
- for (int corr=1; corr<=nCorr; corr++)
- {
-# include "hEqn.H"
-# include "pEqn.H"
- }
-
- turbulence->correct();
-
- rho = thermo->rho();
-
- runTime.write();
-
- Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
- << " ClockTime = " << runTime.elapsedClockTime() << " s"
- << nl << endl;
- }
-
- Info<< "End\n" << endl;
-
- return(0);
-}
-
-
-// ************************************************************************* //
diff --git a/applications/solvers/compressible/sonicDyMFoam/Make/files b/applications/solvers/compressible/sonicDyMFoam/Make/files
new file mode 100644
index 0000000000..08fa87a2cc
--- /dev/null
+++ b/applications/solvers/compressible/sonicDyMFoam/Make/files
@@ -0,0 +1,3 @@
+sonicDyMFoam.C
+
+EXE = $(FOAM_APPBIN)/sonicDyMFoam
diff --git a/applications/solvers/compressible/sonicTurbFoam/Make/options b/applications/solvers/compressible/sonicDyMFoam/Make/options
similarity index 50%
rename from applications/solvers/compressible/sonicTurbFoam/Make/options
rename to applications/solvers/compressible/sonicDyMFoam/Make/options
index 44a57f741c..f05f52d427 100644
--- a/applications/solvers/compressible/sonicTurbFoam/Make/options
+++ b/applications/solvers/compressible/sonicDyMFoam/Make/options
@@ -1,12 +1,16 @@
EXE_INC = \
-I../sonicFoam \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
+ -I$(LIB_SRC)/dynamicMesh/lnInclude \
+ -I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
- -lfiniteVolume \
- -lmeshTools \
- -lcompressibleRASModels \
-lbasicThermophysicalModels \
- -lspecie
+ -lspecie \
+ -lcompressibleRASModels \
+ -lcompressibleLESModels \
+ -lfiniteVolume \
+ -ldynamicMesh \
+ -lmeshTools
diff --git a/applications/solvers/compressible/sonicFoamAutoMotion/compressibleContinuityErrs.H b/applications/solvers/compressible/sonicDyMFoam/compressibleContinuityErrs.H
similarity index 100%
rename from applications/solvers/compressible/sonicFoamAutoMotion/compressibleContinuityErrs.H
rename to applications/solvers/compressible/sonicDyMFoam/compressibleContinuityErrs.H
diff --git a/applications/solvers/compressible/sonicTurbFoam/createFields.H b/applications/solvers/compressible/sonicDyMFoam/createFields.H
similarity index 89%
rename from applications/solvers/compressible/sonicTurbFoam/createFields.H
rename to applications/solvers/compressible/sonicDyMFoam/createFields.H
index d3cb63d212..eb45a7c23a 100644
--- a/applications/solvers/compressible/sonicTurbFoam/createFields.H
+++ b/applications/solvers/compressible/sonicDyMFoam/createFields.H
@@ -38,9 +38,9 @@
Info<< "Creating turbulence model\n" << endl;
- autoPtr turbulence
+ autoPtr turbulence
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rho,
U,
@@ -50,5 +50,5 @@
);
Info<< "Creating field DpDt\n" << endl;
- volScalarField DpDt =
+ volScalarField DpDt =
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
diff --git a/applications/solvers/compressible/sonicFoamAutoMotion/readThermodynamicProperties.H b/applications/solvers/compressible/sonicDyMFoam/readThermodynamicProperties.H
similarity index 100%
rename from applications/solvers/compressible/sonicFoamAutoMotion/readThermodynamicProperties.H
rename to applications/solvers/compressible/sonicDyMFoam/readThermodynamicProperties.H
diff --git a/applications/solvers/compressible/sonicFoamAutoMotion/readTransportProperties.H b/applications/solvers/compressible/sonicDyMFoam/readTransportProperties.H
similarity index 100%
rename from applications/solvers/compressible/sonicFoamAutoMotion/readTransportProperties.H
rename to applications/solvers/compressible/sonicDyMFoam/readTransportProperties.H
diff --git a/applications/solvers/compressible/sonicFoamAutoMotion/sonicFoamAutoMotion.C b/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C
similarity index 77%
rename from applications/solvers/compressible/sonicFoamAutoMotion/sonicFoamAutoMotion.C
rename to applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C
index 445f88d578..16bf90abd3 100644
--- a/applications/solvers/compressible/sonicFoamAutoMotion/sonicFoamAutoMotion.C
+++ b/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C
@@ -23,31 +23,30 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
- sonicFoamAutoMotion
+ sonicDyMFoam
Description
- Transient solver for trans-sonic/supersonic, laminar flow of a
- compressible gas with mesh motion..
+ Transient solver for trans-sonic/supersonic, laminar or turbulent flow
+ of a compressible gas with mesh motion..
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
+#include "basicThermo.H"
+#include "turbulenceModel.H"
#include "motionSolver.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
+ #include "setRootCase.H"
+ #include "createTime.H"
+ #include "createMesh.H"
+ #include "createFields.H"
+ #include "initContinuityErrs.H"
-# include "setRootCase.H"
-# include "createTime.H"
-# include "createMesh.H"
-# include "readThermodynamicProperties.H"
-# include "readTransportProperties.H"
-# include "createFields.H"
-# include "initContinuityErrs.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@@ -57,34 +56,24 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
-# include "readPISOControls.H"
-# include "compressibleCourantNo.H"
+ #include "readPISOControls.H"
+ #include "compressibleCourantNo.H"
mesh.movePoints(motionPtr->newPoints());
-# include "rhoEqn.H"
+ #include "rhoEqn.H"
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
- - fvm::laplacian(mu, U)
+ + turbulence->divDevRhoReff(U)
);
solve(UEqn == -fvc::grad(p));
- solve
- (
- fvm::ddt(rho, e)
- + fvm::div(phi, e)
- - fvm::laplacian(mu, e)
- ==
- - p*fvc::div(phi/fvc::interpolate(rho) + fvc::meshPhi(rho, U))
- + mu*magSqr(symm(fvc::grad(U)))
- );
+ #include "hEqn.H"
- T = e/Cv;
- psi = 1.0/(R*T);
// --- PISO loop
@@ -115,12 +104,24 @@ int main(int argc, char *argv[])
phi = pEqn.flux();
}
-# include "compressibleContinuityErrs.H"
+ #include "compressibleContinuityErrs.H"
U -= fvc::grad(p)/UEqn.A();
U.correctBoundaryConditions();
}
+ DpDt = fvc::DDt
+ (
+ surfaceScalarField
+ (
+ "phiU",
+ phi/fvc::interpolate(rho) + fvc::meshPhi(rho, U)
+ ),
+ p
+ );
+
+ turbulence->correct();
+
rho = psi*p;
runTime.write();
diff --git a/applications/solvers/compressible/sonicFoam/Make/options b/applications/solvers/compressible/sonicFoam/Make/options
index 725122ea1d..ecfde60eee 100644
--- a/applications/solvers/compressible/sonicFoam/Make/options
+++ b/applications/solvers/compressible/sonicFoam/Make/options
@@ -1,4 +1,12 @@
EXE_INC = \
+ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
-EXE_LIBS = -lfiniteVolume
+EXE_LIBS = \
+ -lbasicThermophysicalModels \
+ -lspecie \
+ -lcompressibleRASModels \
+ -lcompressibleLESModels \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/applications/solvers/compressible/sonicFoam/createFields.H b/applications/solvers/compressible/sonicFoam/createFields.H
index 201b9ea176..eb45a7c23a 100644
--- a/applications/solvers/compressible/sonicFoam/createFields.H
+++ b/applications/solvers/compressible/sonicFoam/createFields.H
@@ -1,49 +1,25 @@
- Info<< "Reading field p\n" << endl;
- volScalarField p
+ Info<< "Reading thermophysical properties\n" << endl;
+
+ autoPtr thermo
+ (
+ basicThermo::New(mesh)
+ );
+
+ volScalarField& p = thermo->p();
+ volScalarField& h = thermo->h();
+ const volScalarField& psi = thermo->psi();
+
+ volScalarField rho
(
IOobject
(
- "p",
+ "rho",
runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
+ mesh
),
- mesh
+ thermo->rho()
);
-
- Info<< "Reading field T\n" << endl;
- volScalarField T
- (
- IOobject
- (
- "T",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-
- Info<< "Calculating field e from T\n" << endl;
- volScalarField e
- (
- IOobject
- (
- "e",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::NO_WRITE
- ),
- Cv*T,
- T.boundaryField().types()
- );
-
-
Info<< "Reading field U\n" << endl;
volVectorField U
(
@@ -58,29 +34,21 @@
mesh
);
- volScalarField psi
- (
- IOobject
- (
- "psi",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::NO_WRITE
- ),
- 1.0/(R*T)
- );
- psi.oldTime();
-
- volScalarField rho
- (
- IOobject
- (
- "rho",
- runTime.timeName(),
- mesh
- ),
- psi*p
- );
-
# include "compressibleCreatePhi.H"
+
+
+ Info<< "Creating turbulence model\n" << endl;
+ autoPtr turbulence
+ (
+ compressible::turbulenceModel::New
+ (
+ rho,
+ U,
+ phi,
+ thermo()
+ )
+ );
+
+ Info<< "Creating field DpDt\n" << endl;
+ volScalarField DpDt =
+ fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
diff --git a/applications/solvers/compressible/sonicTurbFoam/hEqn.H b/applications/solvers/compressible/sonicFoam/hEqn.H
similarity index 100%
rename from applications/solvers/compressible/sonicTurbFoam/hEqn.H
rename to applications/solvers/compressible/sonicFoam/hEqn.H
diff --git a/applications/solvers/compressible/sonicFoam/sonicFoam.C b/applications/solvers/compressible/sonicFoam/sonicFoam.C
index 5abdad2cef..7f607874d7 100644
--- a/applications/solvers/compressible/sonicFoam/sonicFoam.C
+++ b/applications/solvers/compressible/sonicFoam/sonicFoam.C
@@ -26,27 +26,26 @@ Application
sonicFoam
Description
- Transient solver for trans-sonic/supersonic, laminar flow of a
- compressible gas.
+ Transient solver for trans-sonic/supersonic, laminar or turbulent flow
+ of a compressible gas.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
+#include "basicThermo.H"
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
+ #include "setRootCase.H"
+ #include "createTime.H"
+ #include "createMesh.H"
+ #include "createFields.H"
+ #include "initContinuityErrs.H"
-# include "setRootCase.H"
-# include "createTime.H"
-# include "createMesh.H"
-# include "readThermodynamicProperties.H"
-# include "readTransportProperties.H"
-# include "createFields.H"
-# include "initContinuityErrs.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@@ -54,35 +53,25 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
-# include "readPISOControls.H"
-# include "compressibleCourantNo.H"
+ #include "readPISOControls.H"
+ #include "compressibleCourantNo.H"
-# include "rhoEqn.H"
+ #include "rhoEqn.H"
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
- - fvm::laplacian(mu, U)
+ + turbulence->divDevRhoReff(U)
);
solve(UEqn == -fvc::grad(p));
- solve
- (
- fvm::ddt(rho, e)
- + fvm::div(phi, e)
- - fvm::laplacian(mu, e)
- ==
- - p*fvc::div(phi/fvc::interpolate(rho))
- + mu*magSqr(symm(fvc::grad(U)))
- );
-
- T = e/Cv;
- psi = 1.0/(R*T);
+ #include "hEqn.H"
// --- PISO loop
+
for (int corr=0; corrpsi())
*(
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
- )
+ )
);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
@@ -109,15 +98,23 @@ int main(int argc, char *argv[])
pEqn.solve();
- phi = pEqn.flux();
+ if (nonOrth == nNonOrthCorr)
+ {
+ phi = pEqn.flux();
+ }
}
-# include "compressibleContinuityErrs.H"
+ #include "compressibleContinuityErrs.H"
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
}
+ DpDt =
+ fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
+
+ turbulence->correct();
+
rho = psi*p;
runTime.write();
diff --git a/applications/solvers/compressible/sonicFoamAutoMotion/Make/files b/applications/solvers/compressible/sonicFoamAutoMotion/Make/files
deleted file mode 100644
index de9936304d..0000000000
--- a/applications/solvers/compressible/sonicFoamAutoMotion/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-sonicFoamAutoMotion.C
-
-EXE = $(FOAM_APPBIN)/sonicFoamAutoMotion
diff --git a/applications/solvers/compressible/sonicFoamAutoMotion/createFields.H b/applications/solvers/compressible/sonicFoamAutoMotion/createFields.H
deleted file mode 100644
index d50b21d8d2..0000000000
--- a/applications/solvers/compressible/sonicFoamAutoMotion/createFields.H
+++ /dev/null
@@ -1,103 +0,0 @@
- Info<< "Reading field p\n" << endl;
- volScalarField p
- (
- IOobject
- (
- "p",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-
- Info<< "Reading field T\n" << endl;
- volScalarField T
- (
- IOobject
- (
- "T",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-
- Info<< "Calculating field e from T\n" << endl;
- volScalarField e
- (
- IOobject
- (
- "e",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::NO_WRITE
- ),
- Cv*T,
- T.boundaryField().types()
- );
-
-
- Info<< "Reading field U\n" << endl;
- volVectorField U
- (
- IOobject
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-
- volScalarField psi
- (
- IOobject
- (
- "psi",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::NO_WRITE
- ),
- 1.0/(R*T)
- );
- psi.oldTime();
-
- volScalarField rho
- (
- IOobject
- (
- "rho",
- runTime.timeName(),
- mesh
- ),
- psi*p
- );
-
-# include "compressibleCreatePhi.H"
-
-
- Info<< "Creating field phid\n" << endl;
- surfaceScalarField phid
- (
- IOobject
- (
- "phid",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::NO_WRITE
- ),
- phi/fvc::interpolate(p),
- phi.boundaryField().types()
- );
diff --git a/applications/solvers/compressible/sonicTurbFoam/Make/files b/applications/solvers/compressible/sonicTurbFoam/Make/files
deleted file mode 100644
index b4639b1934..0000000000
--- a/applications/solvers/compressible/sonicTurbFoam/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-sonicTurbFoam.C
-
-EXE = $(FOAM_APPBIN)/sonicTurbFoam
diff --git a/applications/solvers/compressible/sonicTurbFoam/sonicTurbFoam.C b/applications/solvers/compressible/sonicTurbFoam/sonicTurbFoam.C
deleted file mode 100644
index 321295a79f..0000000000
--- a/applications/solvers/compressible/sonicTurbFoam/sonicTurbFoam.C
+++ /dev/null
@@ -1,135 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2008 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
- sonicFoam
-
-Description
- Transient solver for trans-sonic/supersonic, turbulent flow of a
- compressible gas.
-
-\*---------------------------------------------------------------------------*/
-
-#include "fvCFD.H"
-#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-int main(int argc, char *argv[])
-{
-
-# include "setRootCase.H"
-# include "createTime.H"
-# include "createMesh.H"
-# include "createFields.H"
-# include "initContinuityErrs.H"
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
- Info<< "\nStarting time loop\n" << endl;
-
- for (runTime++; !runTime.end(); runTime++)
- {
- Info<< "Time = " << runTime.timeName() << nl << endl;
-
-# include "readPISOControls.H"
-# include "compressibleCourantNo.H"
-
-# include "rhoEqn.H"
-
- fvVectorMatrix UEqn
- (
- fvm::ddt(rho, U)
- + fvm::div(phi, U)
- + turbulence->divDevRhoReff(U)
- );
-
- solve(UEqn == -fvc::grad(p));
-
-# include "hEqn.H"
-
-
- // --- PISO loop
-
- for (int corr=0; corrpsi())
- *(
- (fvc::interpolate(U) & mesh.Sf())
- + fvc::ddtPhiCorr(rUA, rho, U, phi)
- )
- );
-
- for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
- {
- fvScalarMatrix pEqn
- (
- fvm::ddt(psi, p)
- + fvm::div(phid, p)
- - fvm::laplacian(rho*rUA, p)
- );
-
- pEqn.solve();
-
- if (nonOrth == nNonOrthCorr)
- {
- phi = pEqn.flux();
- }
- }
-
-# include "compressibleContinuityErrs.H"
-
- U -= rUA*fvc::grad(p);
- U.correctBoundaryConditions();
- }
-
- DpDt =
- fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
-
- turbulence->correct();
-
- rho = psi*p;
-
- runTime.write();
-
- Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
- << " ClockTime = " << runTime.elapsedClockTime() << " s"
- << nl << endl;
- }
-
- Info<< "End\n" << endl;
-
- return(0);
-}
-
-
-// ************************************************************************* //
diff --git a/applications/solvers/heatTransfer/buoyantFoam/Make/options b/applications/solvers/heatTransfer/buoyantFoam/Make/options
index f0695e5ccb..9ac482d92e 100644
--- a/applications/solvers/heatTransfer/buoyantFoam/Make/options
+++ b/applications/solvers/heatTransfer/buoyantFoam/Make/options
@@ -1,12 +1,13 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I../XiFoam
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
+ -I../XiFoam \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
- -lfiniteVolume \
-lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
- -lcompressibleRASModels
+ -lcompressibleRASModels \
+ -lcompressibleLESModels \
+ -lfiniteVolume
diff --git a/applications/solvers/heatTransfer/buoyantFoam/buoyantFoam.C b/applications/solvers/heatTransfer/buoyantFoam/buoyantFoam.C
index 0221283bb1..b284e7d25c 100644
--- a/applications/solvers/heatTransfer/buoyantFoam/buoyantFoam.C
+++ b/applications/solvers/heatTransfer/buoyantFoam/buoyantFoam.C
@@ -34,7 +34,7 @@ Description
#include "fvCFD.H"
#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
+#include "turbulenceModel.H"
#include "fixedGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/solvers/heatTransfer/buoyantFoam/createFields.H b/applications/solvers/heatTransfer/buoyantFoam/createFields.H
index 0a5a098d9f..3d604d4daf 100644
--- a/applications/solvers/heatTransfer/buoyantFoam/createFields.H
+++ b/applications/solvers/heatTransfer/buoyantFoam/createFields.H
@@ -41,9 +41,9 @@
Info<< "Creating turbulence model\n" << endl;
- autoPtr turbulence
+ autoPtr turbulence
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rho,
U,
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options
index c33e5a1da8..ec604cf28c 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options
@@ -1,12 +1,13 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/cfdTools \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
+ -I$(LIB_SRC)/finiteVolume/cfdTools \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
- -lfiniteVolume \
-lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
- -lcompressibleRASModels
+ -lcompressibleRASModels \
+ -lfiniteVolume
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C
index 3beb759bd7..77ca411389 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C
@@ -32,7 +32,7 @@ Description
#include "fvCFD.H"
#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
+#include "RASModel.H"
#include "fixedGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options
index 9f865bc1b7..22d41fdb80 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options
+++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options
@@ -1,14 +1,16 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/cfdTools \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels/RAS \
+ -I$(LIB_SRC)/finiteVolume/cfdTools \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
- -lfiniteVolume \
- -lmeshTools \
-lbasicThermophysicalModels \
-lspecie \
-lradiation \
- -lcompressibleRASModels
+ -lcompressibleRASModels \
+ -lfiniteVolume \
+ -lmeshTools
diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
index 4bb432d53e..1835801e7b 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
+++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
@@ -33,7 +33,7 @@ Description
#include "fvCFD.H"
#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
+#include "RASModel.H"
#include "fixedGradientFvPatchFields.H"
#include "radiationModel.H"
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options
index 5bcd3c4ef6..a8797ca456 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options
@@ -7,10 +7,11 @@ EXE_INC = \
-IderivedFvPatchFields/solidWallHeatFluxTemperatureCoupled \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS
+ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel
EXE_LIBS = \
- -lfiniteVolume \
-lbasicThermophysicalModels \
-lspecie \
- -lcompressibleRASModels
+ -lcompressibleRASModels \
+ -lcompressibleLESModels \
+ -lfiniteVolume
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C
index a2b7e10c78..b34e28b38d 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C
@@ -33,7 +33,7 @@ Description
#include "fvCFD.H"
#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
+#include "turbulenceModel.H"
#include "fixedGradientFvPatchFields.H"
#include "regionProperties.H"
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H
index 39367bb6bf..907a4b8352 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H
@@ -4,7 +4,7 @@
PtrList Kf(fluidRegions.size());
PtrList Uf(fluidRegions.size());
PtrList phif(fluidRegions.size());
- PtrList turb(fluidRegions.size());
+ PtrList turb(fluidRegions.size());
PtrList DpDtf(fluidRegions.size());
PtrList ghf(fluidRegions.size());
PtrList pdf(fluidRegions.size());
@@ -127,9 +127,9 @@
turb.set
(
i,
- autoPtr
+ autoPtr
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rhof[i],
Uf[i],
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveEnthalpyEquation.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveEnthalpyEquation.C
index 961be839d6..9c5a7576ef 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveEnthalpyEquation.C
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveEnthalpyEquation.C
@@ -32,7 +32,7 @@ void solveEnthalpyEquation
const volScalarField& rho,
const volScalarField& DpDt,
const surfaceScalarField& phi,
- const compressible::RASModel& turb,
+ const compressible::turbulenceModel& turb,
basicThermo& thermo
)
{
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveMomentumEquation.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveMomentumEquation.C
index 1b5bd29835..6fedd084ad 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveMomentumEquation.C
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveMomentumEquation.C
@@ -35,7 +35,7 @@ tmp solveMomentumEquation
const surfaceScalarField& phi,
const volScalarField& pd,
const volScalarField& gh,
- const compressible::RASModel& turb
+ const compressible::turbulenceModel& turb
)
{
// Solve the Momentum equation
diff --git a/applications/solvers/heatTransfer/lesBuoyantFoam/Make/files b/applications/solvers/heatTransfer/lesBuoyantFoam/Make/files
deleted file mode 100644
index f0603c064e..0000000000
--- a/applications/solvers/heatTransfer/lesBuoyantFoam/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-lesBuoyantFoam.C
-
-EXE = $(FOAM_APPBIN)/lesBuoyantFoam
diff --git a/applications/solvers/heatTransfer/lesBuoyantFoam/Make/options b/applications/solvers/heatTransfer/lesBuoyantFoam/Make/options
deleted file mode 100644
index 61a142792d..0000000000
--- a/applications/solvers/heatTransfer/lesBuoyantFoam/Make/options
+++ /dev/null
@@ -1,13 +0,0 @@
-EXE_INC = \
- -I../buoyantFoam \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/LES \
- -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude
-
-EXE_LIBS = \
- -lfiniteVolume \
- -lmeshTools \
- -lbasicThermophysicalModels \
- -lspecie \
- -lcompressibleLESModels
diff --git a/applications/solvers/heatTransfer/lesBuoyantFoam/createFields.H b/applications/solvers/heatTransfer/lesBuoyantFoam/createFields.H
deleted file mode 100644
index 7b63660f7e..0000000000
--- a/applications/solvers/heatTransfer/lesBuoyantFoam/createFields.H
+++ /dev/null
@@ -1,75 +0,0 @@
- Info<< "Reading thermophysical properties\n" << endl;
-
- autoPtr thermo
- (
- basicThermo::New(mesh)
- );
-
- volScalarField rho
- (
- IOobject
- (
- "rho",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::NO_WRITE
- ),
- thermo->rho()
- );
-
- volScalarField& p = thermo->p();
- volScalarField& h = thermo->h();
- const volScalarField& psi = thermo->psi();
-
-
- Info<< "Reading field U\n" << endl;
- volVectorField U
- (
- IOobject
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
- #include "compressibleCreatePhi.H"
-
-
- Info<< "Creating turbulence model\n" << endl;
- autoPtr turbulence
- (
- compressible::LESModel::New(rho, U, phi, thermo())
- );
-
-
- Info<< "Creating field dpdt\n" << endl;
- volScalarField dpdt = fvc::ddt(p);
-
- Info<< "Calculating field g.h\n" << endl;
- volScalarField gh("gh", g & mesh.C());
-
- dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
-
- Info<< "Creating field pd\n" << endl;
- volScalarField pd
- (
- IOobject
- (
- "pd",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
- p = pd + rho*gh + pRef;
- thermo->correct();
-
- dimensionedScalar initialMass = fvc::domainIntegrate(rho);
diff --git a/applications/solvers/heatTransfer/lesBuoyantFoam/lesBuoyantFoam.C b/applications/solvers/heatTransfer/lesBuoyantFoam/lesBuoyantFoam.C
deleted file mode 100644
index ba0e6349d5..0000000000
--- a/applications/solvers/heatTransfer/lesBuoyantFoam/lesBuoyantFoam.C
+++ /dev/null
@@ -1,96 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2008 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
- lesBuoyantFoam
-
-Description
- Transient Solver for buoyant, turbulent flow of compressible fluids for
- ventilation and heat-transfer. Turbulence is modelled using a run-time
- selectable compressible LES model.
-
-\*---------------------------------------------------------------------------*/
-
-#include "fvCFD.H"
-#include "basicThermo.H"
-#include "compressible/LESModel/LESModel.H"
-
-#define divDevRhoReff divDevRhoBeff
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-int main(int argc, char *argv[])
-{
-
-# include "setRootCase.H"
-# include "createTime.H"
-# include "createMesh.H"
-# include "readEnvironmentalProperties.H"
-# include "initContinuityErrs.H"
-# include "createFields.H"
-# include "readTimeControls.H"
-# include "compressibleCourantNo.H"
-# include "setInitialDeltaT.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
- Info<< "\nStarting time loop\n" << endl;
-
- while (runTime.run())
- {
-# include "readPISOControls.H"
-# include "readTimeControls.H"
-# include "compressibleCourantNo.H"
-# include "setDeltaT.H"
-
- runTime++;
- Info<< "Time = " << runTime.timeName() << nl << endl;
-
-# include "rhoEqn.H"
-
- turbulence->correct();
-
-# include "UEqn.H"
-# include "hEqn.H"
-
- // --- PISO loop
- for (int corr=0; corrcorrect();
-
- fvVectorMatrix UEqn
- (
- fvm::ddt(U)
- + fvm::div(phi, U)
- + sgsModel->divDevBeff(U)
- );
-
- // Optionally ensure diagonal-dominance of the momentum matrix
- UEqn.relax();
-
- if (momentumPredictor)
- {
- solve(UEqn == -fvc::grad(p));
- }
-
- // --- PISO loop
- for (int corr=0; corr turbulence
+ autoPtr turbulence
(
- incompressible::RASModel::New(U, phi, laminarTransport)
+ incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
Info<< "Reading field rAU if present\n" << endl;
diff --git a/applications/solvers/incompressible/icoDyMFoam/icoDyMFoam.C b/applications/solvers/incompressible/pimpleDyMFoam/pimpleDyMFoam.C
similarity index 87%
rename from applications/solvers/incompressible/icoDyMFoam/icoDyMFoam.C
rename to applications/solvers/incompressible/pimpleDyMFoam/pimpleDyMFoam.C
index f34843f1ba..42aae85309 100644
--- a/applications/solvers/incompressible/icoDyMFoam/icoDyMFoam.C
+++ b/applications/solvers/incompressible/pimpleDyMFoam/pimpleDyMFoam.C
@@ -23,15 +23,19 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
- icoDyMFoam
+ turbDyMFoam
Description
- Transient solver for incompressible, laminar flow of Newtonian fluids
- with moving mesh.
+ Transient solver for incompressible, flow of Newtonian fluids
+ on a moving mesh using the PIMPLE (merged PISO-SIMPLE) algorithm.
+
+ Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
+#include "singlePhaseTransportModel.H"
+#include "turbulenceModel.H"
#include "dynamicFvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -84,7 +88,10 @@ int main(int argc, char *argv[])
// --- PIMPLE loop
for (int ocorr=0; ocorrcorrect();
+
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
diff --git a/applications/solvers/incompressible/icoDyMFoam/readControls.H b/applications/solvers/incompressible/pimpleDyMFoam/readControls.H
similarity index 100%
rename from applications/solvers/incompressible/icoDyMFoam/readControls.H
rename to applications/solvers/incompressible/pimpleDyMFoam/readControls.H
diff --git a/applications/solvers/incompressible/pimpleFoam/Make/options b/applications/solvers/incompressible/pimpleFoam/Make/options
index 8a31f7e5ab..d0e8dd740d 100644
--- a/applications/solvers/incompressible/pimpleFoam/Make/options
+++ b/applications/solvers/incompressible/pimpleFoam/Make/options
@@ -1,10 +1,12 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I$(LIB_SRC)/transportModels
+ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
+ -I$(LIB_SRC)/transportModels \
+ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
- -lincompressibleRASModels \
-lincompressibleTransportModels \
+ -lincompressibleRASModels \
+ -lincompressibleLESModels \
-lfiniteVolume \
-lmeshTools
diff --git a/applications/solvers/incompressible/pimpleFoam/createFields.H b/applications/solvers/incompressible/pimpleFoam/createFields.H
index d334e4a31f..e4127150c0 100644
--- a/applications/solvers/incompressible/pimpleFoam/createFields.H
+++ b/applications/solvers/incompressible/pimpleFoam/createFields.H
@@ -36,7 +36,7 @@ setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
singlePhaseTransportModel laminarTransport(U, phi);
-autoPtr turbulence
+autoPtr turbulence
(
- incompressible::RASModel::New(U, phi, laminarTransport)
+ incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C
index f3c1614239..bcc60b7b5e 100644
--- a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C
+++ b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C
@@ -26,14 +26,16 @@ Application
pimpleFoam
Description
- Large time-step transient solver for incompressible, turbulent flow using
- the PIMPLE (merged PISO-SIMPLE) algorithm.
+ Large time-step transient solver for incompressible, flow using the PIMPLE
+ (merged PISO-SIMPLE) algorithm.
+
+ Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
-#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-#include "incompressible/RASModel/RASModel.H"
+#include "singlePhaseTransportModel.H"
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -58,14 +60,14 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
- if (nOuterCorr != 1)
- {
- p.storePrevIter();
- }
-
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr sgsModel
+ autoPtr turbulence
(
- incompressible::LESModel::New(U, phi, laminarTransport)
+ incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
diff --git a/applications/solvers/incompressible/turbFoam/turbFoam.C b/applications/solvers/incompressible/pisoFoam/pisoFoam.C
similarity index 93%
rename from applications/solvers/incompressible/turbFoam/turbFoam.C
rename to applications/solvers/incompressible/pisoFoam/pisoFoam.C
index d32ee3be69..1c8a534db2 100644
--- a/applications/solvers/incompressible/turbFoam/turbFoam.C
+++ b/applications/solvers/incompressible/pisoFoam/pisoFoam.C
@@ -26,13 +26,15 @@ Application
turbFoam
Description
- Transient solver for incompressible, turbulent flow.
+ Transient solver for incompressible flow.
+
+ Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
-#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-#include "incompressible/RASModel/RASModel.H"
+#include "singlePhaseTransportModel.H"
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -80,7 +82,7 @@ int main(int argc, char *argv[])
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();
- phi = (fvc::interpolate(U) & mesh.Sf())
+ phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);
adjustPhi(phi, U, p);
diff --git a/applications/solvers/incompressible/simpleFoam/Make/options b/applications/solvers/incompressible/simpleFoam/Make/options
index 8a31f7e5ab..61091811bf 100644
--- a/applications/solvers/incompressible/simpleFoam/Make/options
+++ b/applications/solvers/incompressible/simpleFoam/Make/options
@@ -1,7 +1,9 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I$(LIB_SRC)/transportModels
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
+ -I$(LIB_SRC)/transportModels \
+ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lincompressibleRASModels \
diff --git a/applications/solvers/incompressible/simpleFoam/simpleFoam.C b/applications/solvers/incompressible/simpleFoam/simpleFoam.C
index 7c378fe8ff..4a0c5c4bd4 100644
--- a/applications/solvers/incompressible/simpleFoam/simpleFoam.C
+++ b/applications/solvers/incompressible/simpleFoam/simpleFoam.C
@@ -31,8 +31,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
-#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-#include "incompressible/RASModel/RASModel.H"
+#include "singlePhaseTransportModel.H"
+#include "RASModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/solvers/incompressible/turbDyMFoam/Make/files b/applications/solvers/incompressible/turbDyMFoam/Make/files
deleted file mode 100644
index 5297b027d0..0000000000
--- a/applications/solvers/incompressible/turbDyMFoam/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-turbDyMFoam.C
-
-EXE = $(FOAM_APPBIN)/turbDyMFoam
diff --git a/applications/solvers/incompressible/turbDyMFoam/correctPhi.H b/applications/solvers/incompressible/turbDyMFoam/correctPhi.H
deleted file mode 100644
index 493c4e0929..0000000000
--- a/applications/solvers/incompressible/turbDyMFoam/correctPhi.H
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- wordList pcorrTypes(p.boundaryField().types());
-
- for (label i=0; icorrect();
-
- runTime.write();
-
- Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
- << " ClockTime = " << runTime.elapsedClockTime() << " s"
- << nl << endl;
- }
-
- Info<< "End\n" << endl;
-
- return(0);
-}
-
-
-// ************************************************************************* //
diff --git a/applications/solvers/incompressible/turbFoam/Make/files b/applications/solvers/incompressible/turbFoam/Make/files
deleted file mode 100644
index c3d6346165..0000000000
--- a/applications/solvers/incompressible/turbFoam/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-turbFoam.C
-
-EXE = $(FOAM_APPBIN)/turbFoam
diff --git a/applications/solvers/incompressible/turbFoam/createFields.H b/applications/solvers/incompressible/turbFoam/createFields.H
deleted file mode 100644
index 8bcbfe7a75..0000000000
--- a/applications/solvers/incompressible/turbFoam/createFields.H
+++ /dev/null
@@ -1,42 +0,0 @@
- Info<< "Reading field p\n" << endl;
- volScalarField p
- (
- IOobject
- (
- "p",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
- Info<< "Reading field U\n" << endl;
- volVectorField U
- (
- IOobject
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-# include "createPhi.H"
-
-
- label pRefCell = 0;
- scalar pRefValue = 0.0;
- setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
-
-
- singlePhaseTransportModel laminarTransport(U, phi);
-
- autoPtr turbulence
- (
- incompressible::RASModel::New(U, phi, laminarTransport)
- );
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/CourantNo.H b/applications/solvers/multiphase/cavitatingFoam/CourantNo.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/CourantNo.H
rename to applications/solvers/multiphase/cavitatingFoam/CourantNo.H
diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/files b/applications/solvers/multiphase/cavitatingFoam/Make/files
new file mode 100644
index 0000000000..832391f03f
--- /dev/null
+++ b/applications/solvers/multiphase/cavitatingFoam/Make/files
@@ -0,0 +1,3 @@
+cavitatingFoam.C
+
+EXE = $(FOAM_APPBIN)/cavitatingFoam
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options
similarity index 81%
rename from applications/solvers/multiphase/rasCavitatingFoam/Make/options
rename to applications/solvers/multiphase/cavitatingFoam/Make/options
index a694ac2179..9cb749d63c 100644
--- a/applications/solvers/multiphase/rasCavitatingFoam/Make/options
+++ b/applications/solvers/multiphase/cavitatingFoam/Make/options
@@ -3,12 +3,12 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude
EXE_LIBS = \
-lincompressibleTransportModels \
-lincompressibleRASModels \
+ -lincompressibleLESModels \
-lfiniteVolume \
-lbarotropicCompressibilityModel
-
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/UEqn.H b/applications/solvers/multiphase/cavitatingFoam/UEqn.H
similarity index 95%
rename from applications/solvers/multiphase/rasCavitatingFoam/UEqn.H
rename to applications/solvers/multiphase/cavitatingFoam/UEqn.H
index 374e410c2e..11eaf617bc 100644
--- a/applications/solvers/multiphase/rasCavitatingFoam/UEqn.H
+++ b/applications/solvers/multiphase/cavitatingFoam/UEqn.H
@@ -14,6 +14,8 @@
- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
);
+ UEqn.relax();
+
if (momentumPredictor)
{
solve(UEqn == -fvc::grad(p));
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/lesCavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C
similarity index 93%
rename from applications/solvers/multiphase/lesCavitatingFoam/lesCavitatingFoam.C
rename to applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C
index 2ad2dfb04f..36ced22ada 100644
--- a/applications/solvers/multiphase/lesCavitatingFoam/lesCavitatingFoam.C
+++ b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C
@@ -23,17 +23,19 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
- lesCavitatingFoam
+ cavitatingFoam
Description
- Transient cavitation code with LES turbulence.
+ Transient cavitation code based on the barotropic equation of state.
+
+ Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "barotropicCompressibilityModel.H"
#include "twoPhaseMixture.H"
-#include "incompressible/LESModel/LESModel.H"
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -64,8 +66,6 @@ int main(int argc, char *argv[])
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
- turbulence->correct();
-
for (int outerCorr=0; outerCorrcorrect();
+
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/continuityErrs.H b/applications/solvers/multiphase/cavitatingFoam/continuityErrs.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/continuityErrs.H
rename to applications/solvers/multiphase/cavitatingFoam/continuityErrs.H
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/createFields.H b/applications/solvers/multiphase/cavitatingFoam/createFields.H
similarity index 90%
rename from applications/solvers/multiphase/rasCavitatingFoam/createFields.H
rename to applications/solvers/multiphase/cavitatingFoam/createFields.H
index 37ff01d41f..dc2f5e6961 100644
--- a/applications/solvers/multiphase/rasCavitatingFoam/createFields.H
+++ b/applications/solvers/multiphase/cavitatingFoam/createFields.H
@@ -78,8 +78,8 @@
twoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
- // Create RAS turbulence model
- autoPtr turbulence
+ // Create incompressible turbulence model
+ autoPtr turbulence
(
- incompressible::RASModel::New(U, phiv, twoPhaseProperties)
+ incompressible::turbulenceModel::New(U, phiv, twoPhaseProperties)
);
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/gammaPsi.H b/applications/solvers/multiphase/cavitatingFoam/gammaPsi.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/gammaPsi.H
rename to applications/solvers/multiphase/cavitatingFoam/gammaPsi.H
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/pEqn.H b/applications/solvers/multiphase/cavitatingFoam/pEqn.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/pEqn.H
rename to applications/solvers/multiphase/cavitatingFoam/pEqn.H
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/readControls.H b/applications/solvers/multiphase/cavitatingFoam/readControls.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/readControls.H
rename to applications/solvers/multiphase/cavitatingFoam/readControls.H
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/readThermodynamicProperties.H b/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/readThermodynamicProperties.H
rename to applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/resetPhiPatches.H b/applications/solvers/multiphase/cavitatingFoam/resetPhiPatches.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/resetPhiPatches.H
rename to applications/solvers/multiphase/cavitatingFoam/resetPhiPatches.H
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/resetPhivPatches.H b/applications/solvers/multiphase/cavitatingFoam/resetPhivPatches.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/resetPhivPatches.H
rename to applications/solvers/multiphase/cavitatingFoam/resetPhivPatches.H
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/rhoEqn.H b/applications/solvers/multiphase/cavitatingFoam/rhoEqn.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/rhoEqn.H
rename to applications/solvers/multiphase/cavitatingFoam/rhoEqn.H
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/setDeltaT.H b/applications/solvers/multiphase/cavitatingFoam/setDeltaT.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/setDeltaT.H
rename to applications/solvers/multiphase/cavitatingFoam/setDeltaT.H
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/setInitialDeltaT.H b/applications/solvers/multiphase/cavitatingFoam/setInitialDeltaT.H
similarity index 100%
rename from applications/solvers/multiphase/lesCavitatingFoam/setInitialDeltaT.H
rename to applications/solvers/multiphase/cavitatingFoam/setInitialDeltaT.H
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/files b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/files
new file mode 100644
index 0000000000..121264b1a9
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/files
@@ -0,0 +1,3 @@
+compressibleInterDyMFoam.C
+
+EXE = $(FOAM_APPBIN)/compressibleInterDyMFoam
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options
new file mode 100644
index 0000000000..13d31339e4
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options
@@ -0,0 +1,22 @@
+INTERFOAM = $(FOAM_SOLVERS)/multiphase/interFoam
+
+EXE_INC = \
+ -I$(LIB_SRC)/transportModels \
+ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
+ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
+ -I$(LIB_SRC)/dynamicMesh/lnInclude \
+ -I$(LIB_SRC)/meshTools/lnInclude \
+ -I$(LIB_SRC)/dynamicFvMesh/lnInclude
+
+EXE_LIBS = \
+ -linterfaceProperties \
+ -lincompressibleTransportModels \
+ -lincompressibleRASModels \
+ -lincompressibleLESModels \
+ -lfiniteVolume \
+ -ldynamicMesh \
+ -lmeshTools \
+ -ldynamicFvMesh
+
diff --git a/applications/solvers/multiphase/compressibleLesInterFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H
similarity index 90%
rename from applications/solvers/multiphase/compressibleLesInterFoam/UEqn.H
rename to applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H
index 0895917367..90033f9826 100644
--- a/applications/solvers/multiphase/compressibleLesInterFoam/UEqn.H
+++ b/applications/solvers/multiphase/compressibleInterDyMFoam/UEqn.H
@@ -1,6 +1,6 @@
surfaceScalarField muf =
twoPhaseProperties.muf()
- + fvc::interpolate(rho*turbulence->nuSgs());
+ + fvc::interpolate(rho*turbulence->nut());
fvVectorMatrix UEqn
(
@@ -11,6 +11,8 @@
//- fvc::div(muf*(mesh.Sf() & fvc::interpolate(fvc::grad(U)().T())))
);
+ UEqn.relax();
+
if (momentumPredictor)
{
solve
diff --git a/applications/solvers/multiphase/compressibleLesInterFoam/alphaEqns.H b/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqns.H
similarity index 100%
rename from applications/solvers/multiphase/compressibleLesInterFoam/alphaEqns.H
rename to applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqns.H
diff --git a/applications/solvers/multiphase/compressibleLesInterFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H
similarity index 94%
rename from applications/solvers/multiphase/compressibleLesInterFoam/alphaEqnsSubCycle.H
rename to applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H
index c52dce9690..e161a3cbe6 100644
--- a/applications/solvers/multiphase/compressibleLesInterFoam/alphaEqnsSubCycle.H
+++ b/applications/solvers/multiphase/compressibleInterDyMFoam/alphaEqnsSubCycle.H
@@ -10,7 +10,7 @@
);
surfaceScalarField phic = mag(phi/mesh.magSf());
- phic = min(interface.cGamma()*phic, max(phic));
+ phic = min(interface.cAlpha()*phic, max(phic));
volScalarField divU = fvc::div(phi);
diff --git a/applications/solvers/multiphase/rasInterFoam/rasInterFoam.C b/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C
similarity index 57%
rename from applications/solvers/multiphase/rasInterFoam/rasInterFoam.C
rename to applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C
index 33e85efd4b..11a1809575 100644
--- a/applications/solvers/multiphase/rasInterFoam/rasInterFoam.C
+++ b/applications/solvers/multiphase/compressibleInterDyMFoam/compressibleInterDyMFoam.C
@@ -23,23 +23,25 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
- rasInterFoam
+ compressibleLesInterFoam
Description
- Solver for 2 incompressible, 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.
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 RAS model.
+ momentum equation is solved.
+
+ Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
+#include "dynamicFvMesh.H"
#include "MULES.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
-#include "incompressible/RASModel/RASModel.H"
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -47,52 +49,84 @@ int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
- #include "createMesh.H"
+ #include "createDynamicFvMesh.H"
#include "readEnvironmentalProperties.H"
- #include "readPISOControls.H"
+ #include "readControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
- #include "readTimeControls.H"
- #include "correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
- #include "readPISOControls.H"
- #include "readTimeControls.H"
+ #include "readControls.H"
#include "CourantNo.H"
+
+ // Make the fluxes absolute
+ fvc::makeAbsolute(phi, U);
+
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
- #include "gammaEqnSubCycle.H"
+ scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
- #include "UEqn.H"
+ // Do any mesh changes
+ mesh.update();
- // --- PISO loop
- for (int corr=0; corr < nCorr; corr++)
+ if (mesh.changing())
{
- #include "pEqn.H"
+ Info<< "Execution time for mesh.update() = "
+ << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
+ << " s" << endl;
+
+ gh = g & mesh.C();
+ ghf = g & mesh.Cf();
}
- #include "continuityErrs.H"
+ if (mesh.changing() && correctPhi)
+ {
+ //***HGW#include "correctPhi.H"
+ }
- p = pd + rho*gh;
+ // Make the fluxes relative to the mesh motion
+ fvc::makeRelative(phi, U);
+
+ if (mesh.changing() && checkMeshCourantNo)
+ {
+ #include "meshCourantNo.H"
+ }
turbulence->correct();
+ // --- Outer-corrector loop
+ for (int oCorr=0; oCorr turbulence
+ // Construct incompressible turbulence model
+ autoPtr turbulence
(
- incompressible::LESModel::New(U, phi, twoPhaseProperties)
+ incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
);
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H
new file mode 100644
index 0000000000..013d8eb05f
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterDyMFoam/pEqn.H
@@ -0,0 +1,77 @@
+{
+ volScalarField rUA = 1.0/UEqn.A();
+ surfaceScalarField rUAf = fvc::interpolate(rUA);
+
+ tmp pdEqnComp;
+
+ if (transonic)
+ {
+ pdEqnComp =
+ (fvm::ddt(pd) + fvm::div(phi, pd) - fvm::Sp(fvc::div(phi), pd));
+ }
+ else
+ {
+ pdEqnComp =
+ (fvm::ddt(pd) + fvc::div(phi, pd) - fvc::Sp(fvc::div(phi), pd));
+ }
+
+
+ U = rUA*UEqn.H();
+
+ surfaceScalarField phiU
+ (
+ "phiU",
+ (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi)
+ );
+
+ phi = phiU +
+ (
+ fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
+ - ghf*fvc::snGrad(rho)
+ )*rUAf*mesh.magSf();
+
+ for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
+ {
+ fvScalarMatrix pdEqnIncomp
+ (
+ fvc::div(phi)
+ - fvm::laplacian(rUAf, pd)
+ );
+
+ solve
+ (
+ (
+ max(alpha1, scalar(0))*(psi1/rho1)
+ + max(alpha2, scalar(0))*(psi2/rho2)
+ )
+ *pdEqnComp()
+ + pdEqnIncomp
+ );
+
+ if (nonOrth == nNonOrthCorr)
+ {
+ dgdt =
+ (pos(alpha2)*(psi2/rho2) - pos(alpha1)*(psi1/rho1))
+ *(pdEqnComp & pd);
+ phi += pdEqnIncomp.flux();
+ }
+ }
+
+ U += rUA*fvc::reconstruct((phi - phiU)/rUAf);
+ U.correctBoundaryConditions();
+
+ p = max
+ (
+ (pd + gh*(alpha1*rho10 + alpha2*rho20))/(1.0 - gh*(alpha1*psi1 + alpha2*psi2)),
+ pMin
+ );
+
+ rho1 = rho10 + psi1*p;
+ rho2 = rho20 + psi2*p;
+
+ Info<< "max(U) " << max(mag(U)).value() << endl;
+ Info<< "min(pd) " << min(pd).value() << endl;
+
+ // Make the fluxes relative to the mesh motion
+ fvc::makeRelative(phi, U);
+}
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H b/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H
new file mode 100644
index 0000000000..a2e4ef3747
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H
@@ -0,0 +1,32 @@
+ #include "readPISOControls.H"
+ #include "readTimeControls.H"
+
+ label nAlphaCorr
+ (
+ readLabel(piso.lookup("nAlphaCorr"))
+ );
+
+ label nAlphaSubCycles
+ (
+ readLabel(piso.lookup("nAlphaSubCycles"))
+ );
+
+ if (nAlphaSubCycles > 1 && nOuterCorr != 1)
+ {
+ FatalErrorIn(args.executable())
+ << "Sub-cycling alpha is only allowed for PISO, "
+ "i.e. when the number of outer-correctors = 1"
+ << exit(FatalError);
+ }
+
+ bool correctPhi = true;
+ if (piso.found("correctPhi"))
+ {
+ correctPhi = Switch(piso.lookup("correctPhi"));
+ }
+
+ bool checkMeshCourantNo = false;
+ if (piso.found("checkMeshCourantNo"))
+ {
+ checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
+ }
diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/files b/applications/solvers/multiphase/compressibleInterFoam/Make/files
new file mode 100644
index 0000000000..de5437219c
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterFoam/Make/files
@@ -0,0 +1,3 @@
+compressibleInterFoam.C
+
+EXE = $(FOAM_APPBIN)/compressibleInterFoam
diff --git a/applications/solvers/multiphase/compressibleLesInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options
similarity index 79%
rename from applications/solvers/multiphase/compressibleLesInterFoam/Make/options
rename to applications/solvers/multiphase/compressibleInterFoam/Make/options
index 45e4e10f67..9412e3e374 100644
--- a/applications/solvers/multiphase/compressibleLesInterFoam/Make/options
+++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options
@@ -4,12 +4,12 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/LES \
- -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
+ -lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume
diff --git a/applications/solvers/multiphase/rasInterFoam/UEqn.H b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H
similarity index 95%
rename from applications/solvers/multiphase/rasInterFoam/UEqn.H
rename to applications/solvers/multiphase/compressibleInterFoam/UEqn.H
index c627f04d17..528e0aaafd 100644
--- a/applications/solvers/multiphase/rasInterFoam/UEqn.H
+++ b/applications/solvers/multiphase/compressibleInterFoam/UEqn.H
@@ -14,6 +14,8 @@
//- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
);
+ UEqn.relax();
+
if (momentumPredictor)
{
solve
@@ -23,7 +25,7 @@
fvc::reconstruct
(
(
- fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
+ fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
- fvc::snGrad(pd)
) * mesh.magSf()
diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H
new file mode 100644
index 0000000000..819cd0f538
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqns.H
@@ -0,0 +1,76 @@
+{
+ word alphaScheme("div(phi,alpha)");
+ word alpharScheme("div(phirb,alpha)");
+
+ surfaceScalarField phir = phic*interface.nHatf();
+
+ for (int gCorr=0; gCorr 0.0 && alpha1[celli] > 0.0)
+ {
+ Sp[celli] -= dgdt[celli]*alpha1[celli];
+ Su[celli] += dgdt[celli]*alpha1[celli];
+ }
+ else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0)
+ {
+ Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]);
+ }
+ }
+
+
+ surfaceScalarField phiAlpha1 =
+ fvc::flux
+ (
+ phi,
+ alpha1,
+ alphaScheme
+ )
+ + fvc::flux
+ (
+ -fvc::flux(-phir, alpha2, alpharScheme),
+ alpha1,
+ alpharScheme
+ );
+
+ MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha1, Sp, Su, 1, 0);
+
+ surfaceScalarField rho1f = fvc::interpolate(rho1);
+ surfaceScalarField rho2f = fvc::interpolate(rho2);
+ rhoPhi = phiAlpha1*(rho1f - rho2f) + phi*rho2f;
+
+ alpha2 = scalar(1) - alpha1;
+ }
+
+ Info<< "Liquid phase volume fraction = "
+ << alpha1.weightedAverage(mesh.V()).value()
+ << " Min(alpha1) = " << min(alpha1).value()
+ << " Min(alpha2) = " << min(alpha2).value()
+ << endl;
+}
diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H
new file mode 100644
index 0000000000..89ba7a4e75
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H
@@ -0,0 +1,43 @@
+{
+ label nAlphaCorr
+ (
+ readLabel(piso.lookup("nAlphaCorr"))
+ );
+
+ label nAlphaSubCycles
+ (
+ readLabel(piso.lookup("nAlphaSubCycles"))
+ );
+
+ surfaceScalarField phic = mag(phi/mesh.magSf());
+ phic = min(interface.cAlpha()*phic, max(phic));
+
+ volScalarField divU = fvc::div(phi);
+
+ if (nAlphaSubCycles > 1)
+ {
+ dimensionedScalar totalDeltaT = runTime.deltaT();
+ surfaceScalarField rhoPhiSum = 0.0*rhoPhi;
+
+ for
+ (
+ subCycle alphaSubCycle(alpha1, nAlphaSubCycles);
+ !(++alphaSubCycle).end();
+ )
+ {
+ #include "alphaEqns.H"
+ rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
+ }
+
+ rhoPhi = rhoPhiSum;
+ }
+ else
+ {
+ #include "alphaEqns.H"
+ }
+
+ if (oCorr == 0)
+ {
+ interface.correct();
+ }
+}
diff --git a/applications/solvers/multiphase/compressibleLesInterFoam/compressibleLesInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C
similarity index 95%
rename from applications/solvers/multiphase/compressibleLesInterFoam/compressibleLesInterFoam.C
rename to applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C
index 6280b4293c..a48fd6b5d3 100644
--- a/applications/solvers/multiphase/compressibleLesInterFoam/compressibleLesInterFoam.C
+++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C
@@ -29,8 +29,9 @@ 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 is modelled using a run-time
- selectable incompressible LES model.
+ momentum equation is solved.
+
+ Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
\*---------------------------------------------------------------------------*/
@@ -39,7 +40,7 @@ Description
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
-#include "incompressible/LESModel/LESModel.H"
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -69,8 +70,6 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
- turbulence->correct();
-
// --- Outer-corrector loop
for (int oCorr=0; oCorrcorrect();
+
runTime.write();
Info<< "ExecutionTime = "
diff --git a/applications/solvers/multiphase/compressibleInterFoam/createFields.H b/applications/solvers/multiphase/compressibleInterFoam/createFields.H
new file mode 100644
index 0000000000..1f579d245b
--- /dev/null
+++ b/applications/solvers/multiphase/compressibleInterFoam/createFields.H
@@ -0,0 +1,152 @@
+ Info<< "Reading field pd\n" << endl;
+ volScalarField pd
+ (
+ IOobject
+ (
+ "pd",
+ runTime.timeName(),
+ mesh,
+ IOobject::MUST_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh
+ );
+
+ Info<< "Reading field alpha1\n" << endl;
+ volScalarField alpha1
+ (
+ IOobject
+ (
+ "alpha1",
+ runTime.timeName(),
+ mesh,
+ IOobject::MUST_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh
+ );
+
+ Info<< "Calculating field alpha1\n" << endl;
+ volScalarField alpha2("alpha2", scalar(1) - alpha1);
+
+ Info<< "Reading field U\n" << endl;
+ volVectorField U
+ (
+ IOobject
+ (
+ "U",
+ runTime.timeName(),
+ mesh,
+ IOobject::MUST_READ,
+ IOobject::AUTO_WRITE
+ ),
+ mesh
+ );
+
+ #include "createPhi.H"
+
+
+ Info<< "Calculating field g.h\n" << endl;
+ volScalarField gh("gh", g & mesh.C());
+ surfaceScalarField ghf("ghf", g & mesh.Cf());
+
+
+ Info<< "Reading transportProperties\n" << endl;
+ twoPhaseMixture twoPhaseProperties(U, phi);
+
+ dimensionedScalar rho10
+ (
+ twoPhaseProperties.subDict
+ (
+ twoPhaseProperties.phase1Name()
+ ).lookup("rho0")
+ );
+
+ dimensionedScalar rho20
+ (
+ twoPhaseProperties.subDict
+ (
+ twoPhaseProperties.phase2Name()
+ ).lookup("rho0")
+ );
+
+ dimensionedScalar psi1
+ (
+ twoPhaseProperties.subDict
+ (
+ twoPhaseProperties.phase1Name()
+ ).lookup("psi")
+ );
+
+ dimensionedScalar psi2
+ (
+ twoPhaseProperties.subDict
+ (
+ twoPhaseProperties.phase2Name()
+ ).lookup("psi")
+ );
+
+ dimensionedScalar pMin(twoPhaseProperties.lookup("pMin"));
+
+ volScalarField p
+ (
+ IOobject
+ (
+ "p",
+ runTime.timeName(),
+ mesh,
+ IOobject::NO_READ,
+ IOobject::AUTO_WRITE
+ ),
+ max
+ (
+ (pd + gh*(alpha1*rho10 + alpha2*rho20))
+ /(1.0 - gh*(alpha1*psi1 + alpha2*psi2)),
+ pMin
+ )
+ );
+
+ volScalarField rho1 = rho10 + psi1*p;
+ volScalarField rho2 = rho20 + psi2*p;
+
+ volScalarField rho
+ (
+ IOobject
+ (
+ "rho",
+ runTime.timeName(),
+ mesh,
+ IOobject::READ_IF_PRESENT,
+ IOobject::AUTO_WRITE
+ ),
+ alpha1*rho1 + alpha2*rho2
+ );
+
+
+ // Mass flux
+ // Initialisation does not matter because rhoPhi is reset after the
+ // alpha1 solution before it is used in the U equation.
+ surfaceScalarField rhoPhi
+ (
+ IOobject
+ (
+ "rho*phi",
+ runTime.timeName(),
+ mesh,
+ IOobject::NO_READ,
+ IOobject::NO_WRITE
+ ),
+ fvc::interpolate(rho)*phi
+ );
+
+ volScalarField dgdt =
+ pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001));
+
+ // Construct interface from alpha1 distribution
+ interfaceProperties interface(alpha1, U, twoPhaseProperties);
+
+ // Construct incompressible turbulence model
+ autoPtr turbulence
+ (
+ incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
+ );
diff --git a/applications/solvers/multiphase/compressibleLesInterFoam/pEqn.H b/applications/solvers/multiphase/compressibleInterFoam/pEqn.H
similarity index 100%
rename from applications/solvers/multiphase/compressibleLesInterFoam/pEqn.H
rename to applications/solvers/multiphase/compressibleInterFoam/pEqn.H
diff --git a/applications/solvers/multiphase/compressibleLesInterFoam/readControls.H b/applications/solvers/multiphase/compressibleInterFoam/readControls.H
similarity index 100%
rename from applications/solvers/multiphase/compressibleLesInterFoam/readControls.H
rename to applications/solvers/multiphase/compressibleInterFoam/readControls.H
diff --git a/applications/solvers/multiphase/compressibleLesInterFoam/Make/files b/applications/solvers/multiphase/compressibleLesInterFoam/Make/files
deleted file mode 100644
index 05dafae8b1..0000000000
--- a/applications/solvers/multiphase/compressibleLesInterFoam/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-compressibleLesInterFoam.C
-
-EXE = $(FOAM_APPBIN)/compressibleLesInterFoam
diff --git a/applications/solvers/multiphase/interDyMFoam/Make/options b/applications/solvers/multiphase/interDyMFoam/Make/options
index 6755d5bc59..74498326a9 100644
--- a/applications/solvers/multiphase/interDyMFoam/Make/options
+++ b/applications/solvers/multiphase/interDyMFoam/Make/options
@@ -1,11 +1,9 @@
EXE_INC = \
- -I../rasInterFoam \
-I../interFoam \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I$(LIB_SRC)/turbulenceModels/RAS/incompressible/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
@@ -16,6 +14,7 @@ EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
-lincompressibleRASModels \
+ -lincompressibleLESModels \
-lfiniteVolume \
-ldynamicMesh \
-lmeshTools \
diff --git a/applications/solvers/multiphase/interDyMFoam/createFields.H b/applications/solvers/multiphase/interDyMFoam/createFields.H
index ab58050ed0..0f1efe717f 100644
--- a/applications/solvers/multiphase/interDyMFoam/createFields.H
+++ b/applications/solvers/multiphase/interDyMFoam/createFields.H
@@ -12,12 +12,12 @@
mesh
);
- Info<< "Reading field gamma\n" << endl;
- volScalarField gamma
+ Info<< "Reading field alpha1\n" << endl;
+ volScalarField alpha1
(
IOobject
(
- "gamma",
+ "alpha1",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
@@ -44,7 +44,7 @@
Info<< "Reading transportProperties\n" << endl;
- twoPhaseMixture twoPhaseProperties(U, phi, "gamma");
+ twoPhaseMixture twoPhaseProperties(U, phi);
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
@@ -60,15 +60,15 @@
mesh,
IOobject::READ_IF_PRESENT
),
- gamma*rho1 + (scalar(1) - gamma)*rho2,
- gamma.boundaryField().types()
+ alpha1*rho1 + (scalar(1) - alpha1)*rho2,
+ alpha1.boundaryField().types()
);
rho.oldTime();
// Mass flux
// Initialisation does not matter because rhoPhi is reset after the
- // gamma solution before it is used in the U equation.
+ // alpha1 solution before it is used in the U equation.
surfaceScalarField rhoPhi
(
IOobject
@@ -83,13 +83,13 @@
);
- // Construct interface from gamma distribution
- interfaceProperties interface(gamma, U, twoPhaseProperties);
+ // Construct interface from alpha1 distribution
+ interfaceProperties interface(alpha1, U, twoPhaseProperties);
- // Construct incompressible RAS model
- autoPtr turbulence
+ // Construct incompressible turbulence model
+ autoPtr turbulence
(
- incompressible::RASModel::New(U, phi, twoPhaseProperties)
+ incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
);
wordList pcorrTypes(pd.boundaryField().types());
diff --git a/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C
index 915fee9a97..0ea32adcc8 100644
--- a/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C
+++ b/applications/solvers/multiphase/interDyMFoam/interDyMFoam.C
@@ -39,7 +39,7 @@ Description
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
-#include "incompressible/RASModel/RASModel.H"
+#include "turbulenceModel.H"
#include "probes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -58,8 +58,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
@@ -106,7 +105,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct();
- #include "gammaEqnSubCycle.H"
+ #include "alphaEqnSubCycle.H"
#include "UEqn.H"
diff --git a/applications/solvers/multiphase/interDyMFoam/pEqn.H b/applications/solvers/multiphase/interDyMFoam/pEqn.H
index c6961f6c22..f8ff18f606 100644
--- a/applications/solvers/multiphase/interDyMFoam/pEqn.H
+++ b/applications/solvers/multiphase/interDyMFoam/pEqn.H
@@ -7,7 +7,7 @@
phi = phiU +
(
- fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
+ fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf();
diff --git a/applications/solvers/multiphase/interFoam/Make/options b/applications/solvers/multiphase/interFoam/Make/options
index ae5ccba0fd..0e21fc2d64 100644
--- a/applications/solvers/multiphase/interFoam/Make/options
+++ b/applications/solvers/multiphase/interFoam/Make/options
@@ -2,9 +2,12 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
+ -lincompressibleRASModels \
+ -lincompressibleLESModels \
-lfiniteVolume
diff --git a/applications/solvers/multiphase/interFoam/UBlendingFactor.H b/applications/solvers/multiphase/interFoam/UBlendingFactor.H
index 217a9c3977..ade1b8e7f3 100644
--- a/applications/solvers/multiphase/interFoam/UBlendingFactor.H
+++ b/applications/solvers/multiphase/interFoam/UBlendingFactor.H
@@ -1,6 +1,6 @@
- surfaceScalarField gammaf = fvc::interpolate(gamma);
+ surfaceScalarField alpha1f = fvc::interpolate(alpha1);
surfaceScalarField UBlendingFactor
(
"UBlendingFactor",
- sqrt(max(min(4*gammaf*(1.0 - gammaf), 1.0), 0.0))
+ sqrt(max(min(4*alpha1f*(1.0 - alpha1f), 1.0), 0.0))
);
diff --git a/applications/solvers/multiphase/interFoam/UEqn.H b/applications/solvers/multiphase/interFoam/UEqn.H
index e585f3cab1..528e0aaafd 100644
--- a/applications/solvers/multiphase/interFoam/UEqn.H
+++ b/applications/solvers/multiphase/interFoam/UEqn.H
@@ -1,14 +1,21 @@
- surfaceScalarField muf = twoPhaseProperties.muf();
+ surfaceScalarField muEff
+ (
+ "muEff",
+ twoPhaseProperties.muf()
+ + fvc::interpolate(rho*turbulence->nut())
+ );
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
- - fvm::laplacian(muf, U)
- - (fvc::grad(U) & fvc::grad(muf))
- //- fvc::div(muf*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
+ - fvm::laplacian(muEff, U)
+ - (fvc::grad(U) & fvc::grad(muEff))
+ //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
);
+ UEqn.relax();
+
if (momentumPredictor)
{
solve
@@ -18,7 +25,7 @@
fvc::reconstruct
(
(
- fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
+ fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
- fvc::snGrad(pd)
) * mesh.magSf()
diff --git a/applications/solvers/multiphase/interFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/alphaEqn.H
new file mode 100644
index 0000000000..3bf24a845e
--- /dev/null
+++ b/applications/solvers/multiphase/interFoam/alphaEqn.H
@@ -0,0 +1,35 @@
+{
+ word alphaScheme("div(phi,alpha)");
+ word alpharScheme("div(phirb,alpha)");
+
+ surfaceScalarField phic = mag(phi/mesh.magSf());
+ phic = min(interface.cAlpha()*phic, max(phic));
+ surfaceScalarField phir = phic*interface.nHatf();
+
+ for (int gCorr=0; gCorr 1)
+{
+ dimensionedScalar totalDeltaT = runTime.deltaT();
+ surfaceScalarField rhoPhiSum = 0.0*rhoPhi;
+
+ for
+ (
+ subCycle alphaSubCycle(alpha1, nAlphaSubCycles);
+ !(++alphaSubCycle).end();
+ )
+ {
+# include "alphaEqn.H"
+ rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
+ }
+
+ rhoPhi = rhoPhiSum;
+}
+else
+{
+# include "alphaEqn.H"
+}
+
+interface.correct();
+
+rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
diff --git a/applications/solvers/multiphase/interFoam/createFields.H b/applications/solvers/multiphase/interFoam/createFields.H
index 887bcbdead..af349d7917 100644
--- a/applications/solvers/multiphase/interFoam/createFields.H
+++ b/applications/solvers/multiphase/interFoam/createFields.H
@@ -12,12 +12,12 @@
mesh
);
- Info<< "Reading field gamma\n" << endl;
- volScalarField gamma
+ Info<< "Reading field alpha1\n" << endl;
+ volScalarField alpha1
(
IOobject
(
- "gamma",
+ "alpha1",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
@@ -44,7 +44,7 @@
Info<< "Reading transportProperties\n" << endl;
- twoPhaseMixture twoPhaseProperties(U, phi, "gamma");
+ twoPhaseMixture twoPhaseProperties(U, phi);
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
@@ -60,15 +60,15 @@
mesh,
IOobject::READ_IF_PRESENT
),
- gamma*rho1 + (scalar(1) - gamma)*rho2,
- gamma.boundaryField().types()
+ alpha1*rho1 + (scalar(1) - alpha1)*rho2,
+ alpha1.boundaryField().types()
);
rho.oldTime();
// Mass flux
// Initialisation does not matter because rhoPhi is reset after the
- // gamma solution before it is used in the U equation.
+ // alpha1 solution before it is used in the U equation.
surfaceScalarField rhoPhi
(
IOobject
@@ -107,5 +107,12 @@
setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
- // Construct interface from gamma distribution
- interfaceProperties interface(gamma, U, twoPhaseProperties);
+ // Construct interface from alpha1 distribution
+ interfaceProperties interface(alpha1, U, twoPhaseProperties);
+
+
+ // Construct incompressible turbulence model
+ autoPtr turbulence
+ (
+ incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
+ );
diff --git a/applications/solvers/multiphase/interFoam/gammaEqn.H b/applications/solvers/multiphase/interFoam/gammaEqn.H
deleted file mode 100644
index 8978d1d293..0000000000
--- a/applications/solvers/multiphase/interFoam/gammaEqn.H
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- word gammaScheme("div(phi,gamma)");
- word gammarScheme("div(phirb,gamma)");
-
- surfaceScalarField phic = mag(phi/mesh.magSf());
- phic = min(interface.cGamma()*phic, max(phic));
- surfaceScalarField phir = phic*interface.nHatf();
-
- for (int gCorr=0; gCorr 1)
-{
- dimensionedScalar totalDeltaT = runTime.deltaT();
- surfaceScalarField rhoPhiSum = 0.0*rhoPhi;
-
- for
- (
- subCycle gammaSubCycle(gamma, nGammaSubCycles);
- !(++gammaSubCycle).end();
- )
- {
-# include "gammaEqn.H"
- rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
- }
-
- rhoPhi = rhoPhiSum;
-}
-else
-{
-# include "gammaEqn.H"
-}
-
-interface.correct();
-
-rho == gamma*rho1 + (scalar(1) - gamma)*rho2;
diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C
index b7f4f0ada5..1286a16d62 100644
--- a/applications/solvers/multiphase/interFoam/interFoam.C
+++ b/applications/solvers/multiphase/interFoam/interFoam.C
@@ -31,6 +31,8 @@ Description
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.
+
For a two-fluid approach see twoPhaseEulerFoam.
\*---------------------------------------------------------------------------*/
@@ -40,6 +42,7 @@ Description
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -57,7 +60,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@@ -74,7 +77,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct();
- #include "gammaEqnSubCycle.H"
+ #include "alphaEqnSubCycle.H"
#include "UEqn.H"
@@ -88,6 +91,8 @@ int main(int argc, char *argv[])
p = pd + rho*gh;
+ turbulence->correct();
+
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
diff --git a/applications/solvers/multiphase/interFoam/pEqn.H b/applications/solvers/multiphase/interFoam/pEqn.H
index 77256a8e2f..e5afbb8e4f 100644
--- a/applications/solvers/multiphase/interFoam/pEqn.H
+++ b/applications/solvers/multiphase/interFoam/pEqn.H
@@ -12,7 +12,7 @@
phi = phiU +
(
- fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
+ fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
)*rUAf*mesh.magSf();
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options
index fa6943e580..24e523f249 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options
@@ -2,13 +2,13 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/LES \
- -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-IphaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
+ -lincompressibleRASModels \
-lincompressibleLESModels \
-lfiniteVolume
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H
index fefdeb41c3..f020863077 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/UEqn.H
@@ -1,6 +1,6 @@
surfaceScalarField muf =
twoPhaseProperties->muf()
- + fvc::interpolate(rho*turbulence->nuSgs());
+ + fvc::interpolate(rho*turbulence->nut());
fvVectorMatrix UEqn
(
@@ -23,7 +23,7 @@
fvc::reconstruct
(
(
- fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
+ fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
- fvc::snGrad(pd)
) * mesh.magSf()
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/gammaEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H
similarity index 57%
rename from applications/solvers/multiphase/interPhaseChangeFoam/gammaEqn.H
rename to applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H
index 0186948920..15a5291ee6 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/gammaEqn.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqn.H
@@ -1,23 +1,23 @@
{
- word gammaScheme("div(phi,gamma)");
- word gammarScheme("div(phirb,gamma)");
+ word alphaScheme("div(phi,alpha)");
+ word alpharScheme("div(phirb,alpha)");
surfaceScalarField phir("phir", phic*interface.nHatf());
- for (int gCorr=0; gCorr > vDotAlphal =
@@ -46,22 +46,22 @@
),
// Divergence term is handled explicitly to be
// consistent with the explicit transport solution
- divU*gamma
+ divU*alpha1
+ vDotcAlphal
);
- //MULES::explicitSolve(gamma, phi, phiGamma, 1, 0);
- //MULES::explicitSolve(oneField(), gamma, phi, phiGamma, Sp, Su, 1, 0);
- MULES::implicitSolve(oneField(), gamma, phi, phiGamma, Sp, Su, 1, 0);
+ //MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
+ //MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
+ MULES::implicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
rhoPhi +=
(runTime.deltaT()/totalDeltaT)
- *(phiGamma*(rho1 - rho2) + phi*rho2);
+ *(phiAlpha*(rho1 - rho2) + phi*rho2);
}
Info<< "Liquid phase volume fraction = "
- << gamma.weightedAverage(mesh.V()).value()
- << " Min(gamma) = " << min(gamma).value()
- << " Max(gamma) = " << max(gamma).value()
+ << alpha1.weightedAverage(mesh.V()).value()
+ << " Min(alpha1) = " << min(alpha1).value()
+ << " Max(alpha1) = " << max(alpha1).value()
<< endl;
}
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/gammaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H
similarity index 53%
rename from applications/solvers/multiphase/interPhaseChangeFoam/gammaEqnSubCycle.H
rename to applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H
index c6355d6fb0..dd1d828030 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/gammaEqnSubCycle.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H
@@ -11,37 +11,37 @@ surfaceScalarField rhoPhi
);
{
- label nGammaCorr
+ label nAlphaCorr
(
- readLabel(piso.lookup("nGammaCorr"))
+ readLabel(piso.lookup("nAlphaCorr"))
);
- label nGammaSubCycles
+ label nAlphaSubCycles
(
- readLabel(piso.lookup("nGammaSubCycles"))
+ readLabel(piso.lookup("nAlphaSubCycles"))
);
surfaceScalarField phic = mag(phi/mesh.magSf());
- phic = min(interface.cGamma()*phic, max(phic));
+ phic = min(interface.cAlpha()*phic, max(phic));
volScalarField divU = fvc::div(phi);
dimensionedScalar totalDeltaT = runTime.deltaT();
- if (nGammaSubCycles > 1)
+ if (nAlphaSubCycles > 1)
{
for
(
- subCycle gammaSubCycle(gamma, nGammaSubCycles);
- !(++gammaSubCycle).end();
+ subCycle alphaSubCycle(alpha1, nAlphaSubCycles);
+ !(++alphaSubCycle).end();
)
{
-# include "gammaEqn.H"
+# include "alphaEqn.H"
}
}
else
{
-# include "gammaEqn.H"
+# include "alphaEqn.H"
}
if (nOuterCorr == 1)
@@ -49,5 +49,5 @@ surfaceScalarField rhoPhi
interface.correct();
}
- rho == gamma*rho1 + (scalar(1) - gamma)*rho2;
+ rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
}
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H
index 9e9c68a890..5e727dea3e 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/createFields.H
@@ -12,12 +12,12 @@
mesh
);
- Info<< "Reading field gamma\n" << endl;
- volScalarField gamma
+ Info<< "Reading field alpha1\n" << endl;
+ volScalarField alpha1
(
IOobject
(
- "gamma",
+ "alpha1",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
@@ -44,7 +44,7 @@
Info<< "Creating phaseChangeTwoPhaseMixture\n" << endl;
autoPtr twoPhaseProperties =
- phaseChangeTwoPhaseMixture::New(U, phi, "gamma");
+ phaseChangeTwoPhaseMixture::New(U, phi);
const dimensionedScalar& rho1 = twoPhaseProperties->rho1();
const dimensionedScalar& rho2 = twoPhaseProperties->rho2();
@@ -60,8 +60,8 @@
mesh,
IOobject::READ_IF_PRESENT
),
- gamma*rho1 + (scalar(1) - gamma)*rho2,
- gamma.boundaryField().types()
+ alpha1*rho1 + (scalar(1) - alpha1)*rho2,
+ alpha1.boundaryField().types()
);
rho.oldTime();
@@ -88,11 +88,11 @@
);
- // Construct interface from gamma distribution
- interfaceProperties interface(gamma, U, twoPhaseProperties());
+ // Construct interface from alpha1 distribution
+ interfaceProperties interface(alpha1, U, twoPhaseProperties());
- // Construct LES model
- autoPtr turbulence
+ // Construct incompressible turbulence model
+ autoPtr turbulence
(
- incompressible::LESModel::New(U, phi, twoPhaseProperties())
+ incompressible::turbulenceModel::New(U, phi, twoPhaseProperties())
);
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C
index bb6f1133ce..f7c8aa7250 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C
@@ -35,6 +35,8 @@ Description
but other mechanisms of phase-change are supported within this solver
framework.
+ Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
+
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
@@ -42,7 +44,7 @@ Description
#include "subCycle.H"
#include "interfaceProperties.H"
#include "phaseChangeTwoPhaseMixture.H"
-#include "incompressible/LESModel/LESModel.H"
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -60,7 +62,7 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@@ -75,9 +77,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
- twoPhaseProperties->correct();
-
- #include "gammaEqnSubCycle.H"
+ #include "alphaEqnSubCycle.H"
turbulence->correct();
@@ -95,6 +95,8 @@ int main(int argc, char *argv[])
#include "continuityErrs.H"
}
+ twoPhaseProperties->correct();
+
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H
index 3a7f7e4ebc..0037d71cf5 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/pEqn.H
@@ -13,7 +13,7 @@
phi = phiU +
(
- fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
+ fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
)*rUAf*mesh.magSf();
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H
index 0cbc33c52e..a2db01643a 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H
@@ -106,7 +106,7 @@ public:
(
const volVectorField& U,
const surfaceScalarField& phi,
- const word& alpha1Name
+ const word& alpha1Name = "alpha1"
);
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/Make/files b/applications/solvers/multiphase/lesCavitatingFoam/Make/files
deleted file mode 100644
index b577562e27..0000000000
--- a/applications/solvers/multiphase/lesCavitatingFoam/Make/files
+++ /dev/null
@@ -1,5 +0,0 @@
-lesCavitatingFoam.C
-
-devOneEqEddy/devOneEqEddy.C
-
-EXE = $(FOAM_APPBIN)/lesCavitatingFoam
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/Make/options b/applications/solvers/multiphase/lesCavitatingFoam/Make/options
deleted file mode 100644
index 91833c1365..0000000000
--- a/applications/solvers/multiphase/lesCavitatingFoam/Make/options
+++ /dev/null
@@ -1,16 +0,0 @@
-EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/transportModels \
- -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
- -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/LES \
- -I$(LIB_SRC)/turbulenceModels/LES/incompressible/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude
-
-EXE_LIBS = \
- -lincompressibleTransportModels \
- -lincompressibleLESModels \
- -lfiniteVolume \
- -lbarotropicCompressibilityModel
-
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/UEqn.H b/applications/solvers/multiphase/lesCavitatingFoam/UEqn.H
deleted file mode 100644
index 73033ddfaa..0000000000
--- a/applications/solvers/multiphase/lesCavitatingFoam/UEqn.H
+++ /dev/null
@@ -1,20 +0,0 @@
- surfaceScalarField muEff
- (
- "muEff",
- twoPhaseProperties.muf()
- + fvc::interpolate(rho*turbulence->nuSgs())
- );
-
- fvVectorMatrix UEqn
- (
- fvm::ddt(rho, U)
- + fvm::div(phi, U)
- - fvm::laplacian(muEff, U)
- //- (fvc::grad(U) & fvc::grad(muf))
- - fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
- );
-
- if (momentumPredictor)
- {
- solve(UEqn == -fvc::grad(p));
- }
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/createFields.H b/applications/solvers/multiphase/lesCavitatingFoam/createFields.H
deleted file mode 100644
index d2e19bcae8..0000000000
--- a/applications/solvers/multiphase/lesCavitatingFoam/createFields.H
+++ /dev/null
@@ -1,85 +0,0 @@
- Info<< "Reading field p\n" << endl;
- volScalarField p
- (
- IOobject
- (
- "p",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
- volScalarField rho
- (
- IOobject
- (
- "rho",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
- volScalarField gamma
- (
- IOobject
- (
- "gamma",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::AUTO_WRITE
- ),
- max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0))
- );
- gamma.oldTime();
-
- Info<< "Creating compressibilityModel\n" << endl;
- autoPtr psiModel =
- barotropicCompressibilityModel::New
- (
- thermodynamicProperties,
- gamma
- );
-
- const volScalarField& psi = psiModel->psi();
-
- rho == max
- (
- psi*p
- + (1.0 - gamma)*rhol0
- + ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat,
- rhoMin
- );
-
- Info<< "Reading field U\n" << endl;
- volVectorField U
- (
- IOobject
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-# include "createPhiv.H"
-# include "compressibleCreatePhi.H"
-
- Info<< "Reading transportProperties\n" << endl;
-
- twoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
-
- // Create LES model
- autoPtr turbulence
- (
- incompressible::LESModel::New(U, phiv, twoPhaseProperties)
- );
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/devOneEqEddy/devOneEqEddy.C b/applications/solvers/multiphase/lesCavitatingFoam/devOneEqEddy/devOneEqEddy.C
deleted file mode 100644
index db9cb56991..0000000000
--- a/applications/solvers/multiphase/lesCavitatingFoam/devOneEqEddy/devOneEqEddy.C
+++ /dev/null
@@ -1,130 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2008 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
-
-\*---------------------------------------------------------------------------*/
-
-#include "devOneEqEddy.H"
-#include "addToRunTimeSelectionTable.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-namespace incompressible
-{
-namespace LESModels
-{
-
-// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-
-defineTypeNameAndDebug(devOneEqEddy, 0);
-addToRunTimeSelectionTable(LESModel, devOneEqEddy, dictionary);
-
-// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
-
-devOneEqEddy::devOneEqEddy
-(
- const volVectorField& U,
- const surfaceScalarField& phi,
- transportModel& transport
-)
-:
- LESModel(typeName, U, phi, transport),
- GenEddyVisc(U, phi, transport),
-
- k_
- (
- IOobject
- (
- "k",
- runTime_.timeName(),
- mesh_,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh_
- ),
- ck_
- (
- dimensioned::lookupOrAddToDict
- (
- "ck",
- coeffDict(),
- 0.07
- )
- )
-{
- printCoeffs();
-}
-
-
-// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-
-void devOneEqEddy::correct(const tmp& gradU)
-{
- GenEddyVisc::correct(gradU);
-
- //volScalarField G = 2*nuSgs_*magSqr(symm(gradU));
- volScalarField G = 2*nuSgs_*(gradU() && dev(symm(gradU())));
-
- solve
- (
- fvm::ddt(k_)
- + fvm::div(phi(), k_)
- - fvm::Sp(fvc::div(phi()), k_)
- - fvm::laplacian(DkEff(), k_)
- ==
- G
- - fvm::Sp(ce_*sqrt(k_)/delta(), k_)
- );
-
- bound(k_, k0());
-
- nuSgs_ = ck_*sqrt(k_)*delta();
- nuSgs_.correctBoundaryConditions();
-}
-
-
-bool devOneEqEddy::read()
-{
- if (GenEddyVisc::read())
- {
- ck_.readIfPresent(coeffDict());
-
- return true;
- }
- else
- {
- return false;
- }
-}
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace LESModels
-} // End namespace incompressible
-} // End namespace Foam
-
-// ************************************************************************* //
diff --git a/applications/solvers/multiphase/lesCavitatingFoam/devOneEqEddy/devOneEqEddy.H b/applications/solvers/multiphase/lesCavitatingFoam/devOneEqEddy/devOneEqEddy.H
deleted file mode 100644
index 30090fe28f..0000000000
--- a/applications/solvers/multiphase/lesCavitatingFoam/devOneEqEddy/devOneEqEddy.H
+++ /dev/null
@@ -1,148 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2008 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
-
-Class
- devOneEqEddy
-
-Description
-
- One Equation Eddy Viscosity Model
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Eddy viscosity SGS model using a modeled balance equation to simulate the
- behaviour of k, hence,
-
- d/dt(k) + div(U*k) - div(nuEff*grad(k))
- =
- -B*L - ce*k^3/2/delta
-
- and
-
- B = 2/3*k*I - 2*nuEff*dev(D)
-
- where
-
- D = symm(grad(U));
- nuSgs = ck*sqrt(k)*delta
- nuEff = nuSgs + nu
-
-
-SourceFiles
- devOneEqEddy.C
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef devOneEqEddy_H
-#define devOneEqEddy_H
-
-#include "GenEddyVisc.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-namespace incompressible
-{
-namespace LESModels
-{
-
-/*---------------------------------------------------------------------------*\
- Class devOneEqEddy Declaration
-\*---------------------------------------------------------------------------*/
-
-class devOneEqEddy
-:
- public GenEddyVisc
-{
- // Private data
-
- volScalarField k_;
-
- dimensionedScalar ck_;
-
-
- // Private Member Functions
-
- // Disallow default bitwise copy construct and assignment
- devOneEqEddy(const devOneEqEddy&);
- devOneEqEddy& operator=(const devOneEqEddy&);
-
-
-public:
-
- //- Runtime type information
- TypeName("devOneEqEddy");
-
- // Constructors
-
- //- Constructor from components
- devOneEqEddy
- (
- const volVectorField& U,
- const surfaceScalarField& phi,
- transportModel& transport
- );
-
-
- // Destructor
-
- ~devOneEqEddy()
- {}
-
-
- // Member Functions
-
- //- Return SGS kinetic energy
- tmp k() const
- {
- return k_;
- }
-
- //- Return the effective diffusivity for k
- tmp DkEff() const
- {
- return tmp
- (
- new volScalarField("DkEff", nuSgs_ + nu())
- );
- }
-
- //- Correct Eddy-Viscosity and related properties
- void correct(const tmp& gradU);
-
- //- Read turbulenceProperties dictionary
- bool read();
-};
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace LESModelsModels
-} // End namespace incompressible
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/applications/solvers/multiphase/lesInterFoam/Make/files b/applications/solvers/multiphase/lesInterFoam/Make/files
deleted file mode 100644
index 40039bd1a7..0000000000
--- a/applications/solvers/multiphase/lesInterFoam/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-lesInterFoam.C
-
-EXE = $(FOAM_APPBIN)/lesInterFoam
diff --git a/applications/solvers/multiphase/lesInterFoam/Make/options b/applications/solvers/multiphase/lesInterFoam/Make/options
deleted file mode 100644
index 43c523e220..0000000000
--- a/applications/solvers/multiphase/lesInterFoam/Make/options
+++ /dev/null
@@ -1,15 +0,0 @@
-EXE_INC = \
- -Iaveraging \
- -I../interFoam \
- -I$(LIB_SRC)/transportModels \
- -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
- -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/LES \
- -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
- -I$(LIB_SRC)/finiteVolume/lnInclude
-
-EXE_LIBS = \
- -linterfaceProperties \
- -lincompressibleTransportModels \
- -lincompressibleLESModels \
- -lfiniteVolume
diff --git a/applications/solvers/multiphase/lesInterFoam/UEqn.H b/applications/solvers/multiphase/lesInterFoam/UEqn.H
deleted file mode 100644
index 1bf56f02dd..0000000000
--- a/applications/solvers/multiphase/lesInterFoam/UEqn.H
+++ /dev/null
@@ -1,32 +0,0 @@
- surfaceScalarField muEff
- (
- "muEff",
- twoPhaseProperties.muf()
- + fvc::interpolate(rho*turbulence->nuSgs())
- );
-
- fvVectorMatrix UEqn
- (
- fvm::ddt(rho, U)
- + fvm::div(rhoPhi, U)
- - fvm::laplacian(muEff, U)
- - (fvc::grad(U) & fvc::grad(muEff))
- //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
- );
-
- if (momentumPredictor)
- {
- solve
- (
- UEqn
- ==
- fvc::reconstruct
- (
- (
- fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
- - ghf*fvc::snGrad(rho)
- - fvc::snGrad(pd)
- ) * mesh.magSf()
- )
- );
- }
diff --git a/applications/solvers/multiphase/lesInterFoam/createFields.H b/applications/solvers/multiphase/lesInterFoam/createFields.H
deleted file mode 100644
index c622be1561..0000000000
--- a/applications/solvers/multiphase/lesInterFoam/createFields.H
+++ /dev/null
@@ -1,115 +0,0 @@
- Info<< "Reading field pd\n" << endl;
- volScalarField pd
- (
- IOobject
- (
- "pd",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
- Info<< "Reading field gamma\n" << endl;
- volScalarField gamma
- (
- IOobject
- (
- "gamma",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
- Info<< "Reading field U\n" << endl;
- volVectorField U
- (
- IOobject
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-# include "createPhi.H"
-
- Info<< "Reading transportProperties\n" << endl;
- twoPhaseMixture twoPhaseProperties(U, phi, "gamma");
-
- const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
- const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
-
-
- // Need to store rho for ddt(rho, U)
- volScalarField rho
- (
- IOobject
- (
- "rho",
- runTime.timeName(),
- mesh,
- IOobject::READ_IF_PRESENT
- ),
- gamma*rho1 + (scalar(1) - gamma)*rho2,
- gamma.boundaryField().types()
- );
- rho.oldTime();
-
- // Mass flux
- // Initialisation does not matter because rhoPhi is reset after the
- // gamma solution before it is used in the U equation.
- surfaceScalarField rhoPhi
- (
- IOobject
- (
- "rho*phi",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::NO_WRITE
- ),
- rho1*phi
- );
-
-
- label pdRefCell = 0;
- scalar pdRefValue = 0.0;
- setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
-
-
- Info<< "Calculating field g.h\n" << endl;
- volScalarField gh("gh", g & mesh.C());
- surfaceScalarField ghf("gh", g & mesh.Cf());
-
-
- volScalarField p
- (
- IOobject
- (
- "p",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::AUTO_WRITE
- ),
- pd + rho*gh
- );
-
-
- // Construct interface from gamma distribution
- interfaceProperties interface(gamma, U, twoPhaseProperties);
-
- // Construct LES model
- autoPtr turbulence
- (
- incompressible::LESModel::New(U, phi, twoPhaseProperties)
- );
diff --git a/applications/solvers/multiphase/lesInterFoam/lesInterFoam.C b/applications/solvers/multiphase/lesInterFoam/lesInterFoam.C
deleted file mode 100644
index 8d109f03b3..0000000000
--- a/applications/solvers/multiphase/lesInterFoam/lesInterFoam.C
+++ /dev/null
@@ -1,103 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2008 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
- lesInterFoam
-
-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 is modelled using a run-time
- selectable incompressible LES model.
-
-\*---------------------------------------------------------------------------*/
-
-#include "fvCFD.H"
-#include "MULES.H"
-#include "subCycle.H"
-#include "interfaceProperties.H"
-#include "twoPhaseMixture.H"
-#include "incompressible/LESModel/LESModel.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-int main(int argc, char *argv[])
-{
- #include "setRootCase.H"
- #include "createTime.H"
- #include "createMesh.H"
- #include "readEnvironmentalProperties.H"
- #include "readPISOControls.H"
- #include "initContinuityErrs.H"
- #include "createFields.H"
- #include "readTimeControls.H"
- #include "correctPhi.H"
- #include "CourantNo.H"
- #include "setInitialDeltaT.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
- Info<< "\nStarting time loop\n" << endl;
-
- while (runTime.run())
- {
- #include "readPISOControls.H"
- #include "readTimeControls.H"
- #include "CourantNo.H"
- #include "setDeltaT.H"
-
- runTime++;
- Info<< "Time = " << runTime.timeName() << nl << endl;
-
- #include "gammaEqnSubCycle.H"
-
- turbulence->correct();
-
- #include "UEqn.H"
-
- // --- PISO loop
- for (int corr=0; corr < nCorr; corr++)
- {
- #include "pEqn.H"
- }
-
- #include "continuityErrs.H"
-
- p = pd + rho*gh;
-
- runTime.write();
-
- Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
- << " ClockTime = " << runTime.elapsedClockTime() << " s"
- << nl << endl;
- }
-
- Info<< "End\n" << endl;
-
- return(0);
-}
-
-
-// ************************************************************************* //
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Make/options b/applications/solvers/multiphase/multiphaseInterFoam/Make/options
index cd906bfa53..1fc821726c 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/Make/options
+++ b/applications/solvers/multiphase/multiphaseInterFoam/Make/options
@@ -6,9 +6,13 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
+ -lincompressibleTransportModels \
+ -lincompressibleRASModels \
+ -lincompressibleLESModels \
-lfiniteVolume
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H b/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H
index 43cc2cb183..5ce0c0c088 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H
+++ b/applications/solvers/multiphase/multiphaseInterFoam/UEqn.H
@@ -1,10 +1,34 @@
- surfaceScalarField muf = mixture.muf();
+ surfaceScalarField muEff
+ (
+ "muEff",
+ mixture.muf()
+ + fvc::interpolate(rho*turbulence->nut())
+ );
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(mixture.rhoPhi(), U)
- - fvm::laplacian(muf, U)
- - (fvc::grad(U) & fvc::grad(muf))
- //- fvc::div(muf*(mesh.Sf() & fvc::interpolate(fvc::grad(U)().T())))
+ - fvm::laplacian(muEff, U)
+ - (fvc::grad(U) & fvc::grad(muEff))
+ //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
);
+
+ UEqn.relax();
+
+ if (momentumPredictor)
+ {
+ solve
+ (
+ UEqn
+ ==
+ fvc::reconstruct
+ (
+ (
+ mixture.surfaceTensionForce()
+ - ghf*fvc::snGrad(rho)
+ - fvc::snGrad(pd)
+ ) * mesh.magSf()
+ )
+ );
+ }
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H
index 4f71f75ba4..aa62d0f2a1 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H
+++ b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H
@@ -46,9 +46,31 @@
Info<< "Calculating field g.h\n" << endl;
+ volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("gh", g & mesh.Cf());
+ volScalarField p
+ (
+ IOobject
+ (
+ "p",
+ runTime.timeName(),
+ mesh,
+ IOobject::NO_READ,
+ IOobject::AUTO_WRITE
+ ),
+ pd + rho*gh
+ );
+
+
label pdRefCell = 0;
scalar pdRefValue = 0.0;
setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
+
+
+ // Construct incompressible turbulence model
+ autoPtr turbulence
+ (
+ incompressible::turbulenceModel::New(U, phi, mixture)
+ );
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C
index 5dd13984bf..edd2bca880 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C
@@ -29,38 +29,40 @@ Description
Solver for n incompressible fluids which captures the interfaces and
includes surface-tension and contact-angle effects for each.
+ Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
+
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "multiphaseMixture.H"
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
+ #include "setRootCase.H"
+ #include "createTime.H"
+ #include "createMesh.H"
+ #include "readEnvironmentalProperties.H"
+ #include "readPISOControls.H"
+ #include "initContinuityErrs.H"
+ #include "createFields.H"
+ #include "readTimeControls.H"
+ #include "correctPhi.H"
+ #include "CourantNo.H"
+ #include "setInitialDeltaT.H"
-# include "setRootCase.H"
-# include "createTime.H"
-# include "createMesh.H"
-# include "readEnvironmentalProperties.H"
-# include "readPISOControls.H"
-# include "initContinuityErrs.H"
-# include "createFields.H"
-# include "readTimeControls.H"
-# include "correctPhi.H"
-# include "CourantNo.H"
-# include "setInitialDeltaT.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
while (runTime.run())
{
-# include "readPISOControls.H"
-# include "readTimeControls.H"
-# include "CourantNo.H"
-# include "setDeltaT.H"
+ #include "readPISOControls.H"
+ #include "readTimeControls.H"
+ #include "CourantNo.H"
+ #include "setDeltaT.H"
runTime++;
@@ -69,15 +71,19 @@ int main(int argc, char *argv[])
mixture.correct();
rho = mixture.rho();
-# include "UEqn.H"
+ #include "UEqn.H"
// --- PISO loop
for (int corr=0; corrcorrect();
runTime.write();
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/Make/files b/applications/solvers/multiphase/rasCavitatingFoam/Make/files
deleted file mode 100644
index 4509463796..0000000000
--- a/applications/solvers/multiphase/rasCavitatingFoam/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-rasCavitatingFoam.C
-
-EXE = $(FOAM_APPBIN)/rasCavitatingFoam
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/continuityErrs.H b/applications/solvers/multiphase/rasCavitatingFoam/continuityErrs.H
deleted file mode 100644
index 6f1622510f..0000000000
--- a/applications/solvers/multiphase/rasCavitatingFoam/continuityErrs.H
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- volScalarField thermoRho = psi*p + (1.0 - gamma)*rhol0;
-
- dimensionedScalar totalMass = fvc::domainIntegrate(rho);
-
- scalar sumLocalContErr =
- (
- fvc::domainIntegrate(mag(rho - thermoRho))/totalMass
- ).value();
-
- scalar globalContErr =
- (
- fvc::domainIntegrate(rho - thermoRho)/totalMass
- ).value();
-
- cumulativeContErr += globalContErr;
-
- Info<< "time step continuity errors : sum local = " << sumLocalContErr
- << ", global = " << globalContErr
- << ", cumulative = " << cumulativeContErr
- << endl;
-}
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/gammaPsi.H b/applications/solvers/multiphase/rasCavitatingFoam/gammaPsi.H
deleted file mode 100644
index b259ddd322..0000000000
--- a/applications/solvers/multiphase/rasCavitatingFoam/gammaPsi.H
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- gamma = max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));
-
- Info<< "max-min gamma: " << max(gamma).value()
- << " " << min(gamma).value() << endl;
-
- psiModel->correct();
-
- //Info<< "min a: " << 1.0/sqrt(max(psi)).value() << endl;
-}
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/pEqn.H b/applications/solvers/multiphase/rasCavitatingFoam/pEqn.H
deleted file mode 100644
index c9382dfc0f..0000000000
--- a/applications/solvers/multiphase/rasCavitatingFoam/pEqn.H
+++ /dev/null
@@ -1,80 +0,0 @@
-{
- if (nOuterCorr == 1)
- {
- p =
- (
- rho
- - (1.0 - gamma)*rhol0
- - ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat
- )/psi;
- }
-
- surfaceScalarField rhof = fvc::interpolate(rho, "rhof");
-
- volScalarField rUA = 1.0/UEqn.A();
- surfaceScalarField rUAf("rUAf", rhof*fvc::interpolate(rUA));
- volVectorField HbyA = rUA*UEqn.H();
-
- phiv = (fvc::interpolate(HbyA) & mesh.Sf())
- + fvc::ddtPhiCorr(rUA, rho, U, phiv);
-
- p.boundaryField().updateCoeffs();
-
- surfaceScalarField phiGradp = rUAf*mesh.magSf()*fvc::snGrad(p);
-
- phiv -= phiGradp/rhof;
-
-# include "resetPhivPatches.H"
-
- for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
- {
- fvScalarMatrix pEqn
- (
- fvm::ddt(psi, p)
- - (rhol0 + (psil - psiv)*pSat)*fvc::ddt(gamma) - pSat*fvc::ddt(psi)
- + fvc::div(phiv, rho)
- + fvc::div(phiGradp)
- - fvm::laplacian(rUAf, p)
- );
-
- pEqn.solve();
-
- if (nonOrth == nNonOrthCorr)
- {
- phiv += (phiGradp + pEqn.flux())/rhof;
- }
- }
-
- Info<< "max-min p: " << max(p).value()
- << " " << min(p).value() << endl;
-
-
- U = HbyA - rUA*fvc::grad(p);
-
- // Remove the swirl component of velocity for "wedge" cases
- if (piso.found("removeSwirl"))
- {
- label swirlCmpt(readLabel(piso.lookup("removeSwirl")));
-
- Info<< "Removing swirl component-" << swirlCmpt << " of U" << endl;
- U.field().replace(swirlCmpt, 0.0);
- }
-
- U.correctBoundaryConditions();
-
- Info<< "max(U) " << max(mag(U)).value() << endl;
-
- rho == max
- (
- psi*p
- + (1.0 - gamma)*rhol0
- + ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat,
- rhoMin
- );
-
- Info<< "max-min rho: " << max(rho).value()
- << " " << min(rho).value() << endl;
-
-# include "gammaPsi.H"
-
-}
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/rasCavitatingFoam.C b/applications/solvers/multiphase/rasCavitatingFoam/rasCavitatingFoam.C
deleted file mode 100644
index 51d2a31dde..0000000000
--- a/applications/solvers/multiphase/rasCavitatingFoam/rasCavitatingFoam.C
+++ /dev/null
@@ -1,94 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 1991-2008 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
- rasCavitatingFoam
-
-Description
- Transient cavitation code with RAS turbulence.
-
-\*---------------------------------------------------------------------------*/
-
-#include "fvCFD.H"
-#include "barotropicCompressibilityModel.H"
-#include "twoPhaseMixture.H"
-#include "incompressible/RASModel/RASModel.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-int main(int argc, char *argv[])
-{
-
-# include "setRootCase.H"
-
-# include "createTime.H"
-# include "createMesh.H"
-# include "readThermodynamicProperties.H"
-# include "readControls.H"
-# include "createFields.H"
-# include "initContinuityErrs.H"
-# include "compressibleCourantNo.H"
-# include "setInitialDeltaT.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
- Info<< "\nStarting time loop\n" << endl;
-
- while (runTime.run())
- {
-# include "readControls.H"
-# include "CourantNo.H"
-# include "setDeltaT.H"
-
- runTime++;
- Info<< "Time = " << runTime.timeName() << nl << endl;
-
- for (int outerCorr=0; outerCorrcorrect();
-
- runTime.write();
-
- Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
- << " ClockTime = " << runTime.elapsedClockTime() << " s"
- << nl << endl;
- }
-
- Info<< "\n end \n";
-
- return(0);
-}
-
-
-// ************************************************************************* //
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/readControls.H b/applications/solvers/multiphase/rasCavitatingFoam/readControls.H
deleted file mode 100644
index f53e7b9eb1..0000000000
--- a/applications/solvers/multiphase/rasCavitatingFoam/readControls.H
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "readTimeControls.H"
-
-scalar maxAcousticCo
-(
- readScalar(runTime.controlDict().lookup("maxAcousticCo"))
-);
-
-
-#include "readPISOControls.H"
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/readThermodynamicProperties.H b/applications/solvers/multiphase/rasCavitatingFoam/readThermodynamicProperties.H
deleted file mode 100644
index d3fbb9307a..0000000000
--- a/applications/solvers/multiphase/rasCavitatingFoam/readThermodynamicProperties.H
+++ /dev/null
@@ -1,27 +0,0 @@
- Info<< "Reading thermodynamicProperties\n" << endl;
-
- IOdictionary thermodynamicProperties
- (
- IOobject
- (
- "thermodynamicProperties",
- runTime.constant(),
- mesh,
- IOobject::MUST_READ,
- IOobject::NO_WRITE
- )
- );
-
- dimensionedScalar psil(thermodynamicProperties.lookup("psil"));
-
- dimensionedScalar rholSat(thermodynamicProperties.lookup("rholSat"));
-
- dimensionedScalar psiv(thermodynamicProperties.lookup("psiv"));
-
- dimensionedScalar pSat(thermodynamicProperties.lookup("pSat"));
-
- dimensionedScalar rhovSat("rhovSat", psiv*pSat);
-
- dimensionedScalar rhol0("rhol0", rholSat - pSat*psil);
-
- dimensionedScalar rhoMin(thermodynamicProperties.lookup("rhoMin"));
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/resetPhiPatches.H b/applications/solvers/multiphase/rasCavitatingFoam/resetPhiPatches.H
deleted file mode 100644
index e7d0c2f93e..0000000000
--- a/applications/solvers/multiphase/rasCavitatingFoam/resetPhiPatches.H
+++ /dev/null
@@ -1,15 +0,0 @@
-fvsPatchScalarFieldField& phiPatches = phi.boundaryField();
-const fvPatchScalarFieldField& rhoPatches = rho.boundaryField();
-const fvPatchVectorFieldField& Upatches = U.boundaryField();
-const fvsPatchVectorFieldField& SfPatches = mesh.Sf().boundaryField();
-
-forAll(phiPatches, patchI)
-{
- if (phi.boundaryField().types()[patchI] == "calculated")
- {
- calculatedFvsPatchScalarField& phiPatch =
- refCast(phiPatches[patchI]);
-
- phiPatch == ((rhoPatches[patchI]*Upatches[patchI]) & SfPatches[patchI]);
- }
-}
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/resetPhivPatches.H b/applications/solvers/multiphase/rasCavitatingFoam/resetPhivPatches.H
deleted file mode 100644
index 7e8b040bb6..0000000000
--- a/applications/solvers/multiphase/rasCavitatingFoam/resetPhivPatches.H
+++ /dev/null
@@ -1,14 +0,0 @@
-surfaceScalarField::GeometricBoundaryField& phivPatches = phiv.boundaryField();
-const volVectorField::GeometricBoundaryField& Upatches = U.boundaryField();
-const surfaceVectorField::GeometricBoundaryField& SfPatches = mesh.Sf().boundaryField();
-
-forAll(phivPatches, patchI)
-{
- if (phiv.boundaryField().types()[patchI] == "calculated")
- {
- calculatedFvsPatchScalarField& phivPatch =
- refCast(phivPatches[patchI]);
-
- phivPatch == (Upatches[patchI] & SfPatches[patchI]);
- }
-}
diff --git a/applications/solvers/multiphase/rasCavitatingFoam/rhoEqn.H b/applications/solvers/multiphase/rasCavitatingFoam/rhoEqn.H
deleted file mode 100644
index d0bd6e1dad..0000000000
--- a/applications/solvers/multiphase/rasCavitatingFoam/rhoEqn.H
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- fvScalarMatrix rhoEqn
- (
- fvm::ddt(rho)
- + fvm::div(phiv, rho)
- );
-
- rhoEqn.solve();
-
- phi = rhoEqn.flux();
-
- Info<< "max-min rho: " << max(rho).value()
- << " " << min(rho).value() << endl;
-
- rho == max(rho, rhoMin);
-}
diff --git a/applications/solvers/multiphase/rasInterFoam/Make/files b/applications/solvers/multiphase/rasInterFoam/Make/files
deleted file mode 100644
index 39b992ad4d..0000000000
--- a/applications/solvers/multiphase/rasInterFoam/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-rasInterFoam.C
-
-EXE = $(FOAM_APPBIN)/rasInterFoam
diff --git a/applications/solvers/multiphase/rasInterFoam/Make/options b/applications/solvers/multiphase/rasInterFoam/Make/options
deleted file mode 100644
index 04a3c57887..0000000000
--- a/applications/solvers/multiphase/rasInterFoam/Make/options
+++ /dev/null
@@ -1,13 +0,0 @@
-EXE_INC = \
- -I../interFoam \
- -I$(LIB_SRC)/transportModels \
- -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
- -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I$(LIB_SRC)/finiteVolume/lnInclude
-
-EXE_LIBS = \
- -linterfaceProperties \
- -lincompressibleTransportModels \
- -lincompressibleRASModels \
- -lfiniteVolume
diff --git a/applications/solvers/multiphase/rasInterFoam/createFields.H b/applications/solvers/multiphase/rasInterFoam/createFields.H
deleted file mode 100644
index e97a3abcb0..0000000000
--- a/applications/solvers/multiphase/rasInterFoam/createFields.H
+++ /dev/null
@@ -1,116 +0,0 @@
- Info<< "Reading field pd\n" << endl;
- volScalarField pd
- (
- IOobject
- (
- "pd",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
- Info<< "Reading field gamma\n" << endl;
- volScalarField gamma
- (
- IOobject
- (
- "gamma",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
- Info<< "Reading field U\n" << endl;
- volVectorField U
- (
- IOobject
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::AUTO_WRITE
- ),
- mesh
- );
-
-# include "createPhi.H"
-
- Info<< "Reading transportProperties\n" << endl;
- twoPhaseMixture twoPhaseProperties(U, phi, "gamma");
-
- const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
- const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
-
-
- // Need to store rho for ddt(rho, U)
- volScalarField rho
- (
- IOobject
- (
- "rho",
- runTime.timeName(),
- mesh,
- IOobject::READ_IF_PRESENT
- ),
- gamma*rho1 + (scalar(1) - gamma)*rho2,
- gamma.boundaryField().types()
- );
- rho.oldTime();
-
-
- // Mass flux
- // Initialisation does not matter because rhoPhi is reset after the
- // gamma solution before it is used in the U equation.
- surfaceScalarField rhoPhi
- (
- IOobject
- (
- "rho*phi",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::NO_WRITE
- ),
- rho1*phi
- );
-
-
- label pdRefCell = 0;
- scalar pdRefValue = 0.0;
- setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
-
-
- Info<< "Calculating field g.h\n" << endl;
- volScalarField gh("gh", g & mesh.C());
- surfaceScalarField ghf("gh", g & mesh.Cf());
-
-
- volScalarField p
- (
- IOobject
- (
- "p",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::AUTO_WRITE
- ),
- pd + rho*gh
- );
-
-
- // Construct interface from gamma distribution
- interfaceProperties interface(gamma, U, twoPhaseProperties);
-
- // Construct LES model
- autoPtr turbulence
- (
- incompressible::RASModel::New(U, phi, twoPhaseProperties)
- );
diff --git a/applications/solvers/multiphase/settlingFoam/UEqn.H b/applications/solvers/multiphase/settlingFoam/UEqn.H
index 8dba5041c2..ac4c18ab19 100644
--- a/applications/solvers/multiphase/settlingFoam/UEqn.H
+++ b/applications/solvers/multiphase/settlingFoam/UEqn.H
@@ -1,29 +1,31 @@
-// Solve the Momentum equation
+ // Solve the Momentum equation
-fvVectorMatrix UEqn
-(
- fvm::ddt(rho, U)
- + fvm::div(phi, U)
- + fvc::div
+ fvVectorMatrix UEqn
(
- (Alpha/(scalar(1.001) - Alpha))*(sqr(rhoc)/rho)*Vdj*Vdj,
- "div(phiVdj,Vdj)"
- )
- - fvm::laplacian(mu, U, "laplacian(muEff,U)")
-);
-
-if (momentumPredictor)
-{
- solve
- (
- UEqn
- ==
- fvc::reconstruct
+ fvm::ddt(rho, U)
+ + fvm::div(phi, U)
+ + fvc::div
(
- (
- - ghf*fvc::snGrad(rho)
- - fvc::snGrad(p)
- )*mesh.magSf()
+ (Alpha/(scalar(1.001) - Alpha))*(sqr(rhoc)/rho)*Vdj*Vdj,
+ "div(phiVdj,Vdj)"
)
+ - fvm::laplacian(mu, U, "laplacian(muEff,U)")
);
-}
+
+ UEqn.relax();
+
+ if (momentumPredictor)
+ {
+ solve
+ (
+ UEqn
+ ==
+ fvc::reconstruct
+ (
+ (
+ - ghf*fvc::snGrad(rho)
+ - fvc::snGrad(p)
+ )*mesh.magSf()
+ )
+ );
+ }
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options
index ae5ccba0fd..0e21fc2d64 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options
@@ -2,9 +2,12 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-linterfaceProperties \
-lincompressibleTransportModels \
+ -lincompressibleRASModels \
+ -lincompressibleLESModels \
-lfiniteVolume
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H
index 0ebaec44f5..5a945697ca 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/UEqn.H
@@ -1,14 +1,21 @@
- surfaceScalarField muf = twoPhaseProperties.muf();
+ surfaceScalarField muEff
+ (
+ "muEff",
+ twoPhaseProperties.muf()
+ + fvc::interpolate(rho*turbulence->nut())
+ );
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
- - fvm::laplacian(muf, U)
- //- (fvc::grad(U) & fvc::grad(muf))
- - fvc::div(muf*(mesh.Sf() & fvc::interpolate(fvc::grad(U)().T())))
+ - fvm::laplacian(muEff, U)
+ - (fvc::grad(U) & fvc::grad(muEff))
+ //- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
);
+ UEqn.relax();
+
if (momentumPredictor)
{
solve
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H
new file mode 100644
index 0000000000..c126025368
--- /dev/null
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H
@@ -0,0 +1,19 @@
+{
+ fvScalarMatrix alpha1Eqn
+ (
+ fvm::ddt(alpha1)
+ + fvm::div(phi, alpha1)
+ - fvm::laplacian(Dab, alpha1)
+ );
+
+ alpha1Eqn.solve();
+
+ rhoPhi = alpha1Eqn.flux()*(rho1 - rho2) + phi*rho2;
+ rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2;
+
+ Info<< "Phase 1 volume fraction = "
+ << alpha1.weightedAverage(mesh.V()).value()
+ << " Min(alpha1) = " << min(alpha1).value()
+ << " Max(alpha1) = " << max(alpha1).value()
+ << endl;
+}
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H
index 652d1ad64c..bd7c3e2c9f 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/createFields.H
@@ -12,12 +12,12 @@
mesh
);
- Info<< "Reading field gamma\n" << endl;
- volScalarField gamma
+ Info<< "Reading field alpha1\n" << endl;
+ volScalarField alpha1
(
IOobject
(
- "gamma",
+ "alpha1",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
@@ -43,21 +43,21 @@
# include "createPhi.H"
Info<< "Reading transportProperties\n" << endl;
- twoPhaseMixture twoPhaseProperties(U, phi, "gamma");
-
+ twoPhaseMixture twoPhaseProperties(U, phi);
+
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
dimensionedScalar Dab(twoPhaseProperties.lookup("Dab"));
// Need to store rho for ddt(rho, U)
- volScalarField rho("rho", gamma*rho1 + (scalar(1) - gamma)*rho2);
+ volScalarField rho("rho", alpha1*rho1 + (scalar(1) - alpha1)*rho2);
rho.oldTime();
// Mass flux
// Initialisation does not matter because rhoPhi is reset after the
- // gamma solution before it is used in the U equation.
+ // alpha1 solution before it is used in the U equation.
surfaceScalarField rhoPhi
(
IOobject
@@ -73,9 +73,31 @@
Info<< "Calculating field g.h\n" << endl;
+ volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("gh", g & mesh.Cf());
+ volScalarField p
+ (
+ IOobject
+ (
+ "p",
+ runTime.timeName(),
+ mesh,
+ IOobject::NO_READ,
+ IOobject::AUTO_WRITE
+ ),
+ pd + rho*gh
+ );
+
+
label pdRefCell = 0;
scalar pdRefValue = 0.0;
setRefCell(pd, mesh.solutionDict().subDict("PISO"), pdRefCell, pdRefValue);
+
+
+ // Construct incompressible turbulence model
+ autoPtr turbulence
+ (
+ incompressible::turbulenceModel::New(U, phi, twoPhaseProperties)
+ );
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/gammaEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/gammaEqn.H
deleted file mode 100644
index 144339f398..0000000000
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/gammaEqn.H
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- fvScalarMatrix gammaEqn
- (
- fvm::ddt(gamma)
- + fvm::div(phi, gamma)
- - fvm::laplacian(Dab, gamma)
- );
-
- gammaEqn.solve();
-
- rhoPhi = gammaEqn.flux()*(rho1 - rho2) + phi*rho2;
- rho = gamma*rho1 + (scalar(1) - gamma)*rho2;
-
- Info<< "Phase 1 volume fraction = "
- << gamma.weightedAverage(mesh.V()).value()
- << " Min(gamma) = " << min(gamma).value()
- << " Max(gamma) = " << max(gamma).value()
- << endl;
-}
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C
index 64895530f6..7f9b32a917 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C
@@ -28,10 +28,13 @@ Application
Description
Solver for mixing 2 incompressible fluids.
+ Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
+
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "twoPhaseMixture.H"
+#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -58,7 +61,7 @@ int main(int argc, char *argv[])
twoPhaseProperties.correct();
-# include "gammaEqn.H"
+# include "alphaEqn.H"
# include "UEqn.H"
@@ -70,6 +73,10 @@ int main(int argc, char *argv[])
# include "continuityErrs.H"
+ p = pd + rho*gh;
+
+ turbulence->correct();
+
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
diff --git a/applications/test/HashSet/hashSetTest.C b/applications/test/HashSet/hashSetTest.C
index 386839a497..350a656743 100644
--- a/applications/test/HashSet/hashSetTest.C
+++ b/applications/test/HashSet/hashSetTest.C
@@ -26,7 +26,8 @@ Description
\*---------------------------------------------------------------------------*/
-#include "labelHashSet.H"
+#include "HashSet.H"
+#include "Map.H"
using namespace Foam;
@@ -35,19 +36,80 @@ using namespace Foam;
int main(int argc, char *argv[])
{
- HashSet testSet(0);
+ wordHashSet setA(0);
+ HashTable tableA;
- testSet.insert("kjhk");
- testSet.insert("kjhk2");
+ HashTable tableB;
+ Map mapA;
- Info<< testSet << endl;
+ setA.insert("kjhk");
+ setA.insert("kjhk2");
- labelHashSet testLabelHashSet(1);
+ tableA.insert("value1", 1);
+ tableA.insert("value2", 2);
+ tableA.insert("value3", 3);
- testLabelHashSet.insert(11);
- testLabelHashSet.insert(42);
+ tableB.insert("value4", empty());
+ tableB.insert("value5", empty());
+ tableB.insert("value6", empty());
- Info<< testLabelHashSet << endl;
+ mapA.set(1, 1);
+ mapA.set(2, 2);
+ mapA.set(3, 3);
+ mapA.set(4, 4);
+
+ Info<< setA << endl;
+ Info<< tableA << endl;
+ Info<< mapA << endl;
+
+ Info<< "create from HashSet: ";
+ Info<< wordHashSet(setA) << endl;
+ Info<< "create from HashTable: ";
+ Info<< wordHashSet(tableA) << endl;
+ Info<< "create from HashTable: ";
+ Info<< wordHashSet(tableB) << endl;
+
+ Info<< "create from Map: ";
+ Info<< labelHashSet(mapA) << endl;
+
+ Info<<"combined toc: "
+ << (wordHashSet(setA) | wordHashSet(tableA) | wordHashSet(tableB))
+ << nl;
+
+
+ labelHashSet setB(1);
+ setB.insert(11);
+ setB.insert(42);
+
+ Info<< "setB : " << setB << endl;
+
+ labelHashSet setC(1);
+ setC.insert(2008);
+ setC.insert(1984);
+
+ Info<< "setC : " << setC << endl;
+
+ labelHashSet setD(1);
+ setD.insert(11);
+ setD.insert(100);
+ setD.insert(2008);
+
+ Info<< "setD : " << setD << endl;
+
+ Info<< "setB == setC: " << (setB == setC) << endl;
+ Info<< "setC != setD: " << (setC != setD) << endl;
+
+ // test operations
+ setB += setC;
+ Info<< "setB += setC : " << setB << endl;
+
+ setB &= setD;
+ Info<< "setB &= setD : " << setB << endl;
+
+ Info<< "setB : " << setB << endl;
+ Info<< "setC : " << setC << endl;
+ Info<< "setD : " << setD << endl;
+ Info<< "setB ^ setC ^ setD : " << (setB ^ setC ^ setD) << endl;
return 0;
}
diff --git a/applications/test/sort/sortListTest.C b/applications/test/sort/sortListTest.C
index 441e093319..89252ae1f3 100644
--- a/applications/test/sort/sortListTest.C
+++ b/applications/test/sort/sortListTest.C
@@ -26,7 +26,7 @@ Description
\*---------------------------------------------------------------------------*/
-#include "labelList.H"
+#include "SortableList.H"
using namespace Foam;
@@ -35,16 +35,40 @@ using namespace Foam;
int main(int argc, char *argv[])
{
- labelList a(5);
- a[0] = 7;
- a[1] = 4;
- a[2] = 1;
- a[3] = 2;
- a[4] = 9;
+ labelList orig(5);
+ orig[0] = 7;
+ orig[1] = 4;
+ orig[2] = 1;
+ orig[3] = 2;
+ orig[4] = 9;
+ labelList a(orig);
Info << "before: " << a << endl;
sort(a);
- Info << "after: " << a << endl;
+ Info << "after: " << a << endl;
+
+ SortableList b(orig);
+ Info << "sorted: " << b << endl;
+ Info << "indices: " << b.indices() << endl;
+
+ Info << "shrunk: " << b.shrink() << endl;
+ Info << "indices: " << b.indices() << endl;
+
+ // repeat by assignment
+ b = orig;
+ Info << "unsorted: " << b << endl;
+ b.sort();
+
+ Info << "sorted: " << b << endl;
+ Info << "indices: " << b.indices() << endl;
+
+ // transfer assignment
+ b.transfer(orig);
+ Info << "unsorted: " << b << endl;
+ b.sort();
+
+ Info << "sorted: " << b << endl;
+ Info << "indices: " << b.indices() << endl;
Info << "End\n" << endl;
diff --git a/applications/test/tmpField/tmpFieldTest.C b/applications/test/tmpField/tmpFieldTest.C
index f0745e6da4..4c9298874c 100644
--- a/applications/test/tmpField/tmpFieldTest.C
+++ b/applications/test/tmpField/tmpFieldTest.C
@@ -23,8 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
-
+ tmpFieldTest
+
Description
+ Tests for possible memory leaks in the tmp algebra.
\*---------------------------------------------------------------------------*/
@@ -44,9 +46,6 @@ int main()
f1 = f2 + f3 + f2 + f3;
}
-// Info<< f1 << endl;
-
-
Info<< "end" << endl;
}
diff --git a/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C b/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C
index 306c4eab6b..e2108d220b 100644
--- a/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C
+++ b/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C
@@ -206,9 +206,9 @@ int main(int argc, char *argv[])
runTime.timeName(),
runTime
),
- mesh.points(),
- mesh.faces(),
- mesh.cells()
+ xferCopy(mesh.points()), // could we safely re-use the data?
+ xferCopy(mesh.faces()),
+ xferCopy(mesh.cells())
);
// Add the boundary patches
diff --git a/applications/utilities/mesh/conversion/Optional/Allwmake b/applications/utilities/mesh/conversion/Optional/Allwmake
index 2734e41562..ae71b400fa 100755
--- a/applications/utilities/mesh/conversion/Optional/Allwmake
+++ b/applications/utilities/mesh/conversion/Optional/Allwmake
@@ -7,14 +7,12 @@ set -x
# build libccmio and create lnInclude directory
-(
- cd $WM_THIRD_PARTY_DIR && ./AllwmakeLibccmio
-)
+( cd $WM_THIRD_PARTY_DIR && ./AllwmakeLibccmio )
-# if the library built okay, the headers should exist too
+# if the library built properly, the headers should exist too
if [ -e $FOAM_LIBBIN/libccmio.so ]
then
- wmake ccm26ToFoam
+ wmake ccm26ToFoam
fi
# ----------------------------------------------------------------- end-of-file
diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L
index be9cdc8537..5f0c239a9f 100644
--- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L
+++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L
@@ -281,7 +281,7 @@ int main(int argc, char *argv[])
)
{
// Scale points for the given scale factor
- points[i++] = scaleFactor*pointIter();
+ points[i++] = scaleFactor * pointIter();
}
@@ -479,7 +479,7 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- points,
+ xferMove(points),
cellShapes,
boundary,
patchNames,
diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C
index 55e870e37a..b10217f4f2 100644
--- a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C
+++ b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C
@@ -727,7 +727,7 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- points,
+ xferMove(points),
cellShapes,
boundary,
patchNames,
diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
index 46eb810e05..d114749b1c 100644
--- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
+++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
@@ -54,7 +54,10 @@ using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Scalae factor used to scale points (optional command line argument)
+// Line number
+label lineNo = 1;
+
+// Scale factor used to scale points (optional command line argument)
scalar scaleFactor = 1.0;
label dimensionOfGrid = 0;
@@ -131,8 +134,6 @@ one_space [ \t\f]
space {one_space}*
some_space {one_space}+
cspace ","{space}
-nl (\n|\r)
-spaceNl ({space}|{nl})*
alpha [_[:alpha:]]
digit [[:digit:]]
@@ -146,7 +147,7 @@ quote \"
dash "-"
dotColonDash [.:-]
-schemeSpecialInitial [!$%&*/\\:<=>?~_^#.@]
+schemeSpecialInitial [!$%&*/\\:<=>?~_^#.@']
schemeSpecialSubsequent [.+-]
schemeSymbol (({some_space}|{alpha}|{quote}|{schemeSpecialInitial})({alpha}|{quote}|{digit}|{schemeSpecialInitial}|{schemeSpecialSubsequent})*)
@@ -187,23 +188,23 @@ time ({digit}{digit}":"{digit}{digit}":"{digit}{digit})
versionNumber ({digit}|".")*
-header {spaceNl}"(1"{space}
-dimension {spaceNl}"(2"{space}
-points {spaceNl}"(10"{space}
-faces {spaceNl}"(13"{space}
-cells {spaceNl}"(12"{space}
-zoneVariant1 {spaceNl}"(39"{space}
-zoneVariant2 {spaceNl}"(45"{space}
-faceTree {spaceNl}"(59"{space}
+header {space}"(1"{space}
+dimension {space}"(2"{space}
+points {space}"(10"{space}
+faces {space}"(13"{space}
+cells {space}"(12"{space}
+zoneVariant1 {space}"(39"{space}
+zoneVariant2 {space}"(45"{space}
+faceTree {space}"(59"{space}
comment "0"{space}
unknownPeriodicFace "17"{space}
periodicFace "18"{space}
cellTree "58"{space}
faceParents "61"{space}
-ignoreBlocks ("4"|"37"|"38"|"41"|"60"|"64"){space}
+ignoreBlocks ("4"|"37"|"38"|"40"|"41"|"60"|"64"){space}
-redundantBlock {spaceNl}({comment}|{unknownPeriodicFace}|{periodicFace}|{cellTree}|{faceParents}|{ignoreBlocks}){space}
+redundantBlock {space}({comment}|{unknownPeriodicFace}|{periodicFace}|{cellTree}|{faceParents}|{ignoreBlocks}){space}
endOfSection {space}")"{space}
@@ -290,7 +291,7 @@ endOfSection {space}")"{space}
BEGIN(readPointHeader);
}
-{spaceNl}{lbrac}{space}"0"{space}"1"{space} {
+{space}{lbrac}{space}"0"{space}"1"{space} {
BEGIN(readNumberOfPoints);
}
@@ -302,7 +303,7 @@ endOfSection {space}")"{space}
// Ignore rest of stream
}
-{spaceNl}{lbrac} {
+{space}{lbrac} {
BEGIN(readPointGroupData);
}
@@ -342,7 +343,7 @@ endOfSection {space}")"{space}
BEGIN(readPointData);
}
-{spaceNl}{lbrac}{spaceNl} {
+{space}{lbrac}{space} {
Info<< ". Reading points..." << flush;
cmpt = 0;
yy_push_state(readScalarList);
@@ -350,19 +351,32 @@ endOfSection {space}")"{space}
{signedInteger}{space} {
points[pointi][cmpt++] = scaleFactor*atol(YYText());
+
+ if (cmpt == pointGroupNumberOfComponents)
+ {
+ if (pointGroupNumberOfComponents == 2)
+ {
+ points[pointi].z() = 0.0;
+ }
+
+ cmpt = 0;
+ pointi++;
+ }
}
{scalar}{space} {
points[pointi][cmpt++] = scaleFactor*atof(YYText());
- }
-{spaceNl} {
- if (pointGroupNumberOfComponents == 2)
+ if (cmpt == pointGroupNumberOfComponents)
{
- points[pointi].z() = 0.0;
+ if (pointGroupNumberOfComponents == 2)
+ {
+ points[pointi].z() = 0.0;
+ }
+
+ cmpt = 0;
+ pointi++;
}
- cmpt = 0;
- pointi++;
}
{endOfSection} {
@@ -372,12 +386,13 @@ endOfSection {space}")"{space}
if (pointi != pointGroupEndIndex[pointGroupEndIndex.size()-1]+1)
{
Warning
- << "Problem with reading points: "
- << "start index: "
+ << "Problem with reading points: " << nl
+ << " start index: "
<< pointGroupStartIndex[pointGroupStartIndex.size()-1]
<< " end index: "
<< pointGroupEndIndex[pointGroupEndIndex.size()-1]
- << " last points read: " << pointi << endl;
+ << " last points read: " << pointi << nl
+ << " on line " << lineNo << endl;
}
yy_pop_state();
@@ -387,7 +402,7 @@ endOfSection {space}")"{space}
BEGIN(readFaceHeader);
}
-{spaceNl}{lbrac}{space}"0"{space}"1"{space} {
+{space}{lbrac}{space}"0"{space}"1"{space} {
BEGIN(readNumberOfFaces);
}
@@ -403,7 +418,7 @@ endOfSection {space}")"{space}
// Type and element type not read
}
-{spaceNl}{lbrac} {
+{space}{lbrac} {
BEGIN(readFaceGroupData);
}
@@ -431,12 +446,12 @@ endOfSection {space}")"{space}
<< faceGroupEndIndex[faceGroupEndIndex.size()-1] << flush;
}
-{spaceNl}{endOfSection} {
+{space}{endOfSection} {
BEGIN(readFaceData);
}
-{spaceNl}{lbrac} {
- if (faceGroupElementType == 0)
+{space}{lbrac} {
+ if (faceGroupElementType == 0 || faceGroupElementType > 4)
{
Info<< ". Reading mixed faces..." << flush;
yy_push_state(readFacesMixed);
@@ -448,7 +463,7 @@ endOfSection {space}")"{space}
}
}
-{spaceNl}{hexLabelList} {
+{space}{hexLabelList} {
face& curFaceLabels = faces[facei];
// set size of label list
@@ -465,7 +480,7 @@ endOfSection {space}")"{space}
facei++;
}
-{spaceNl}{hexLabelList} {
+{space}{hexLabelList} {
face& curFaceLabels = faces[facei];
// Set size of label list.
@@ -484,19 +499,20 @@ endOfSection {space}")"{space}
facei++;
}
-{spaceNl}{endOfSection} {
+{space}{endOfSection} {
Info<< "done." << endl;
// check read of fluentFaces
if (facei != faceGroupEndIndex[faceGroupEndIndex.size()-1]+1)
{
Warning
- << "Problem with reading fluentFaces: "
- << "start index: "
+ << "Problem with reading fluentFaces: " << nl
+ << " start index: "
<< faceGroupStartIndex[faceGroupStartIndex.size()-1]
<< " end index: "
<< faceGroupEndIndex[faceGroupEndIndex.size()-1]
- << " last fluentFaces read: " << facei << endl;
+ << " last fluentFaces read: " << facei << nl
+ << " on line " << lineNo << endl;
}
yy_pop_state();
@@ -507,7 +523,7 @@ endOfSection {space}")"{space}
BEGIN(readCellHeader);
}
-{spaceNl}{lbrac}{space}"0"{space}"1"{space} {
+{space}{lbrac}{space}"0"{space}"1"{space} {
BEGIN(readNumberOfCells);
}
@@ -516,7 +532,7 @@ endOfSection {space}")"{space}
Info<< "Number of cells: " << nCells << endl;
}
-{spaceNl}{lbrac} {
+{space}{lbrac} {
BEGIN(readCellGroupData);
}
@@ -526,7 +542,8 @@ endOfSection {space}")"{space}
// non-standard cell definition from Tgrid, which misses the type label.
Warning
- << "Tgrid syntax problem: " << YYText() << endl;
+ << "Tgrid syntax problem: " << YYText() << nl
+ << " on line " << lineNo << endl;
// read cell zone-ID, start and end-label
cellGroupZoneID.append(strtol(YYText(), &endPtr, 16));
@@ -580,7 +597,7 @@ endOfSection {space}")"{space}
BEGIN(readCellData);
}
-{spaceNl}{lbrac} {
+{space}{lbrac} {
// Quickly scan to the end of the cell data block and discard
register int c;
while ((c = yyinput()) != 0 && c != ')')
@@ -601,7 +618,7 @@ endOfSection {space}")"{space}
BEGIN(readZoneHeader);
}
-{spaceNl}{lbrac} {
+{space}{lbrac} {
BEGIN(readZoneGroupData);
}
@@ -623,17 +640,18 @@ endOfSection {space}")"{space}
BEGIN(readZoneData);
}
-{spaceNl}{lbrac} {
+{space}{lbrac} {
Info<< ". Reading zone data..." << flush;
yy_push_state(readZoneBlock);
}
-{spaceNl}{schemeSymbolList} {
+{space}{schemeSymbolList} {
}
{lbrac} {
- Warning
- << "Found unknown block in zone: " << YYText() << endl;
+ //Warning
+ // << "Found unknown block in zone: " << YYText() << nl
+ // << " on line " << lineNo << endl;
yy_push_state(ignoreBlock);
}
@@ -646,7 +664,7 @@ endOfSection {space}")"{space}
/* ------ Reading end of section and others ------ */
-{spaceNl}{endOfSection} {
+{space}{endOfSection} {
BEGIN(INITIAL);
}
@@ -655,7 +673,8 @@ endOfSection {space}")"{space}
{lbrac}{label} {
Warning
<< "Found unknown block of type: "
- << Foam::string(YYText())(1, YYLeng()-1) << endl;
+ << Foam::string(YYText())(1, YYLeng()-1) << nl
+ << " on line " << lineNo << endl;
yy_push_state(ignoreBlock);
}
@@ -664,40 +683,47 @@ endOfSection {space}")"{space}
yy_push_state(ignoreBlock);
}
-{spaceNl}{quote}{text}{quote} {
+{space}{quote}{text}{quote} {
}
-{spaceNl}{schemeSymbol} {
+{space}{schemeSymbol} {
}
-{spaceNl}{lbrac} {
+{space}{lbrac} {
yy_push_state(ignoreEmbeddedBlock);
}
-{spaceNl}{endOfSection} {
+{space}{endOfSection} {
yy_pop_state();
}
-{spaceNl}{labelList} {
+{space}{labelList} {
}
-{spaceNl}{hexLabelList} {
+{space}{hexLabelList} {
}
-{spaceNl}{scalarList} {
+{space}{scalarList} {
}
-{spaceNl}{schemeSymbolList} {
+{space}{schemeSymbolList} {
}
-{spaceNl}{text} {
+{space}{text} {
}
- /* ------ Ignore remaining space and \n s. ------ */
+ /* ------ Count newlines. ------ */
-<*>{some_space}|\n|\r {
+<*>\n {
+ lineNo++;
+ }
+
+
+ /* ------ Ignore remaining space. ------ */
+
+<*>{some_space}|\r {
}
@@ -706,7 +732,8 @@ endOfSection {space}")"{space}
<*>. {
// This is a catch all.
FatalErrorIn("fluentMeshToFoam::lexer")
- << "Do not understand characters: " << YYText()
+ << "Do not understand characters: " << YYText() << nl
+ << " on line " << lineNo
<< exit(FatalError);
}
@@ -856,10 +883,10 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- pointField(0),
- faceList(0),
- labelList(0),
- labelList(0)
+ xferCopy(pointField()),
+ xferCopy(faceList()),
+ xferCopy(labelList()),
+ xferCopy(labelList())
);
@@ -882,11 +909,8 @@ int main(int argc, char *argv[])
// Check the face groups for boundary patches, baffles and faceZones
// ignoring the interior zones in ignoreCellGroups
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- label nPatches = 0;
- labelList patchIDs(faceGroupZoneID.size());
-
- label nFaceZones = 0;
- labelList faceZoneIDs(faceGroupZoneID.size());
+ DynamicList patchIDs(faceGroupZoneID.size());
+ DynamicList faceZoneIDs(faceGroupZoneID.size());
forAll(faceGroupZoneID, fgi)
{
@@ -900,13 +924,13 @@ int main(int argc, char *argv[])
// Check the first element of neighbour for boundary group
if (neighbour[start] == -1 || fluentGroupToFoamPatch.found(type))
{
- patchIDs[nPatches++] = fgi;
+ patchIDs.append(fgi);
}
else
{
if (!ignoreFaceGroups.found(groupName[faceGroupZoneID[fgi] ]))
{
- faceZoneIDs[nFaceZones++] = fgi;
+ faceZoneIDs.append(fgi);
}
}
}
@@ -928,20 +952,32 @@ int main(int argc, char *argv[])
}
else
{
- FatalErrorIn(args.executable())
- << "Unknown FaceGroup " << zoneID << " not in a zone"
- << exit(FatalError);
+ if (neighbour[start] == -1)
+ {
+ // Boundary face in unknown group. Create a patch for it.
+ groupType.insert(zoneID, "unknown");
+ groupName.insert(zoneID, "FaceGroup" + Foam::name(zoneID));
+ patchIDs.append(fgi);
+ Info<< "Created patch " << fgi << " for unknown FaceGroup "
+ << zoneID << '.' << endl;
+ }
+ else
+ {
+ WarningIn(args.executable())
+ << "Unknown FaceGroup " << zoneID << " not in a zone"
+ << endl;
+ }
}
}
- patchIDs.setSize(nPatches);
- faceZoneIDs.setSize(nFaceZones);
+ patchIDs.shrink();
+ faceZoneIDs.shrink();
// Add empty patches
// ~~~~~~~~~~~~~~~~~
- List newPatches(nPatches);
+ List newPatches(patchIDs.size());
HashSet patchNames;
forAll(patchIDs, patchi)
@@ -1024,7 +1060,7 @@ int main(int argc, char *argv[])
}
// Face zones
- mesh.faceZones().setSize(nFaceZones);
+ mesh.faceZones().setSize(faceZoneIDs.size());
HashSet faceZoneNames;
forAll(faceZoneIDs, faceZonei)
@@ -1098,6 +1134,8 @@ int main(int argc, char *argv[])
}
+ bool doneWarning = false;
+
// Add faceZone faces
forAll(faceZoneIDs, faceZonei)
{
@@ -1113,19 +1151,36 @@ int main(int argc, char *argv[])
for (label facei = start; facei <= end; facei++)
{
- meshMod.addFace
- (
- faces[facei],
- owner[facei],
- neighbour[facei],
- -1, // masterPointID
- -1, // masterEdgeID
- facei, // masterFace
- false, // flipFaceFlux
- -1, // patchID
- faceZonei, // zoneID
- false // zoneFlip
- );
+ if (owner[facei] >= nCells || neighbour[facei] >= nCells)
+ {
+ if (!doneWarning)
+ {
+ WarningIn(args.executable())
+ << "Ignoring internal face " << facei
+ << " on FaceZone " << zoneID
+ << " since owner " << owner[facei] << " or neighbour "
+ << neighbour[facei] << " outside range of cells 0.."
+ << nCells-1 << endl
+ << " Suppressing future warnings." << endl;
+ doneWarning = true;
+ }
+ }
+ else
+ {
+ meshMod.addFace
+ (
+ faces[facei],
+ owner[facei],
+ neighbour[facei],
+ -1, // masterPointID
+ -1, // masterEdgeID
+ facei, // masterFace
+ false, // flipFaceFlux
+ -1, // patchID
+ faceZonei, // zoneID
+ false // zoneFlip
+ );
+ }
// Mark face as being done
owner[facei] = -1;
@@ -1147,27 +1202,26 @@ int main(int argc, char *argv[])
for (label facei = start; facei <= end; facei++)
{
- meshMod.addFace
- (
- faces[facei],
- owner[facei],
- -1,
- -1, // masterPointID
- -1, // masterEdgeID
- facei, // masterFace
- false, // flipFaceFlux
- patchi, // patchID
- -1, // zoneID
- false // zoneFlip
- );
-
- // For baffles create the opposite face
- if (neighbour[start] != -1)
+ if (owner[facei] >= nCells || neighbour[facei] >= nCells)
+ {
+ if (!doneWarning)
+ {
+ WarningIn(args.executable())
+ << "Ignoring patch face " << facei
+ << " on FaceZone " << zoneID
+ << " since owner " << owner[facei] << " or neighbour "
+ << neighbour[facei] << " outside range of cells 0.."
+ << nCells-1 << endl
+ << " Suppressing future warnings." << endl;
+ doneWarning = true;
+ }
+ }
+ else
{
meshMod.addFace
(
- faces[facei].reverseFace(),
- neighbour[facei],
+ faces[facei],
+ owner[facei],
-1,
-1, // masterPointID
-1, // masterEdgeID
@@ -1177,8 +1231,25 @@ int main(int argc, char *argv[])
-1, // zoneID
false // zoneFlip
);
- }
+ // For baffles create the opposite face
+ if (neighbour[start] != -1)
+ {
+ meshMod.addFace
+ (
+ faces[facei].reverseFace(),
+ neighbour[facei],
+ -1,
+ -1, // masterPointID
+ -1, // masterEdgeID
+ facei, // masterFace
+ false, // flipFaceFlux
+ patchi, // patchID
+ -1, // zoneID
+ false // zoneFlip
+ );
+ }
+ }
// Mark face as being done
owner[facei] = -1;
}
@@ -1198,19 +1269,35 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
- meshMod.addFace
- (
- faces[facei],
- owner[facei],
- neighbour[facei],
- -1, //masterPointID
- -1, //masterEdgeID
- facei, //masterFace
- false, //flipFaceFlux
- -1, //patchID
- -1, //zoneID
- false //zoneFlip
- );
+ if (owner[facei] >= nCells || neighbour[facei] >= nCells)
+ {
+ if (!doneWarning)
+ {
+ WarningIn(args.executable())
+ << "Ignoring internal face " << facei
+ << " since owner " << owner[facei] << " or neighbour "
+ << neighbour[facei] << " outside range of cells 0.."
+ << nCells-1 << endl
+ << " Suppressing future warnings." << endl;
+ doneWarning = true;
+ }
+ }
+ else
+ {
+ meshMod.addFace
+ (
+ faces[facei],
+ owner[facei],
+ neighbour[facei],
+ -1, //masterPointID
+ -1, //masterEdgeID
+ facei, //masterFace
+ false, //flipFaceFlux
+ -1, //patchID
+ -1, //zoneID
+ false //zoneFlip
+ );
+ }
}
}
diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L
index 39aa6d2159..97dfe395db 100644
--- a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L
+++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L
@@ -1158,7 +1158,7 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- points,
+ xferMove(points),
cellShapes,
patches,
patchNames,
diff --git a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L
index f4061e2a66..d3c178c9ab 100644
--- a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L
+++ b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L
@@ -851,7 +851,7 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- points,
+ xferMove(points),
cells,
boundary,
patchNames,
diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C
index 855c69cc95..a2628027ff 100644
--- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C
+++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C
@@ -38,7 +38,7 @@ Description
fluentMeshWithInternalFaces).
A use of the cell zone information, is for field initialization with the
- "setFields" utility. see the classes: topoSetSource, zoneToCell.
+ "setFields" utility. see the classes: topoSetSource, zoneToCell.
\*---------------------------------------------------------------------------*/
#include "argList.H"
@@ -166,7 +166,7 @@ label findInternalFace(const primitiveMesh& mesh, const labelList& meshF)
if (nMatched == meshF.size())
{
return faceI;
- }
+ }
}
return -1;
}
@@ -835,7 +835,7 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- points,
+ xferMove(points),
cells,
boundaryFaces,
boundaryPatchNames,
@@ -951,7 +951,7 @@ int main(int argc, char *argv[])
{
zoneName = iter();
}
-
+
Info<< "Writing zone " << zoneI << " to cellZone "
<< zoneName << " and cellSet"
<< endl;
diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
index c651d542c5..eeca6fbcb1 100644
--- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
+++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
@@ -572,6 +572,7 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append(".unv file");
+ argList::validOptions.insert("dump", "");
# include "setRootCase.H"
# include "createTime.H"
@@ -806,7 +807,7 @@ int main(int argc, char *argv[])
forAll(dynPatchFaces, patchI)
{
- patchFaceVerts[patchI].transfer(dynPatchFaces[patchI].shrink());
+ patchFaceVerts[patchI].transfer(dynPatchFaces[patchI]);
}
}
else
@@ -845,13 +846,13 @@ int main(int argc, char *argv[])
pointField polyPoints;
polyPoints.transfer(points);
- points.clear();
// Length scaling factor
polyPoints /= lengthScale;
// For debugging: dump boundary faces as triSurface
+ if (args.options().found("dump"))
{
DynamicList triangles(boundaryFaces.size());
@@ -887,7 +888,6 @@ int main(int argc, char *argv[])
}
-
Info<< "Constructing mesh with non-default patches of size:" << nl;
forAll(patchNames, patchI)
{
@@ -907,14 +907,14 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- polyPoints,
+ xferMove(polyPoints),
cellVerts,
- patchFaceVerts, //boundaryFaces,
- patchNames, //boundaryPatchNames,
- wordList(patchNames.size(), polyPatch::typeName), //boundaryPatchTypes,
- "defaultFaces", //defaultFacesName
- polyPatch::typeName, //defaultFacesType,
- wordList(0) //boundaryPatchPhysicalTypes
+ patchFaceVerts, // boundaryFaces,
+ patchNames, // boundaryPatchNames,
+ wordList(patchNames.size(), polyPatch::typeName), // boundaryPatchTypes,
+ "defaultFaces", // defaultFacesName
+ polyPatch::typeName, // defaultFacesType,
+ wordList(0) // boundaryPatchPhysicalTypes
);
mesh.write();
diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H
index b264214b8c..d315dce4a0 100644
--- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H
+++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H
@@ -576,7 +576,7 @@ polyMesh pShapeMesh
runTime.constant(),
runTime
),
- points,
+ xferMove(points),
cellShapes,
boundary,
patchNames,
diff --git a/applications/utilities/mesh/conversion/mshToFoam/mshToFoam.C b/applications/utilities/mesh/conversion/mshToFoam/mshToFoam.C
index efed09a588..2b955528a6 100644
--- a/applications/utilities/mesh/conversion/mshToFoam/mshToFoam.C
+++ b/applications/utilities/mesh/conversion/mshToFoam/mshToFoam.C
@@ -140,7 +140,7 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- points,
+ xferMove(points),
cells,
faceListList(0),
wordList(0),
@@ -153,7 +153,7 @@ int main(int argc, char *argv[])
Info<< "Writing mesh ..." << endl;
mesh.write();
-
+
Info<< "End\n" << endl;
diff --git a/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C b/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C
index d3cca93352..f290e7fa42 100644
--- a/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C
+++ b/applications/utilities/mesh/conversion/netgenNeutralToFoam/netgenNeutralToFoam.C
@@ -306,7 +306,7 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- points,
+ xferMove(points),
cells,
patchFaces,
patchNames,
diff --git a/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C b/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C
index 6e81ff9f0b..b4d348c376 100644
--- a/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C
+++ b/applications/utilities/mesh/conversion/plot3dToFoam/plot3dToFoam.C
@@ -232,7 +232,7 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- newPoints,
+ xferMove(newPoints),
cellShapes,
boundary,
patchNames,
diff --git a/applications/utilities/mesh/conversion/sammToFoam/writeMesh.C b/applications/utilities/mesh/conversion/sammToFoam/writeMesh.C
index 6133e22c83..2d69dbc6dc 100644
--- a/applications/utilities/mesh/conversion/sammToFoam/writeMesh.C
+++ b/applications/utilities/mesh/conversion/sammToFoam/writeMesh.C
@@ -47,7 +47,7 @@ void sammMesh::writeMesh()
runTime_.constant(),
runTime_
),
- points_,
+ xferCopy(points_), // we could probably re-use the data
cellShapes_,
boundary_,
patchNames_,
@@ -76,9 +76,9 @@ void sammMesh::writeMesh()
runTime_.constant(),
runTime_
),
- points_,
- meshFaces_,
- cellPolys_
+ xferCopy(points_), // we could probably re-use the data
+ xferCopy(meshFaces_),
+ xferCopy(cellPolys_)
);
pMesh.addPatches(polyBoundaryPatches(pMesh));
diff --git a/applications/utilities/mesh/conversion/starToFoam/writeMesh.C b/applications/utilities/mesh/conversion/starToFoam/writeMesh.C
index a369e0c313..dedbe07bb6 100644
--- a/applications/utilities/mesh/conversion/starToFoam/writeMesh.C
+++ b/applications/utilities/mesh/conversion/starToFoam/writeMesh.C
@@ -51,7 +51,7 @@ void starMesh::writeMesh()
runTime_.constant(),
runTime_
),
- points_,
+ xferCopy(points_), // we could probably re-use the data
cellShapes_,
boundary_,
patchNames_,
@@ -82,9 +82,9 @@ void starMesh::writeMesh()
runTime_.constant(),
runTime_
),
- points_,
- meshFaces_,
- cellPolys_
+ xferCopy(points_), // we could probably re-use the data
+ xferCopy(meshFaces_),
+ xferCopy(cellPolys_)
);
// adding patches also checks the mesh
diff --git a/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C b/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C
index 1e50ccee0b..e99bca0af1 100644
--- a/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C
+++ b/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C
@@ -322,11 +322,11 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- points,
+ xferCopy(points),
cells,
faceListList(0),
- wordList(0), //boundaryPatchNames
- wordList(0), //boundaryPatchTypes
+ wordList(0), // boundaryPatchNames
+ wordList(0), // boundaryPatchTypes
"defaultFaces",
polyPatch::typeName,
wordList(0)
@@ -531,7 +531,7 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- points,
+ xferMove(points),
cells,
patchFaces,
patchNames,
diff --git a/applications/utilities/mesh/generation/blockMesh/addOptions.H b/applications/utilities/mesh/generation/blockMesh/addOptions.H
deleted file mode 100644
index c9e07df5a6..0000000000
--- a/applications/utilities/mesh/generation/blockMesh/addOptions.H
+++ /dev/null
@@ -1,4 +0,0 @@
- argList::noParallel();
- argList::validOptions.insert("blockTopology", "");
- argList::validOptions.insert("dict", "dictionary");
-# include "addRegionOption.H"
diff --git a/applications/utilities/mesh/generation/blockMesh/block.C b/applications/utilities/mesh/generation/blockMesh/block.C
index 7ee15c4a6e..d2f0d67ab9 100644
--- a/applications/utilities/mesh/generation/blockMesh/block.C
+++ b/applications/utilities/mesh/generation/blockMesh/block.C
@@ -27,7 +27,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "error.H"
-
#include "block.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/utilities/mesh/generation/blockMesh/blockBoundary.C b/applications/utilities/mesh/generation/blockMesh/blockBoundary.C
index 39b45912df..ef176206fd 100644
--- a/applications/utilities/mesh/generation/blockMesh/blockBoundary.C
+++ b/applications/utilities/mesh/generation/blockMesh/blockBoundary.C
@@ -28,18 +28,12 @@ Description
\*---------------------------------------------------------------------------*/
#include "error.H"
-
#include "block.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-
-void block::blockBoundary()
+void Foam::block::blockBoundary()
{
label ni = blockDef_.n().x();
label nj = blockDef_.n().y();
@@ -212,9 +206,4 @@ void block::blockBoundary()
}
}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
// ************************************************************************* //
diff --git a/applications/utilities/mesh/generation/blockMesh/blockCells.C b/applications/utilities/mesh/generation/blockMesh/blockCells.C
index 95d3d1a700..7968d0c381 100644
--- a/applications/utilities/mesh/generation/blockMesh/blockCells.C
+++ b/applications/utilities/mesh/generation/blockMesh/blockCells.C
@@ -28,18 +28,11 @@ Description
\*---------------------------------------------------------------------------*/
#include "error.H"
-
#include "block.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-
-void block::blockCells()
+void Foam::block::blockCells()
{
label ni = blockDef_.n().x();
label nj = blockDef_.n().y();
@@ -69,9 +62,4 @@ void block::blockCells()
}
}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
// ************************************************************************* //
diff --git a/applications/utilities/mesh/generation/blockMesh/blockMesh.C b/applications/utilities/mesh/generation/blockMesh/blockMesh.C
index ebd8db02f2..c2a69b5475 100644
--- a/applications/utilities/mesh/generation/blockMesh/blockMesh.C
+++ b/applications/utilities/mesh/generation/blockMesh/blockMesh.C
@@ -32,21 +32,16 @@ Description
#include "blockMesh.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from IOdictionary
-blockMesh::blockMesh(IOdictionary& meshDescription)
+Foam::blockMesh::blockMesh(IOdictionary& meshDescription)
:
topologyPtr_(createTopology(meshDescription)),
- scale_(readScalar(meshDescription.lookup("convertToMeters"))),
blockOffsets_(createBlockOffsets()),
mergeList_(createMergeList()),
- points_(createPoints()),
+ points_(createPoints(meshDescription)),
cells_(createCells()),
patches_(createPatches())
{}
@@ -54,7 +49,7 @@ blockMesh::blockMesh(IOdictionary& meshDescription)
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
-blockMesh::~blockMesh()
+Foam::blockMesh::~blockMesh()
{
delete topologyPtr_;
}
@@ -62,7 +57,7 @@ blockMesh::~blockMesh()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
-const polyMesh& blockMesh::topology() const
+const Foam::polyMesh& Foam::blockMesh::topology() const
{
if (!topologyPtr_)
{
@@ -75,13 +70,7 @@ const polyMesh& blockMesh::topology() const
}
-const curvedEdgeList& blockMesh::edges() const
-{
- return edges_;
-}
-
-
-wordList blockMesh::patchNames() const
+Foam::wordList Foam::blockMesh::patchNames() const
{
const polyPatchList& patchTopologies = topology().boundaryMesh();
wordList names(patchTopologies.size());
@@ -95,7 +84,7 @@ wordList blockMesh::patchNames() const
}
-wordList blockMesh::patchTypes() const
+Foam::wordList Foam::blockMesh::patchTypes() const
{
const polyPatchList& patchTopologies = topology().boundaryMesh();
wordList types(patchTopologies.size());
@@ -109,7 +98,7 @@ wordList blockMesh::patchTypes() const
}
-wordList blockMesh::patchPhysicalTypes() const
+Foam::wordList Foam::blockMesh::patchPhysicalTypes() const
{
const polyPatchList& patchTopologies = topology().boundaryMesh();
wordList physicalTypes(patchTopologies.size());
@@ -123,7 +112,7 @@ wordList blockMesh::patchPhysicalTypes() const
}
-label blockMesh::numZonedBlocks() const
+Foam::label Foam::blockMesh::numZonedBlocks() const
{
label num = 0;
@@ -139,7 +128,7 @@ label blockMesh::numZonedBlocks() const
}
-void blockMesh::writeTopology(Ostream& os) const
+void Foam::blockMesh::writeTopology(Ostream& os) const
{
const pointField& pts = topology().points();
@@ -160,9 +149,4 @@ void blockMesh::writeTopology(Ostream& os) const
}
}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
// ************************************************************************* //
diff --git a/applications/utilities/mesh/generation/blockMesh/blockMesh.H b/applications/utilities/mesh/generation/blockMesh/blockMesh.H
index 808e93dad5..4114cb9619 100644
--- a/applications/utilities/mesh/generation/blockMesh/blockMesh.H
+++ b/applications/utilities/mesh/generation/blockMesh/blockMesh.H
@@ -62,8 +62,6 @@ class blockMesh
polyMesh* topologyPtr_;
- scalar scale_;
-
labelList blockOffsets_;
labelList mergeList_;
@@ -94,7 +92,7 @@ class blockMesh
labelList createBlockOffsets();
labelList createMergeList();
- pointField createPoints();
+ pointField createPoints(const dictionary&);
cellShapeList createCells();
faceList createPatchFaces(const polyPatch& patchTopologyFaces);
@@ -123,7 +121,10 @@ public:
const polyMesh& topology() const;
- const curvedEdgeList& edges() const;
+ const curvedEdgeList& edges() const
+ {
+ return edges_;
+ }
const pointField& points() const
{
diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
index e73a5262b9..f65e6b852e 100644
--- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
+++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
@@ -72,11 +72,11 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
-
-# include "addOptions.H"
+ argList::validOptions.insert("blockTopology", "");
+ argList::validOptions.insert("dict", "dictionary");
+# include "addRegionOption.H"
# include "setRootCase.H"
# include "createTime.H"
-# include "checkOptions.H"
word regionName;
fileName polyMeshDir;
@@ -117,6 +117,7 @@ int main(int argc, char *argv[])
}
}
+ bool writeTopo = args.options().found("blockTopology");
IOobject meshDictIo
(
@@ -139,7 +140,7 @@ int main(int argc, char *argv[])
}
Info<< nl << "Creating block mesh from\n "
- << meshDictIo.objectPath() << endl;
+ << meshDictIo.objectPath() << nl << endl;
IOdictionary meshDict(meshDictIo);
@@ -216,7 +217,7 @@ int main(int argc, char *argv[])
runTime.constant(),
runTime
),
- blocks.points(),
+ xferCopy(blocks.points()), // could we re-use space?
blocks.cells(),
blocks.patches(),
patchNames,
@@ -242,7 +243,7 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
- //#include "mergePatchPairs.H"
+ //// #include "mergePatchPairs.H"
}
else
{
@@ -316,7 +317,7 @@ int main(int argc, char *argv[])
{
label zoneI = iter();
- cz[zoneI]= new cellZone
+ cz[zoneI] = new cellZone
(
iter.key(),
zoneCells[zoneI].shrink(),
@@ -339,7 +340,7 @@ int main(int argc, char *argv[])
IOstream::defaultPrecision(10);
Info << nl << "Writing polyMesh" << endl;
- mesh.removeFiles(mesh.instance());
+ mesh.removeFiles();
if (!mesh.write())
{
FatalErrorIn(args.executable())
diff --git a/applications/utilities/mesh/generation/blockMesh/blockPoints.C b/applications/utilities/mesh/generation/blockMesh/blockPoints.C
index 2fecb21bf5..107b9d7fd8 100644
--- a/applications/utilities/mesh/generation/blockMesh/blockPoints.C
+++ b/applications/utilities/mesh/generation/blockMesh/blockPoints.C
@@ -28,17 +28,11 @@ Description
\*---------------------------------------------------------------------------*/
#include "error.H"
-
#include "block.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-void block::blockPoints()
+void Foam::block::blockPoints()
{
// set local variables for mesh specification
const label ni = blockDef_.n().x();
@@ -235,9 +229,4 @@ void block::blockPoints()
}
}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
// ************************************************************************* //
diff --git a/applications/utilities/mesh/generation/blockMesh/checkBlockMesh.C b/applications/utilities/mesh/generation/blockMesh/checkBlockMesh.C
index 3d093a46dc..ad78b6686c 100644
--- a/applications/utilities/mesh/generation/blockMesh/checkBlockMesh.C
+++ b/applications/utilities/mesh/generation/blockMesh/checkBlockMesh.C
@@ -28,16 +28,10 @@ Description
#include "blockMesh.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Check the blockMesh topology
-
-void blockMesh::checkBlockMesh(const polyMesh& bm)
+void Foam::blockMesh::checkBlockMesh(const polyMesh& bm)
{
Info<< nl << "Check block mesh topology" << endl;
@@ -148,9 +142,4 @@ void blockMesh::checkBlockMesh(const polyMesh& bm)
}
}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
// ************************************************************************* //
diff --git a/applications/utilities/mesh/generation/blockMesh/checkOptions.H b/applications/utilities/mesh/generation/blockMesh/checkOptions.H
deleted file mode 100644
index 902d96966f..0000000000
--- a/applications/utilities/mesh/generation/blockMesh/checkOptions.H
+++ /dev/null
@@ -1 +0,0 @@
- bool writeTopo = args.options().found("blockTopology");
diff --git a/applications/utilities/mesh/generation/blockMesh/createBlockOffsets.C b/applications/utilities/mesh/generation/blockMesh/createBlockOffsets.C
index dbe62491ad..f394b18c16 100644
--- a/applications/utilities/mesh/generation/blockMesh/createBlockOffsets.C
+++ b/applications/utilities/mesh/generation/blockMesh/createBlockOffsets.C
@@ -27,17 +27,11 @@ Description
\*---------------------------------------------------------------------------*/
#include "error.H"
-
#include "blockMesh.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-labelList blockMesh::createBlockOffsets()
+Foam::labelList Foam::blockMesh::createBlockOffsets()
{
Info<< nl << "Creating block offsets" << endl;
@@ -63,10 +57,4 @@ labelList blockMesh::createBlockOffsets()
return BlockOffsets;
}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
// ************************************************************************* //
-
diff --git a/applications/utilities/mesh/generation/blockMesh/createCells.C b/applications/utilities/mesh/generation/blockMesh/createCells.C
index ef6bb82891..e4792e416a 100644
--- a/applications/utilities/mesh/generation/blockMesh/createCells.C
+++ b/applications/utilities/mesh/generation/blockMesh/createCells.C
@@ -29,14 +29,9 @@ License
#include "blockMesh.H"
#include "cellModeller.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-cellShapeList blockMesh::createCells()
+Foam::cellShapeList Foam::blockMesh::createCells()
{
Info<< nl << "Creating cells" << endl;
@@ -76,10 +71,4 @@ cellShapeList blockMesh::createCells()
return cells;
}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
// ************************************************************************* //
-
diff --git a/applications/utilities/mesh/generation/blockMesh/createMergeList.C b/applications/utilities/mesh/generation/blockMesh/createMergeList.C
index f799905d63..b6e91a3ca0 100644
--- a/applications/utilities/mesh/generation/blockMesh/createMergeList.C
+++ b/applications/utilities/mesh/generation/blockMesh/createMergeList.C
@@ -26,14 +26,9 @@ License
#include "blockMesh.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-labelList blockMesh::createMergeList()
+Foam::labelList Foam::blockMesh::createMergeList()
{
Info<< nl << "Creating merge list " << flush;
@@ -277,7 +272,7 @@ labelList blockMesh::createMergeList()
if (cp[blockPfaceFacePointLabel] == -1)
{
FatalErrorIn("blockMesh::createMergeList()")
- << "Inconsistent point locations between block pair "
+ << "Inconsistent point locations between block pair "
<< blockPlabel << " and " << blockNlabel << nl
<< " probably due to inconsistent grading."
<< exit(FatalError);
@@ -561,9 +556,4 @@ labelList blockMesh::createMergeList()
return MergeList;
}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
// ************************************************************************* //
diff --git a/applications/utilities/mesh/generation/blockMesh/createPatches.C b/applications/utilities/mesh/generation/blockMesh/createPatches.C
index fddd51aa22..1594e1042e 100644
--- a/applications/utilities/mesh/generation/blockMesh/createPatches.C
+++ b/applications/utilities/mesh/generation/blockMesh/createPatches.C
@@ -29,14 +29,9 @@ Description
#include "blockMesh.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-faceList blockMesh::createPatchFaces
+Foam::faceList Foam::blockMesh::createPatchFaces
(
const polyPatch& patchTopologyFaces
)
@@ -157,7 +152,7 @@ faceList blockMesh::createPatchFaces
}
-faceListList blockMesh::createPatches()
+Foam::faceListList Foam::blockMesh::createPatches()
{
Info<< "\nCreating patches\n";
@@ -173,9 +168,4 @@ faceListList blockMesh::createPatches()
return patches;
}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
// ************************************************************************* //
diff --git a/applications/utilities/mesh/generation/blockMesh/createPoints.C b/applications/utilities/mesh/generation/blockMesh/createPoints.C
index 6f33edb435..01bb9a27f2 100644
--- a/applications/utilities/mesh/generation/blockMesh/createPoints.C
+++ b/applications/utilities/mesh/generation/blockMesh/createPoints.C
@@ -28,24 +28,26 @@ Description
\*---------------------------------------------------------------------------*/
#include "error.H"
-
#include "blockMesh.H"
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-pointField blockMesh::createPoints()
+Foam::pointField Foam::blockMesh::createPoints(const dictionary& dict)
{
- Info<< nl << "Creating points" << endl;
+ blockMesh& blocks = *this;
+
+ scalar scaleFactor = 1.0;
+
+ // optional 'convertToMeters' (or 'scale'?)
+ if (!dict.readIfPresent("convertToMeters", scaleFactor))
+ {
+ dict.readIfPresent("scale", scaleFactor);
+ }
+
+ Info<< nl << "Creating points with scale " << scaleFactor << endl;
pointField points(nPoints_);
- blockMesh& blocks = *this;
-
forAll(blocks, blockLabel)
{
const pointField& blockPoints = blocks[blockLabel].points();
@@ -59,17 +61,11 @@ pointField blockMesh::createPoints()
blockPointLabel
+ blockOffsets_[blockLabel]
]
- ] = scale_*blockPoints[blockPointLabel];
+ ] = scaleFactor * blockPoints[blockPointLabel];
}
}
return points;
}
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
// ************************************************************************* //
-
diff --git a/applications/utilities/mesh/generation/blockMesh/createTopology.C b/applications/utilities/mesh/generation/blockMesh/createTopology.C
index 6b74db8b0a..8be8f42864 100644
--- a/applications/utilities/mesh/generation/blockMesh/createTopology.C
+++ b/applications/utilities/mesh/generation/blockMesh/createTopology.C
@@ -40,9 +40,9 @@ bool Foam::blockMesh::blockLabelsOK
{
bool ok = true;
- for (int i=0; i= points.size())
+ else if (blockShape[blockI] >= points.size())
{
ok = false;
@@ -65,7 +65,7 @@ bool Foam::blockMesh::blockLabelsOK
"(const label blockLabel, const pointField& points, "
"const cellShape& blockShape)"
) << "block " << blockLabel
- << " point label " << blockShape[i]
+ << " point label " << blockShape[blockI]
<< " larger than " << points.size() - 1
<< " the largest defined point label" << endl;
}
@@ -84,38 +84,34 @@ bool Foam::blockMesh::patchLabelsOK
{
bool ok = true;
- for (label facei=0; facei= points.size())
+ else if (f[fp] >= points.size())
{
ok = false;
WarningIn
(
- "bool Foam::blockMesh::patchLabelsOK"
- "(const label patchLabel, const pointField& points, "
- "const faceList& patchFaces)"
+ "bool Foam::blockMesh::patchLabelsOK(...)"
) << "patch " << patchLabel
- << " face " << facei
- << " point label " << labels[i]
+ << " face " << faceI
+ << " point label " << f[fp]
<< " larger than " << points.size() - 1
<< " the largest defined point label" << endl;
}
@@ -137,23 +133,13 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
word defaultPatchName = "defaultFaces";
word defaultPatchType = emptyPolyPatch::typeName;
- // get names and types for the unassigned patch faces
- if (meshDescription.found("defaultPatch"))
+ // get names/types for the unassigned patch faces
+ // this is a bit heavy handed (and ugly), but there is currently
+ // no easy way to rename polyMesh patches subsequently
+ if (const dictionary* dictPtr = meshDescription.subDictPtr("defaultPatch"))
{
- const dictionary& defaultPatch =
- meshDescription.subDict("defaultPatch");
-
- // this is a bit heavy handed (and ugly), but there is currently
- // no easy way to rename polyMesh patches subsequently
- if (defaultPatch.found("name"))
- {
- defaultPatch.lookup("name") >> defaultPatchName;
- }
-
- if (defaultPatch.found("type"))
- {
- defaultPatch.lookup("type") >> defaultPatchType;
- }
+ dictPtr->readIfPresent("name", defaultPatchName);
+ dictPtr->readIfPresent("type", defaultPatchType);
}
Info<< nl << "Creating blockCorners" << endl;
@@ -439,7 +425,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
IOobject::NO_WRITE,
false
),
- tmpBlockPoints,
+ xferMove(tmpBlockPoints),
tmpBlockCells,
tmpBlocksPatches,
patchNames,
@@ -456,4 +442,3 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
// ************************************************************************* //
-
diff --git a/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.C b/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.C
index 2efd9b1839..6d7e80d74e 100644
--- a/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.C
+++ b/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.C
@@ -1,4 +1,4 @@
- Info<< nl << "Creating merge patch pairs" << nl << endl;
+ Info<< "Creating merge patch pairs" << nl << endl;
if (mergePatchPairs.size() > 0)
{
diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C
index b650224ec8..dae087a40f 100644
--- a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C
+++ b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.C
@@ -48,7 +48,7 @@ template
template class FaceList,
class PointField
>
-Foam::pointField Foam::extrudedMesh::extrudedPoints
+Foam::xfer Foam::extrudedMesh::extrudedPoints
(
const PrimitivePatch& extrudePatch,
const extrudeModel& model
@@ -76,12 +76,13 @@ Foam::pointField Foam::extrudedMesh::extrudedPoints
}
}
- return ePoints;
+ // return points for transferring
+ return xferMove(ePoints);
}
template class FaceList, class PointField>
-Foam::faceList Foam::extrudedMesh::extrudedFaces
+Foam::xfer Foam::extrudedMesh::extrudedFaces
(
const PrimitivePatch& extrudePatch,
const extrudeModel& model
@@ -177,12 +178,13 @@ Foam::faceList Foam::extrudedMesh::extrudedFaces
);
}
- return eFaces;
+ // return points for transferring
+ return xferMove(eFaces);
}
template class FaceList, class PointField>
-Foam::cellList Foam::extrudedMesh::extrudedCells
+Foam::xfer Foam::extrudedMesh::extrudedCells
(
const PrimitivePatch& extrudePatch,
const extrudeModel& model
@@ -283,7 +285,8 @@ Foam::cellList Foam::extrudedMesh::extrudedCells
facei++;
}
- return eCells;
+ // return points for transferring
+ return xferMove(eCells);
}
diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.H b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.H
index 71bfb2e07b..d089ee9130 100644
--- a/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.H
+++ b/applications/utilities/mesh/generation/extrudeMesh/extrudedMesh/extrudedMesh.H
@@ -63,26 +63,26 @@ class extrudedMesh
//- Construct and return the extruded mesh points
template class FaceList, class PointField>
- pointField extrudedPoints
+ xfer extrudedPoints
(
const PrimitivePatch& extrudePatch,
- const extrudeModel& model
+ const extrudeModel&
);
//- Construct and return the extruded mesh faces
template class FaceList, class PointField>
- faceList extrudedFaces
+ xfer extrudedFaces
(
const PrimitivePatch& extrudePatch,
- const extrudeModel& model
+ const extrudeModel&
);
//- Construct and return the extruded mesh cells
template class FaceList, class PointField>
- cellList extrudedCells
+ xfer extrudedCells
(
const PrimitivePatch& extrudePatch,
- const extrudeModel& model
+ const extrudeModel&
);
@@ -101,9 +101,9 @@ public:
template class FaceList, class PointField>
extrudedMesh
(
- const IOobject& io,
+ const IOobject&,
const PrimitivePatch& extrudePatch,
- const extrudeModel& model
+ const extrudeModel&
);
};
diff --git a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C
index 5f35621557..761dd606db 100644
--- a/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C
+++ b/applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C
@@ -374,9 +374,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
mirrorMeshPtr_ = new fvMesh
(
io,
- newPoints,
- newFaces,
- newCells
+ xferMove(newPoints),
+ xferMove(newFaces),
+ xferMove(newCells)
);
fvMesh& pMesh = *mirrorMeshPtr_;
diff --git a/applications/utilities/mesh/manipulation/setSet/Allwmake b/applications/utilities/mesh/manipulation/setSet/Allwmake
index e10d037cbc..1e116a3315 100755
--- a/applications/utilities/mesh/manipulation/setSet/Allwmake
+++ b/applications/utilities/mesh/manipulation/setSet/Allwmake
@@ -2,8 +2,9 @@
cd ${0%/*} || exit 1 # run from this directory
READLINE=0
-if [ -f /usr/include/readline/readline.h ]; then
- echo "Found readline/readline.h include file. Enabling readline support."
+if [ -f /usr/include/readline/readline.h ]
+then
+ echo "Found readline/readline.h -- enabling readline support."
READLINE=1
export READLINELINK="-lreadline -lncurses"
break
diff --git a/applications/utilities/mesh/manipulation/splitMesh/regionSide.H b/applications/utilities/mesh/manipulation/splitMesh/regionSide.H
index 514c928095..776fa33117 100644
--- a/applications/utilities/mesh/manipulation/splitMesh/regionSide.H
+++ b/applications/utilities/mesh/manipulation/splitMesh/regionSide.H
@@ -45,7 +45,7 @@ SourceFiles
#ifndef regionSide_H
#define regionSide_H
-#include "labelHashSet.H"
+#include "HashSet.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C
index dd107c2f2f..548f8247dc 100644
--- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C
+++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C
@@ -272,9 +272,9 @@ bool domainDecomposition::writeDecomposition()
"constant",
processorDb
),
- procPoints,
- procFaces,
- procCells
+ xferMove(procPoints),
+ xferMove(procFaces),
+ xferMove(procCells)
);
// Create processor boundary patches
diff --git a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
index bfd6ae083b..834b75dfe6 100644
--- a/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
+++ b/applications/utilities/parallelProcessing/reconstructParMesh/reconstructParMesh.C
@@ -506,9 +506,9 @@ int main(int argc, char *argv[])
runTime,
IOobject::NO_READ
),
- pointField(0),
- faceList(0),
- cellList(0)
+ xferCopy(pointField()),
+ xferCopy(faceList()),
+ xferCopy(cellList())
);
for (label procI = 0; procI < nProcs; procI++)
diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C
index 3c2f7f6662..35b1ff4913 100644
--- a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C
+++ b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C
@@ -70,10 +70,10 @@ autoPtr createMesh
runTime,
IOobject::MUST_READ
),
- pointField(0),
- faceList(0),
- labelList(0),
- labelList(0)
+ xferCopy(pointField()),
+ xferCopy(faceList()),
+ xferCopy(labelList()),
+ xferCopy(labelList())
);
if (!haveMesh)
diff --git a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options
index 601df67db4..fe46b10d13 100644
--- a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options
+++ b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/Make/options
@@ -1,19 +1,18 @@
EXE_INC = \
-I$(LIB_SRC)/postProcessing/postCalc \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I$(LIB_SRC)/turbulenceModels/LES \
+ -I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
+ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
$(FOAM_LIBBIN)/postCalc.o \
- -lfiniteVolume \
-lincompressibleTransportModels \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lbasicThermophysicalModels \
-lspecie \
-lcompressibleRASModels \
- -lcompressibleLESModels
+ -lcompressibleLESModels \
+ -lfiniteVolume
diff --git a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C
index 3f7a99040b..7a1e86c286 100644
--- a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C
+++ b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C
@@ -39,12 +39,12 @@ Description
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-#include "incompressible/RASModel/RASModel.H"
-#include "incompressible/LESModel/LESModel.H"
+#include "incompressible/RAS/RASModel/RASModel.H"
+#include "incompressible/LES/LESModel/LESModel.H"
#include "basicThermo.H"
-#include "compressible/RASModel/RASModel.H"
-#include "compressible/LESModel/LESModel.H"
+#include "compressible/RAS/RASModel/RASModel.H"
+#include "compressible/LES/LESModel/LESModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/utilities/postProcessing/sampling/sample/sampleDict b/applications/utilities/postProcessing/sampling/sample/sampleDict
index 57385a9555..5ca407c90c 100644
--- a/applications/utilities/postProcessing/sampling/sample/sampleDict
+++ b/applications/utilities/postProcessing/sampling/sample/sampleDict
@@ -2,7 +2,7 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
-| \\ / A nd | Web: http://www.openfoam.org |
+| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@@ -155,21 +155,25 @@ surfaces
// Optional: whether to leave as faces (=default) or triangulate
}
- constantIso
- {
- name isoSurface;
- isoField rho;
- isoValue 0.5;
- interpolate false
- }
interpolatedIso
{
- name isoSurface;
+ // Iso surface for interpolated values only
+ type isoSurface;
isoField rho;
isoValue 0.5;
interpolate true;
//regularise false; //optional: do not simplify
}
+ constantIso
+ {
+ // Iso surface for constant values. Guarantees triangles to not
+ // cross cells.
+ type isoSurfaceCell;
+ isoField rho;
+ isoValue 0.5;
+ interpolate false;
+ //regularise false; //optional: do not simplify
+ }
);
diff --git a/applications/utilities/postProcessing/turbulence/R/Make/options b/applications/utilities/postProcessing/turbulence/R/Make/options
index a53125aaf2..5e71b80afa 100644
--- a/applications/utilities/postProcessing/turbulence/R/Make/options
+++ b/applications/utilities/postProcessing/turbulence/R/Make/options
@@ -1,10 +1,10 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I$(LIB_SRC)/transportModels
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
+ -I$(LIB_SRC)/transportModels \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
- -lfiniteVolume \
-lincompressibleRASModels \
-lincompressibleTransportModels \
-lfiniteVolume
diff --git a/applications/utilities/postProcessing/turbulence/R/R.C b/applications/utilities/postProcessing/turbulence/R/R.C
index 7ce19a8c5f..dbf1860bce 100644
--- a/applications/utilities/postProcessing/turbulence/R/R.C
+++ b/applications/utilities/postProcessing/turbulence/R/R.C
@@ -32,21 +32,19 @@ Description
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-#include "incompressible/RASModel/RASModel.H"
-
+#include "RASModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
+ #include "setRootCase.H"
-# include "setRootCase.H"
+ #include "createTime.H"
+ #include "createMesh.H"
+ #include "createFields.H"
-# include "createTime.H"
-# include "createMesh.H"
-# include "createFields.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nCalculating the Reynolds Stress R\n" << endl;
diff --git a/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options b/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options
index be60a20b9f..a524a0aae5 100644
--- a/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options
+++ b/applications/utilities/postProcessing/turbulence/createTurbulenceFields/Make/options
@@ -1,9 +1,10 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I$(LIB_SRC)/transportModels
+ -I$(LIB_SRC)/transportModels \
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
- -lfiniteVolume \
-lincompressibleRASModels \
- -lincompressibleTransportModels
+ -lincompressibleTransportModels \
+ -lfiniteVolume
\ No newline at end of file
diff --git a/applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C b/applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C
index 30a74548dd..2a8ed8f529 100644
--- a/applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C
+++ b/applications/utilities/postProcessing/turbulence/createTurbulenceFields/createTurbulenceFields.C
@@ -36,28 +36,26 @@ Source files:
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-#include "incompressible/RASModel/RASModel.H"
-
+#include "RASModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
-
-# include "addTimeOptions.H"
-# include "setRootCase.H"
-# include "createTime.H"
+ #include "addTimeOptions.H"
+ #include "setRootCase.H"
+ #include "createTime.H"
// Get times list
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
-# include "checkTimeOptions.H"
+ #include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
-# include "createMesh.H"
+ #include "createMesh.H"
-# include "createFields.H"
+ #include "createFields.H"
for (label i=startTime; ialphaEff())*fvc::snGrad(h);
diff --git a/applications/utilities/postProcessing/wall/wallShearStress/Make/options b/applications/utilities/postProcessing/wall/wallShearStress/Make/options
index 2a417f9549..89632547e0 100644
--- a/applications/utilities/postProcessing/wall/wallShearStress/Make/options
+++ b/applications/utilities/postProcessing/wall/wallShearStress/Make/options
@@ -1,7 +1,8 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I$(LIB_SRC)/transportModels
+ -I$(LIB_SRC)/transportModels \
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lincompressibleRASModels \
diff --git a/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C b/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C
index d53fa5491c..98b7d6ebc2 100644
--- a/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C
+++ b/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C
@@ -32,7 +32,7 @@ Description
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-#include "incompressible/RASModel/RASModel.H"
+#include "RASModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -40,9 +40,9 @@ int main(int argc, char *argv[])
{
timeSelector::addOptions();
#include "setRootCase.H"
-# include "createTime.H"
+ #include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
-# include "createMesh.H"
+ #include "createMesh.H"
forAll(timeDirs, timeI)
{
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << endl;
mesh.readUpdate();
-# include "createFields.H"
+ #include "createFields.H"
volSymmTensorField Reff(RASModel->devReff());
diff --git a/applications/utilities/postProcessing/wall/yPlusLES/Make/options b/applications/utilities/postProcessing/wall/yPlusLES/Make/options
index b624a502aa..79fbbac91e 100644
--- a/applications/utilities/postProcessing/wall/yPlusLES/Make/options
+++ b/applications/utilities/postProcessing/wall/yPlusLES/Make/options
@@ -1,5 +1,6 @@
EXE_INC = \
- -I$(LIB_SRC)/turbulenceModels/LES \
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/LES/LESModel \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/finiteVolume/lnInclude
diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C
index d7c145b953..d89411f497 100644
--- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C
+++ b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C
@@ -32,7 +32,7 @@ Description
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-#include "incompressible/LESModel/LESModel.H"
+#include "LESModel.H"
#include "nearWallDist.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
index 2a417f9549..89632547e0 100644
--- a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
+++ b/applications/utilities/postProcessing/wall/yPlusRAS/Make/options
@@ -1,7 +1,8 @@
EXE_INC = \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/turbulenceModels/RAS \
- -I$(LIB_SRC)/transportModels
+ -I$(LIB_SRC)/transportModels \
+ -I$(LIB_SRC)/turbulenceModels \
+ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \
+ -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lincompressibleRASModels \
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
index 2db2f0d3b1..f9e164bbd0 100644
--- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
+++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
@@ -32,7 +32,7 @@ Description
#include "fvCFD.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-#include "incompressible/RASModel/RASModel.H"
+#include "RASModel.H"
#include "wallFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/utilities/surface/surfaceConvert/surfaceConvert.C b/applications/utilities/surface/surfaceConvert/surfaceConvert.C
index a2a62378db..3d3c9cbde5 100644
--- a/applications/utilities/surface/surfaceConvert/surfaceConvert.C
+++ b/applications/utilities/surface/surfaceConvert/surfaceConvert.C
@@ -22,9 +22,26 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+Application
+ surfaceConvert
+
Description
- Converts to and from Foam surface format. Optionally orders triangles
- by region.
+ Converts from one surface mesh format to another
+
+Usage
+ - surfaceConvert inputFile outputFile [OPTION]
+
+ @param -clean \n
+ Perform some surface checking/cleanup on the input surface
+
+ @param -scale \ \n
+ Specify a scaling factor for writing the files
+
+ @param -group \n
+ Orders faces by region
+
+Note
+ The filename extensions are used to determine the file format type.
\*---------------------------------------------------------------------------*/
@@ -44,34 +61,41 @@ int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.clear();
- argList::validOptions.insert("cleanup", "");
+ argList::validArgs.append("inputFile");
+ argList::validArgs.append("outputFile");
+ argList::validOptions.insert("clean", "");
+ argList::validOptions.insert("scale", "scale");
argList::validOptions.insert("group", "");
- argList::validArgs.append("input surface file");
- argList::validArgs.append("output surface file");
+
argList args(argc, argv);
+ const stringList& params = args.additionalArgs();
- fileName inFileName(args.additionalArgs()[0]);
- fileName outFileName(args.additionalArgs()[1]);
+ scalar scaleFactor = 0;
+ if (args.options().found("scale"))
+ {
+ IStringStream(args.options()["scale"])() >> scaleFactor;
+ }
- if (outFileName == inFileName)
+ fileName importName(params[0]);
+ fileName exportName(params[1]);
+
+ if (importName == exportName)
{
FatalErrorIn(args.executable())
- << "Output file " << outFileName
- << " would overwrite input file."
+ << "Output file " << exportName << " would overwrite input file."
<< exit(FatalError);
}
- Info << "Reading : " << inFileName << endl;
- triSurface surf(inFileName);
+ Info<< "Reading : " << importName << endl;
+ triSurface surf(importName);
Info<< "Read surface:" << endl;
surf.writeStats(Info);
Info<< endl;
-
- if (args.options().found("cleanup"))
+ if (args.options().found("clean"))
{
- Info << "Cleaning up surface" << endl;
+ Info<< "Cleaning up surface" << endl;
surf.cleanup(true);
Info<< "After cleaning up surface:" << endl;
@@ -83,20 +107,28 @@ int main(int argc, char *argv[])
if (sortByRegion)
{
- Info << "Reordering faces into groups; one per region." << endl;
+ Info<< "Reordering faces into groups; one per region." << endl;
}
else
{
- Info << "Maintaining face ordering" << endl;
+ Info<< "Maintaining face ordering" << endl;
}
- Info << "Writing : " << outFileName << endl;
- surf.write(outFileName, sortByRegion);
+ Info<< "writing " << exportName;
+ if (scaleFactor > 0)
+ {
+ Info<< " without scaling" << endl;
+ }
+ else
+ {
+ Info<< " with scaling " << scaleFactor << endl;
+ surf.scalePoints(scaleFactor);
+ }
+ surf.write(exportName, sortByRegion);
- Info << "End\n" << endl;
+ Info<< "\nEnd\n" << endl;
return 0;
}
-
// ************************************************************************* //
diff --git a/applications/utilities/surface/surfaceCoordinateSystemTransform/Make/files b/applications/utilities/surface/surfaceCoordinateSystemTransform/Make/files
new file mode 100644
index 0000000000..b937625a71
--- /dev/null
+++ b/applications/utilities/surface/surfaceCoordinateSystemTransform/Make/files
@@ -0,0 +1,3 @@
+surfaceCoordinateSystemTransform.C
+
+EXE = $(FOAM_APPBIN)/surfaceCoordinateSystemTransform
diff --git a/applications/utilities/surface/surfaceCoordinateSystemTransform/Make/options b/applications/utilities/surface/surfaceCoordinateSystemTransform/Make/options
new file mode 100644
index 0000000000..42b30c8652
--- /dev/null
+++ b/applications/utilities/surface/surfaceCoordinateSystemTransform/Make/options
@@ -0,0 +1,5 @@
+EXE_INC = \
+ -I$(LIB_SRC)/meshTools/lnInclude \
+ -I$(LIB_SRC)/surfMesh/lnInclude
+
+EXE_LIBS = -lmeshTools -lsurfMesh
diff --git a/applications/utilities/surface/surfaceCoordinateSystemTransform/coordinateSystems b/applications/utilities/surface/surfaceCoordinateSystemTransform/coordinateSystems
new file mode 100644
index 0000000000..b414b6b81b
--- /dev/null
+++ b/applications/utilities/surface/surfaceCoordinateSystemTransform/coordinateSystems
@@ -0,0 +1,83 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| ========= | |
+| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
+| \\ / O peration | Version: dev |
+| \\ / A nd | Web: http://www.OpenFOAM.org |
+| \\/ M anipulation | |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+ version 2.0;
+ format ascii;
+ class IOPtrList;
+ object coordinateSystems;
+}
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+7
+(
+system_9
+{
+ type cartesian;
+ origin (1.03291515 -0.114391257 -0.0826236662);
+ e3 (1 0 0);
+ e1 (0 1 0);
+ // STARCDRotation (0 90 90);
+}
+
+system_10
+{
+ type cartesian;
+ origin (0.623151719 -0.286472935 -0.113933262);
+ e3 (0.99508851 0.09829095 0.01173645);
+ e1 (0.01179356 0 -0.99993045);
+ // STARCDRotation (5.6403745 -0.0664172952 89.3275351);
+}
+
+system_15
+{
+ type cartesian;
+ origin (0.644772231 -0.240036493 0.155972187);
+ e3 (-0.01346388 -0.90616979 -0.42269969);
+ e1 (0.00627978 0.42265304 -0.90626981);
+ // STARCDRotation (-90.8512386 0 115.005148);
+}
+
+system_16
+{
+ type cartesian;
+ origin (0.540824938 -0.240036415 0.15928296);
+ e3 (-0.01346388 -0.90616979 -0.42269969);
+ e1 (0.00627978 0.42265304 -0.90626981);
+ // STARCDRotation (-90.8512386 0 115.005148);
+}
+
+system_17
+{
+ type cartesian;
+ origin (0.436877646 -0.240036339 0.162593737);
+ e3 (-0.01346388 -0.90616979 -0.42269969);
+ e1 (0.00627978 0.42265304 -0.90626981);
+ // STARCDRotation (-90.8512386 0 115.005148);
+}
+
+system_18
+{
+ type cartesian;
+ origin (0.332930354 -0.240036261 0.16590451);
+ e3 (-0.01346388 -0.90616979 -0.42269969);
+ e1 (0.00627978 0.42265304 -0.90626981);
+ // STARCDRotation (-90.8512386 0 115.005148);
+}
+
+system_21
+{
+ type cartesian;
+ origin (0.55863733 -0.300866705 0.00317260982);
+ e3 (0.42110287 0.02470132 -0.90667647);
+ e1 (0.90646036 0.02342535 0.42164069);
+ // STARCDRotation (-178.185897 -0.71772221 -155.059695);
+}
+)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/utilities/surface/surfaceCoordinateSystemTransform/surfaceCoordinateSystemTransform.C b/applications/utilities/surface/surfaceCoordinateSystemTransform/surfaceCoordinateSystemTransform.C
new file mode 100644
index 0000000000..8453d6f94a
--- /dev/null
+++ b/applications/utilities/surface/surfaceCoordinateSystemTransform/surfaceCoordinateSystemTransform.C
@@ -0,0 +1,235 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 1991-2008 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
+ surfaceMeshCoordinateSystemTransform
+
+Description
+
+ Transform (scale/rotate/translate) a surface based on
+ a coordinateSystem.
+
+Usage
+ - surfaceMeshCoordinateSystemTransform inputFile outputFile [OPTION]
+
+ @param -clean \n
+ Perform some surface checking/cleanup on the input surface
+
+ @param -scale \ \n
+ Specify a scaling factor for writing the files
+
+ @param -triSurface \n
+ Use triSurface library for input/output
+
+ @param -dict \ \n
+ Specify an alternative dictionary for coordinateSystems.
+
+Note
+ The filename extensions are used to determine the file format type.
+
+\*---------------------------------------------------------------------------*/
+
+#include "argList.H"
+#include "timeSelector.H"
+#include "Time.H"
+
+#include "MeshedSurfaces.H"
+#include "UnsortedMeshedSurfaces.H"
+#include "coordinateSystems.H"
+
+using namespace Foam;
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// Main program:
+
+int main(int argc, char *argv[])
+{
+ argList::noParallel();
+ argList::validArgs.append("inputFile");
+ argList::validArgs.append("outputFile");
+ argList::validOptions.insert("scale", "scale");
+ argList::validOptions.insert("unsorted", "");
+ argList::validOptions.insert("from", "sourceCoordinateSystem");
+ argList::validOptions.insert("to", "targetCoordinateSystem");
+ argList::validOptions.insert("dict", "dictionary");
+
+ argList args(argc, argv);
+ Time runTime(args.rootPath(), args.caseName());
+ const stringList& params = args.additionalArgs();
+
+ word dictName("coordinateSystems");
+ fileName dictPath(runTime.constant());
+ fileName dictLocal;
+
+ if (args.options().found("dict"))
+ {
+ wordList elems(fileName(args.options()["dict"]).components());
+ dictName = elems[elems.size()-1];
+ dictPath = elems[0];
+ dictLocal = "";
+
+ if (elems.size() == 1)
+ {
+ dictPath = ".";
+ }
+ else if (elems.size() > 2)
+ {
+ dictLocal = fileName(SubList(elems, elems.size()-2, 1));
+ }
+ }
+
+ autoPtr fromCsys;
+ autoPtr toCsys;
+
+ if (args.options().found("from") || args.options().found("to"))
+ {
+ IOobject csDictIo
+ (
+ dictName,
+ dictPath,
+ dictLocal,
+ runTime,
+ IOobject::MUST_READ,
+ IOobject::NO_WRITE,
+ false
+ );
+
+ if (!csDictIo.headerOk())
+ {
+ FatalErrorIn(args.executable())
+ << "Cannot open coordinateSystems file\n "
+ << csDictIo.objectPath() << nl
+ << exit(FatalError);
+ }
+
+ coordinateSystems csLst(csDictIo);
+
+ if (args.options().found("from"))
+ {
+ word csName(args.options()["from"]);
+
+ label csId = csLst.find(csName);
+ if (csId < 0)
+ {
+ FatalErrorIn(args.executable())
+ << "Cannot find -from " << csName << nl
+ << "available coordinateSystems: " << csLst.toc() << nl
+ << exit(FatalError);
+ }
+
+ fromCsys.reset(new coordinateSystem(csLst[csId]));
+ }
+
+ if (args.options().found("to"))
+ {
+ word csName(args.options()["to"]);
+
+ label csId = csLst.find(csName);
+ if (csId < 0)
+ {
+ FatalErrorIn(args.executable())
+ << "Cannot find -to " << csName << nl
+ << "available coordinateSystems: " << csLst.toc() << nl
+ << exit(FatalError);
+ }
+
+ toCsys.reset(new coordinateSystem(csLst[csId]));
+ }
+
+
+ // maybe fix this later
+ if (fromCsys.valid() && toCsys.valid())
+ {
+ FatalErrorIn(args.executable())
+ << "Only allowed -from or -to option at the moment."
+ << exit(FatalError);
+ }
+ }
+
+ scalar scaleFactor = 0;
+ if (args.options().found("scale"))
+ {
+ IStringStream(args.options()["scale"])() >> scaleFactor;
+ }
+
+ fileName importName(params[0]);
+ fileName exportName(params[1]);
+
+ if (importName == exportName)
+ {
+ FatalErrorIn(args.executable())
+ << "Output file " << exportName << " would overwrite input file."
+ << exit(FatalError);
+ }
+
+ if
+ (
+ !meshedSurface::canRead(importName, true)
+ || !meshedSurface::canWriteType(exportName.ext(), true)
+ )
+ {
+ return 1;
+ }
+
+
+ {
+ MeshedSurface surf(importName);
+
+ if (args.options().found("clean"))
+ {
+ surf.cleanup(true);
+ surf.checkOrientation(true);
+ }
+
+ if (fromCsys.valid())
+ {
+ tmp tpf = fromCsys().localPosition(surf.points());
+ surf.movePoints(tpf());
+ }
+
+ if (toCsys.valid())
+ {
+ tmp tpf = toCsys().globalPosition(surf.points());
+ surf.movePoints(tpf());
+ }
+
+ Info<< "writing " << exportName;
+ if (scaleFactor <= 0)
+ {
+ Info<< " without scaling" << endl;
+ }
+ else
+ {
+ Info<< " with scaling " << scaleFactor << endl;
+ surf.scalePoints(scaleFactor);
+ }
+ surf.write(exportName);
+ }
+
+ Info<< "\nEnd\n" << endl;
+
+ return 0;
+}
+
+// ************************************************************************* //
diff --git a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
index ad09dc328c..a907c7208c 100644
--- a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
+++ b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
@@ -40,6 +40,9 @@ Usage
@param -triSurface \n
Use triSurface library for input/output
+ @param -keyed \n
+ Use keyedSurface for input/output
+
Note
The filename extensions are used to determine the file format type.
@@ -49,9 +52,11 @@ Note
#include "timeSelector.H"
#include "Time.H"
#include "polyMesh.H"
-#include "meshedSurface.H"
#include "triSurface.H"
+#include "MeshedSurfaces.H"
+#include "UnsortedMeshedSurfaces.H"
+
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -62,9 +67,11 @@ int main(int argc, char *argv[])
argList::noParallel();
argList::validArgs.append("inputFile");
argList::validArgs.append("outputFile");
- argList::validOptions.insert("scale", "scale");
argList::validOptions.insert("clean", "");
+ argList::validOptions.insert("scale", "scale");
argList::validOptions.insert("triSurface", "");
+ argList::validOptions.insert("unsorted", "");
+ argList::validOptions.insert("triFace", "");
# include "setRootCase.H"
const stringList& params = args.additionalArgs();
@@ -77,10 +84,17 @@ int main(int argc, char *argv[])
fileName importName(params[0]);
fileName exportName(params[1]);
+ if (importName == exportName)
+ {
+ FatalErrorIn(args.executable())
+ << "Output file " << exportName << " would overwrite input file."
+ << exit(FatalError);
+ }
+
if
(
- !meshedSurface::canRead(importName.ext(), true)
- || !meshedSurface::canWrite(exportName.ext(), true)
+ !meshedSurface::canRead(importName, true)
+ || !meshedSurface::canWriteType(exportName.ext(), true)
)
{
return 1;
@@ -88,10 +102,6 @@ int main(int argc, char *argv[])
if (args.options().found("triSurface"))
{
-// # include "createTime.H"
-// instantList timeDirs = timeSelector::select0(runTime, args);
-// # include "createPolyMesh.H"
-
triSurface surf(importName);
if (args.options().found("clean"))
@@ -107,15 +117,16 @@ int main(int argc, char *argv[])
}
else
{
- Info<< " triSurface does not yet support scaling "
- << scaleFactor << endl;
- // surf.scalePoints(scaleFactor);
+ Info<< " with scaling " << scaleFactor << endl;
+ surf.scalePoints(scaleFactor);
}
- surf.write(exportName);
+
+ // write sorted by region
+ surf.write(exportName, true);
}
- else
+ else if (args.options().found("unsorted"))
{
- meshedSurface surf(importName);
+ UnsortedMeshedSurface surf(importName);
if (args.options().found("clean"))
{
@@ -123,7 +134,29 @@ int main(int argc, char *argv[])
surf.checkOrientation(true);
}
- surf.scalePoints(scaleFactor);
+ Info << "writing " << exportName;
+ if (scaleFactor <= 0)
+ {
+ Info<< " without scaling" << endl;
+ }
+ else
+ {
+ Info<< " with scaling " << scaleFactor << endl;
+ surf.scalePoints(scaleFactor);
+ }
+
+ surf.write(exportName);
+ }
+#if 1
+ else if (args.options().found("triFace"))
+ {
+ MeshedSurface surf(importName);
+
+ if (args.options().found("clean"))
+ {
+ surf.cleanup(true);
+ surf.checkOrientation(true);
+ }
Info<< "writing " << exportName;
if (scaleFactor <= 0)
@@ -133,6 +166,30 @@ int main(int argc, char *argv[])
else
{
Info<< " with scaling " << scaleFactor << endl;
+ surf.scalePoints(scaleFactor);
+ }
+ surf.write(exportName);
+ }
+#endif
+ else
+ {
+ MeshedSurface surf(importName);
+
+ if (args.options().found("clean"))
+ {
+ surf.cleanup(true);
+ surf.checkOrientation(true);
+ }
+
+ Info<< "writing " << exportName;
+ if (scaleFactor <= 0)
+ {
+ Info<< " without scaling" << endl;
+ }
+ else
+ {
+ Info<< " with scaling " << scaleFactor << endl;
+ surf.scalePoints(scaleFactor);
}
surf.write(exportName);
}
diff --git a/bin/foamTemplates/source/foamAppTemplate.C b/bin/foamTemplates/source/foamAppTemplate.C
index 351c9d251b..bef53f7f8e 100644
--- a/bin/foamTemplates/source/foamAppTemplate.C
+++ b/bin/foamTemplates/source/foamAppTemplate.C
@@ -36,10 +36,10 @@ Description
int main(int argc, char *argv[])
{
+ #include "setRootCase.H"
+ #include "createTime.H"
-# include "setRootCase.H"
-# include "createTime.H"
-
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info << "End\n" << endl;
diff --git a/bin/foamTemplates/source/foamTemplate.C b/bin/foamTemplates/source/foamTemplate.C
index 99bea11c39..fc947cf9b4 100644
--- a/bin/foamTemplates/source/foamTemplate.C
+++ b/bin/foamTemplates/source/foamTemplate.C
@@ -31,7 +31,7 @@ License
const dataType Foam::className::staticData();
-// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@@ -71,10 +71,16 @@ Foam::className::~className()
{}
-// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
-// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
void Foam::className::operator=(const className& rhs)
{
@@ -87,11 +93,10 @@ void Foam::className::operator=(const className& rhs)
}
}
-
-// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
-// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
// ************************************************************************* //
diff --git a/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.C b/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.C
index 92038d8199..f0955b92e4 100644
--- a/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.C
+++ b/bin/foamTemplates/sourceTemplate/foamTemplateTemplate.C
@@ -32,7 +32,7 @@ template
const dataType Foam::ClassName::staticData();
-// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
+// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@@ -84,10 +84,16 @@ Foam::ClassName::~ClassName()
{}
-// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
-// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
+// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
+
+
+// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
template
void Foam::ClassName::operator=
@@ -108,10 +114,10 @@ void Foam::ClassName::operator=
}
-// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
-// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
// ************************************************************************* //
diff --git a/doc/Allwmake b/doc/Allwmake
index e75f1030e2..e180b24e0f 100755
--- a/doc/Allwmake
+++ b/doc/Allwmake
@@ -6,6 +6,6 @@ chmod a+rX $WM_PROJECT_DIR
chmod a+rX $WM_PROJECT_DIR/doc
chmod -R a+rX Doxygen
-( cd Doxygen && ./Allwmake )
+Doxygen/Allwmake
# ----------------------------------------------------------------- end-of-file
diff --git a/etc/apps/cint/bashrc b/etc/apps/cint/bashrc
index 11909e0487..298ef2639a 100644
--- a/etc/apps/cint/bashrc
+++ b/etc/apps/cint/bashrc
@@ -31,9 +31,21 @@
#
#------------------------------------------------------------------------------
-export CINTSYSDIR=~/pub/CINT/cint7
-export PATH=$PATH:$CINTSYSDIR
-export MANPATH=$MANPATH:$CINTSYSDIR/doc
-export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$CINTSYSDIR
+for CINTSYSDIR in \
+ $HOME/pub/CINT/cint7 \
+ $WM_THIRD_PARTY_DIR/cint-svn/platforms/$WM_OPTIONS \
+ ;
+do
+ if [ -r $CINTSYSDIR ]
+ then
+ export CINTSYSDIR
+ export PATH=$PATH:$CINTSYSDIR/bin
+ export MANPATH=$MANPATH:$CINTSYSDIR/doc
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$CINTSYSDIR/lib
+ break
+ fi
+done
+
+[ -r "$CINTSYSDIR" ] || unset CINTSYSDIR
# -----------------------------------------------------------------------------
diff --git a/etc/apps/ensightFoam/bashrc b/etc/apps/ensight/bashrc
similarity index 93%
rename from etc/apps/ensightFoam/bashrc
rename to etc/apps/ensight/bashrc
index e2fd320048..52d7ba4869 100644
--- a/etc/apps/ensightFoam/bashrc
+++ b/etc/apps/ensight/bashrc
@@ -32,19 +32,23 @@
#------------------------------------------------------------------------------
# fallback value
-if [ ! -d "$CEI_HOME" ]; then
+if [ ! -d "$CEI_HOME" ]
+then
export CEI_HOME=/usr/local/ensight/CEI
fi
-if [ -r $CEI_HOME ]; then
+if [ -r $CEI_HOME ]
+then
# special treatment for 32bit FOAM and 64bit Ensight
- if [ "$WM_ARCH" = linux -a `uname -m` = x86_64 ]; then
+ if [ "$WM_ARCH" = linux -a `uname -m` = x86_64 ]
+ then
export CEI_ARCH=linux_2.6_32
fi
# add to path if required
- if [ "$CEI_HOME/bin/ensight" != "`which ensight 2>/dev/null`" ]; then
+ if [ "$CEI_HOME/bin/ensight" != "`which ensight 2>/dev/null`" ]
+ then
export PATH=$CEI_HOME/bin:$PATH
fi
diff --git a/etc/apps/ensightFoam/cshrc b/etc/apps/ensight/cshrc
similarity index 100%
rename from etc/apps/ensightFoam/cshrc
rename to etc/apps/ensight/cshrc
diff --git a/etc/apps/paraview/bashrc b/etc/apps/paraview/bashrc
index 87a75e0b7a..73d0e4c778 100644
--- a/etc/apps/paraview/bashrc
+++ b/etc/apps/paraview/bashrc
@@ -33,7 +33,8 @@
export CMAKE_HOME=$WM_THIRD_PARTY_DIR/cmake-2.4.6/platforms/$WM_ARCH
-if [ -r $CMAKE_HOME ]; then
+if [ -r $CMAKE_HOME ]
+then
export PATH=$CMAKE_HOME/bin:$PATH
fi
@@ -42,14 +43,16 @@ export ParaView_VERSION=2.4.4
export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/ParaView$ParaView_VERSION
export ParaView_DIR=$ParaView_INST_DIR/lib/paraview-2.4
-if [ -r $ParaView_INST_DIR ]; then
+if [ -r $ParaView_INST_DIR ]
+then
export PV_INTERFACE_PATH=$FOAM_UTILITIES/postProcessing/graphics/PVFoamReader/PVFoamReader/Make
export PATH=$ParaView_INST_DIR/bin:$PATH
export LD_LIBRARY_PATH=${ParaView_INST_DIR}/lib:${ParaView_INST_DIR}/lib/vtk:${LD_LIBRARY_PATH}
fi
-if [ -r $ParaView_DIR ]; then
+if [ -r $ParaView_DIR ]
+then
export VTK_DIR=$ParaView_DIR/VTK
fi
diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc
index b8da8ba698..8ff8781051 100644
--- a/etc/apps/paraview3/bashrc
+++ b/etc/apps/paraview3/bashrc
@@ -33,7 +33,8 @@
export CMAKE_HOME=$WM_THIRD_PARTY_DIR/cmake-2.4.6/platforms/$WM_ARCH
-if [ -r $CMAKE_HOME ]; then
+if [ -r $CMAKE_HOME ]
+then
export PATH=$CMAKE_HOME/bin:$PATH
else
unset CMAKE_HOME
@@ -44,14 +45,16 @@ export ParaView_VERSION="3.3-cvs"
export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/ParaView$ParaView_VERSION
export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
-if [ "$PYTHONPATH" ]; then
+if [ "$PYTHONPATH" ]
+then
export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/Utilities/VTKPythonWrapping:$ParaView_DIR/lib/paraview-3.3
else
export PYTHONPATH=$ParaView_DIR/Utilities/VTKPythonWrapping:$ParaView_DIR/lib/paraview-3.3
fi
-if [ -r $ParaView_DIR ]; then
+if [ -r $ParaView_DIR ]
+then
export PATH=$ParaView_DIR/bin:$PATH
export LD_LIBRARY_PATH=$ParaView_DIR/bin:$LD_LIBRARY_PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN
diff --git a/etc/bashrc b/etc/bashrc
index b862b6a933..ec96457be2 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -33,7 +33,7 @@
#------------------------------------------------------------------------------
export WM_PROJECT=OpenFOAM
-#export WM_PROJECT_VERSION=1.5.x
+# export WM_PROJECT_VERSION=1.5.x
: ${WM_PROJECT_VERSION:=dev}; export WM_PROJECT_VERSION
@@ -91,7 +91,7 @@ export WM_COMPILER_LIB_ARCH=
# WM_JAVAC_OPTION = Opt | Debug
: ${WM_JAVAC_OPTION:=Opt}; export WM_JAVAC_OPTION
-# WM_MPLIB = | OPENMPI| LAM | MPICH | MPICH-GM | GAMMA | MPI
+# WM_MPLIB = | OPENMPI| LAM | MPICH | MPICH-GM | HPMPI | GAMMA | MPI
: ${WM_MPLIB:=OPENMPI}; export WM_MPLIB
@@ -152,7 +152,7 @@ Linux)
cat <
+template
+Foam::HashSet::HashSet(const HashTable& ht)
+:
+ HashTable(ht.size())
{
+ for
+ (
+ typename HashTable::const_iterator iter = ht.begin();
+ iter != ht.end();
+ ++iter
+ )
+ {
+ insert(iter.key());
+ }
+}
+
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template
-bool HashSet::operator==(const HashSet& ht) const
+bool Foam::HashSet::operator==(const HashSet& rhs) const
{
- const HashTable& a = *this;
-
- // Are all my elements in ht?
- for
- (
- typename HashTable::const_iterator iter = a.begin();
- iter != a.end();
- ++iter
- )
+ // Are all lhs elements in rhs?
+ for (const_iterator iter = this->begin(); iter != this->end(); ++iter)
{
- if (!ht.found(iter.key()))
+ if (!rhs.found(iter.key()))
{
return false;
}
}
- // Are all ht elements in me?
- for
- (
- typename HashTable::const_iterator iter = ht.begin();
- iter != ht.end();
- ++iter
- )
+ // Are all rhs elements in lhs?
+ for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter)
{
if (!found(iter.key()))
{
return false;
}
}
+
return true;
}
template
-bool HashSet::operator!=(const HashSet& ht) const
+bool Foam::HashSet::operator!=(const HashSet& rhs) const
{
- return !(operator==(ht));
+ return !(operator==(rhs));
}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+template
+void Foam::HashSet::operator|=(const HashSet& rhs)
+{
+ // Add rhs elements into lhs
+ for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter)
+ {
+ insert(iter.key());
+ }
+}
+
+
+template
+void Foam::HashSet::operator&=(const HashSet& rhs)
+{
+ // Remove elements not also found in rhs
+ for (iterator iter = this->begin(); iter != this->end(); ++iter)
+ {
+ if (!rhs.found(iter.key()))
+ {
+ erase(iter);
+ }
+ }
+}
+
+
+template
+void Foam::HashSet::operator^=(const HashSet& rhs)
+{
+ // Add missed rhs elements, remove duplicate elements
+ for (const_iterator iter = rhs.begin(); iter != rhs.end(); ++iter)
+ {
+ if (found(iter.key()))
+ {
+ erase(iter.key());
+ }
+ else
+ {
+ insert(iter.key());
+ }
+ }
+}
+
+
+template
+void Foam::HashSet::operator-=(const HashSet