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
-

Table of Contents

-
- -
-
-–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/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/incompressible/boundaryFoam/Make/options b/applications/solvers/incompressible/boundaryFoam/Make/options index 835189da6d..e7594d177f 100644 --- a/applications/solvers/incompressible/boundaryFoam/Make/options +++ b/applications/solvers/incompressible/boundaryFoam/Make/options @@ -1,7 +1,9 @@ EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/RAS \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ diff --git a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C index 19933091a0..4ab797dc20 100644 --- a/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C +++ b/applications/solvers/incompressible/boundaryFoam/boundaryFoam.C @@ -37,8 +37,8 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" -#include "incompressible/RASModel/RASModel.H" +#include "singlePhaseTransportModel.H" +#include "RASModel.H" #include "wallFvPatch.H" #include "makeGraph.H" diff --git a/applications/solvers/incompressible/channelFoam/Make/files b/applications/solvers/incompressible/channelFoam/Make/files new file mode 100644 index 0000000000..35d5b4e617 --- /dev/null +++ b/applications/solvers/incompressible/channelFoam/Make/files @@ -0,0 +1,3 @@ +channelFoam.C + +EXE = $(FOAM_APPBIN)/channelFoam diff --git a/applications/solvers/incompressible/oodles/Make/options b/applications/solvers/incompressible/channelFoam/Make/options similarity index 59% rename from applications/solvers/incompressible/oodles/Make/options rename to applications/solvers/incompressible/channelFoam/Make/options index dd71fa8e53..594493ce21 100644 --- a/applications/solvers/incompressible/oodles/Make/options +++ b/applications/solvers/incompressible/channelFoam/Make/options @@ -1,9 +1,10 @@ EXE_INC = \ - -I$(LIB_SRC)/turbulenceModels/LES \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/turbulenceModels/incompressible/LES/LESModel \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ diff --git a/applications/solvers/incompressible/channelOodles/channelOodles.C b/applications/solvers/incompressible/channelFoam/channelFoam.C similarity index 96% rename from applications/solvers/incompressible/channelOodles/channelOodles.C rename to applications/solvers/incompressible/channelFoam/channelFoam.C index 00be546b6e..d21267b350 100644 --- a/applications/solvers/incompressible/channelOodles/channelOodles.C +++ b/applications/solvers/incompressible/channelFoam/channelFoam.C @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Application - oodles + channelFoam Description Incompressible LES solver for flow in a channel. @@ -31,8 +31,8 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" -#include "incompressible/LESModel/LESModel.H" +#include "singlePhaseTransportModel.H" +#include "LESModel.H" #include "IFstream.H" #include "OFstream.H" #include "Random.H" diff --git a/applications/solvers/incompressible/channelOodles/createFields.H b/applications/solvers/incompressible/channelFoam/createFields.H similarity index 100% rename from applications/solvers/incompressible/channelOodles/createFields.H rename to applications/solvers/incompressible/channelFoam/createFields.H diff --git a/applications/solvers/incompressible/channelOodles/createGradP.H b/applications/solvers/incompressible/channelFoam/createGradP.H similarity index 100% rename from applications/solvers/incompressible/channelOodles/createGradP.H rename to applications/solvers/incompressible/channelFoam/createGradP.H diff --git a/applications/solvers/incompressible/channelOodles/readTransportProperties.H b/applications/solvers/incompressible/channelFoam/readTransportProperties.H similarity index 100% rename from applications/solvers/incompressible/channelOodles/readTransportProperties.H rename to applications/solvers/incompressible/channelFoam/readTransportProperties.H diff --git a/applications/solvers/incompressible/channelOodles/writeGradP.H b/applications/solvers/incompressible/channelFoam/writeGradP.H similarity index 100% rename from applications/solvers/incompressible/channelOodles/writeGradP.H rename to applications/solvers/incompressible/channelFoam/writeGradP.H diff --git a/applications/solvers/incompressible/channelOodles/Make/files b/applications/solvers/incompressible/channelOodles/Make/files deleted file mode 100644 index 62d0719790..0000000000 --- a/applications/solvers/incompressible/channelOodles/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -channelOodles.C - -EXE = $(FOAM_APPBIN)/channelOodles diff --git a/applications/solvers/incompressible/channelOodles/Make/options b/applications/solvers/incompressible/channelOodles/Make/options deleted file mode 100644 index 7f55ccc3ed..0000000000 --- a/applications/solvers/incompressible/channelOodles/Make/options +++ /dev/null @@ -1,13 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/turbulenceModels/LES \ - -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ - -I../oodles - -EXE_LIBS = \ - -lincompressibleLESModels \ - -lincompressibleTransportModels \ - -lfiniteVolume \ - -lmeshTools diff --git a/applications/solvers/incompressible/icoDyMFoam/Make/files b/applications/solvers/incompressible/icoDyMFoam/Make/files deleted file mode 100644 index 22873bb943..0000000000 --- a/applications/solvers/incompressible/icoDyMFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -icoDyMFoam.C - -EXE = $(FOAM_APPBIN)/icoDyMFoam diff --git a/applications/solvers/incompressible/icoDyMFoam/Make/options b/applications/solvers/incompressible/icoDyMFoam/Make/options deleted file mode 100644 index aa1b2f2b09..0000000000 --- a/applications/solvers/incompressible/icoDyMFoam/Make/options +++ /dev/null @@ -1,11 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -EXE_LIBS = \ - -ldynamicFvMesh \ - -ldynamicMesh \ - -lmeshTools \ - -lfiniteVolume diff --git a/applications/solvers/incompressible/icoDyMFoam/UEqn.H b/applications/solvers/incompressible/icoDyMFoam/UEqn.H deleted file mode 100644 index 8ca5f83e4a..0000000000 --- a/applications/solvers/incompressible/icoDyMFoam/UEqn.H +++ /dev/null @@ -1,16 +0,0 @@ - fvVectorMatrix UEqn - ( - fvm::ddt(U) - + fvm::div(phi, U) - - fvm::laplacian(nu, U) - ); - - if (ocorr != nOuterCorr-1) - { - UEqn.relax(); - } - - if (momentumPredictor) - { - solve(UEqn == -fvc::grad(p)); - } diff --git a/applications/solvers/incompressible/icoDyMFoam/checkTotalVolume.H b/applications/solvers/incompressible/icoDyMFoam/checkTotalVolume.H deleted file mode 100644 index 1ee1e84fd1..0000000000 --- a/applications/solvers/incompressible/icoDyMFoam/checkTotalVolume.H +++ /dev/null @@ -1,6 +0,0 @@ - scalar newTotalVolume = sum(mesh.V()); - scalar totalVolRatio = newTotalVolume/totalVolume; - - Info << "Total volume change: " << totalVolRatio - 1 << endl; - - totalVolume = newTotalVolume; diff --git a/applications/solvers/incompressible/icoDyMFoam/createFields.H b/applications/solvers/incompressible/icoDyMFoam/createFields.H deleted file mode 100644 index b5368ae138..0000000000 --- a/applications/solvers/incompressible/icoDyMFoam/createFields.H +++ /dev/null @@ -1,72 +0,0 @@ - Info<< "Reading transportProperties\n" << endl; - - IOdictionary transportProperties - ( - IOobject - ( - "transportProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - dimensionedScalar nu - ( - transportProperties.lookup("nu") - ); - - - 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); - - - Info<< "Reading field rAU if present\n" << endl; - volScalarField rAU - ( - IOobject - ( - "rAU", - runTime.timeName(), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::AUTO_WRITE - ), - mesh, - runTime.deltaT(), - zeroGradientFvPatchScalarField::typeName - ); diff --git a/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/options b/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/options index 2c8c1447c3..8dbc9ba286 100644 --- a/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/options +++ b/applications/solvers/incompressible/nonNewtonianIcoFoam/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/transportModels + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel EXE_LIBS = \ -lfiniteVolume \ diff --git a/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C b/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C index 0f236a9017..db6342297a 100644 --- a/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C +++ b/applications/solvers/incompressible/nonNewtonianIcoFoam/nonNewtonianIcoFoam.C @@ -31,7 +31,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" +#include "singlePhaseTransportModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/oodles/Make/files b/applications/solvers/incompressible/oodles/Make/files deleted file mode 100644 index a395950ae5..0000000000 --- a/applications/solvers/incompressible/oodles/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -oodles.C - -EXE = $(FOAM_APPBIN)/oodles diff --git a/applications/solvers/incompressible/oodles/oodles.C b/applications/solvers/incompressible/oodles/oodles.C deleted file mode 100644 index 0714bf8515..0000000000 --- a/applications/solvers/incompressible/oodles/oodles.C +++ /dev/null @@ -1,128 +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 - oodles - -Description - Incompressible LES solver. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" -#include "incompressible/transportModel/transportModel.H" -#include "incompressible/LESModel/LESModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "setRootCase.H" - #include "createTime.H" - #include "createMeshNoClear.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 "CourantNo.H" - - sgsModel->correct(); - - 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..a3c8f75dee 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/incompressible/turbulenceModel \ + -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/rasCavitatingFoam/rasCavitatingFoam.C b/applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C similarity index 93% rename from applications/solvers/multiphase/rasCavitatingFoam/rasCavitatingFoam.C rename to applications/solvers/multiphase/cavitatingFoam/cavitatingFoam.C index 51d2a31dde..36ced22ada 100644 --- a/applications/solvers/multiphase/rasCavitatingFoam/rasCavitatingFoam.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 - rasCavitatingFoam + cavitatingFoam Description - Transient cavitation code with RAS 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/RASModel/RASModel.H" +#include "turbulenceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 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/lesCavitatingFoam.C b/applications/solvers/multiphase/lesCavitatingFoam/lesCavitatingFoam.C deleted file mode 100644 index 2ad2dfb04f..0000000000 --- a/applications/solvers/multiphase/lesCavitatingFoam/lesCavitatingFoam.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 - lesCavitatingFoam - -Description - Transient cavitation code with LES turbulence. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "barotropicCompressibilityModel.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 "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; - - turbulence->correct(); - - for (int outerCorr=0; outerCorrnuSgs()) - ); - - 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/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