Compare commits
128 Commits
OpenFOAM-v
...
maintenanc
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f5aae75e0 | |||
| ba8fa9f2ca | |||
| e8885c868d | |||
| cc676d1820 | |||
| 61ea8936bb | |||
| e6695e7354 | |||
| 79d4e466a2 | |||
| 085ff44ea4 | |||
| 967a5c2216 | |||
| 983a1d1b15 | |||
| 3d7b6bdba2 | |||
| 8d7379bc72 | |||
| 9d168b2b8e | |||
| 24a6c4810d | |||
| c97b1f21e1 | |||
| c7ec42c3da | |||
| 1497394c7a | |||
| b70b0bb5cb | |||
| e661d2382f | |||
| 331d24ed0c | |||
| a79eaa2d64 | |||
| 19b5952c35 | |||
| 83db6f793c | |||
| c9e9815b86 | |||
| 1ff9ae9ff5 | |||
| 1f408ffd1b | |||
| 1df1f8fe20 | |||
| dad301d81c | |||
| 779f884355 | |||
| 5682eb6035 | |||
| a5e1c11a4b | |||
| 2b5e278ffc | |||
| b386d8a1c2 | |||
| 9cfce48c9c | |||
| 8f7ad9130a | |||
| 0ceb2cd230 | |||
| 025eebca13 | |||
| a5ff48870f | |||
| 59418c711a | |||
| 4093fcd66b | |||
| 85885adea8 | |||
| 26b6f93b33 | |||
| 67970d02b6 | |||
| 9fbb796135 | |||
| fbc1a1d82a | |||
| 7d2ea92570 | |||
| af13209920 | |||
| 53ed99b084 | |||
| 6f4509b938 | |||
| 4e5d2d8e04 | |||
| b0d1deeb69 | |||
| 008a583992 | |||
| b4f050ad52 | |||
| a5fbb36d73 | |||
| 3aa54d114d | |||
| a70e4ef8fe | |||
| 2bbbcf60de | |||
| a32c043944 | |||
| 0e5054c3c7 | |||
| b74cf47bc3 | |||
| 0d9fc569c5 | |||
| 7110aa8236 | |||
| b5231f2ec1 | |||
| fa2ae8e7b4 | |||
| 86c214de81 | |||
| 71e1f300c8 | |||
| 4e1ce0241a | |||
| ef4ae3063b | |||
| d716c59f57 | |||
| b12b50548b | |||
| 8524c72854 | |||
| ce1abf5b42 | |||
| ea1c9a1559 | |||
| feed30d63c | |||
| 9e766b8bc5 | |||
| 616cb0f137 | |||
| ed2017aa21 | |||
| 215f9a8555 | |||
| e219399d93 | |||
| d6e15499b8 | |||
| 267409dc62 | |||
| 7241e7ddd0 | |||
| 571fc94077 | |||
| 2b40688ebd | |||
| b548540589 | |||
| 3fbd69b9e7 | |||
| 633c0fcc37 | |||
| 0e13a0462f | |||
| 57e36b5252 | |||
| ec478c9636 | |||
| 4302ddf47e | |||
| 28c15a6ec1 | |||
| 42325c9cf1 | |||
| b34b7fab82 | |||
| 8af962c7b2 | |||
| 03f552aa6e | |||
| a985c5520b | |||
| 93119a478a | |||
| d57867da1d | |||
| 5ad923bf50 | |||
| 4076d9c9d4 | |||
| 9b848b64e0 | |||
| 7a3f0f3feb | |||
| 3772e2ea44 | |||
| 0c1962ca06 | |||
| 9317ca55dc | |||
| 9b052de408 | |||
| e340c86b62 | |||
| 8f2a40a960 | |||
| 0c28b34833 | |||
| 2df891993c | |||
| daf86f8b7d | |||
| 211754795b | |||
| 3aa32c4830 | |||
| 803871ae48 | |||
| ecbe31d210 | |||
| 3637024d45 | |||
| a17c282104 | |||
| b062ca29e7 | |||
| 18842a7069 | |||
| acd51c8d7e | |||
| 758900bf39 | |||
| 06aa7205d0 | |||
| 8ab25d7d31 | |||
| c4511687c4 | |||
| b2c5e66699 | |||
| b1a419d576 | |||
| e120a7698e |
16
.gitignore
vendored
16
.gitignore
vendored
@ -4,9 +4,10 @@
|
||||
# Editor and misc backup files - anywhere
|
||||
*~
|
||||
.*~
|
||||
.*.swp
|
||||
*.bak
|
||||
*.bak[0-9][0-9]
|
||||
*.orig
|
||||
*.orig[0-9][0-9]
|
||||
\#*\#
|
||||
|
||||
# File-browser settings - anywhere
|
||||
@ -40,12 +41,8 @@ solaris*Gcc*/
|
||||
SunOS*Gcc*/
|
||||
platforms/
|
||||
|
||||
# Top-level build directories
|
||||
/build/
|
||||
/platforms/
|
||||
|
||||
# Reinstate wmake rules that might look like build directories
|
||||
!/wmake/rules/*/
|
||||
# Reinstate wmake/rules that might look like build directories
|
||||
!wmake/rules/*/
|
||||
|
||||
# doxygen generated documentation
|
||||
doc/Doxygen/html
|
||||
@ -63,12 +60,10 @@ doc/Doxygen/DTAGS
|
||||
/etc/prefs.sh
|
||||
/etc/config.csh/prefs.csh
|
||||
/etc/config.sh/prefs.sh
|
||||
/wmake/rules/General/mplibUSER*
|
||||
|
||||
# Source packages - anywhere
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
*.tar.xz
|
||||
*.tar
|
||||
*.tgz
|
||||
*.gtgz
|
||||
@ -82,10 +77,9 @@ doc/Doxygen/DTAGS
|
||||
# Ignore .tags in the main directory
|
||||
/.tags
|
||||
|
||||
# Ignore project files in the main directory
|
||||
# Ignore eclipse project files in the main directory
|
||||
/.cproject
|
||||
/.project
|
||||
/.dir-locals.el
|
||||
|
||||
# Ignore the test directory
|
||||
/tutorialsTest
|
||||
|
||||
9
.gitmodules
vendored
9
.gitmodules
vendored
@ -1,9 +0,0 @@
|
||||
[submodule "cfmesh"]
|
||||
path = modules/cfmesh
|
||||
url = https://develop.openfoam.com/Community/integration-cfmesh.git
|
||||
[submodule "avalanche"]
|
||||
path = modules/avalanche
|
||||
url = https://develop.openfoam.com/Community/avalanche.git
|
||||
[submodule "catalyst"]
|
||||
path = modules/catalyst
|
||||
url = https://develop.openfoam.com/Community/catalyst.git
|
||||
66
Allwmake
66
Allwmake
@ -1,62 +1,46 @@
|
||||
#!/bin/sh
|
||||
# Run from OPENFOAM top-level directory only
|
||||
cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
[ -d "$WM_PROJECT_DIR" -a -f "$WM_PROJECT_DIR/etc/bashrc" ] || {
|
||||
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation without documentation by default
|
||||
genDoc=0
|
||||
targetType=libso
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
echo "========================================"
|
||||
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
|
||||
echo "Starting ${WM_PROJECT_DIR##*/} ${0##*}"
|
||||
echo " $WM_COMPILER $WM_COMPILER_TYPE compiler"
|
||||
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
|
||||
echo
|
||||
wmakeCheckPwd "$WM_PROJECT_DIR" || {
|
||||
echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR"
|
||||
echo " The environment variables are inconsistent with the installation."
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Compile wmake tools
|
||||
(cd "${WM_DIR:-wmake}/src" && make)
|
||||
[ -n "$FOAM_EXT_LIBBIN" ] || {
|
||||
echo "Allwmake error: FOAM_EXT_LIBBIN not set"
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Compile wmake support applications
|
||||
(cd wmake/src && make)
|
||||
|
||||
# Compile ThirdParty libraries and applications
|
||||
if [ -d "$WM_THIRD_PARTY_DIR" ]
|
||||
then
|
||||
$WM_THIRD_PARTY_DIR/Allwmake
|
||||
else
|
||||
echo "No ThirdParty directory found - skipping"
|
||||
echo "Allwmake: no ThirdParty directory found - skipping"
|
||||
fi
|
||||
|
||||
echo "========================================"
|
||||
echo "Compile OpenFOAM libraries"
|
||||
echo
|
||||
# Compile OpenFOAM libraries and applications
|
||||
src/Allwmake $targetType $*
|
||||
|
||||
echo "========================================"
|
||||
echo "Compile OpenFOAM applications"
|
||||
echo
|
||||
# Compile OpenFOAM libraries and applications
|
||||
applications/Allwmake $targetType $*
|
||||
|
||||
# Additional components/modules
|
||||
if [ -d "$WM_PROJECT_DIR/modules" ]
|
||||
# Optionally build OpenFOAM Doxygen documentation
|
||||
if [ $genDoc -eq 1 ]
|
||||
then
|
||||
echo "========================================"
|
||||
echo "Compile OpenFOAM modules"
|
||||
echo
|
||||
(cd $WM_PROJECT_DIR/modules 2>/dev/null && wmake -all)
|
||||
doc/Allwmake
|
||||
fi
|
||||
|
||||
# Some summary information
|
||||
echo
|
||||
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
|
||||
echo "========================================"
|
||||
echo " ${WM_PROJECT_DIR##*/}"
|
||||
echo " $WM_COMPILER $WM_COMPILER_TYPE compiler"
|
||||
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
|
||||
echo
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
151
BuildIssues.txt
151
BuildIssues.txt
@ -1,151 +0,0 @@
|
||||
OpenFOAM-1712
|
||||
==================
|
||||
Known Build Issues
|
||||
==================
|
||||
|
||||
---------------------
|
||||
Intel MPI (Gcc/Clang)
|
||||
---------------------
|
||||
|
||||
Either I_MPI_ROOT or MPI_ROOT can be used to specify the Intel-MPI
|
||||
installation directory path.
|
||||
|
||||
The ThirdParty build of ptscotch uses `mpiicc` for Intel-MPI
|
||||
instead of the usual `mpicc`.
|
||||
When gcc or clang are used, it is highly likely that the
|
||||
I_MPI_CC environment variable also needs to be set accordingly.
|
||||
|
||||
See `mpiicc -help` for more information about environment variables.
|
||||
|
||||
|
||||
--------------
|
||||
Intel Compiler
|
||||
--------------
|
||||
|
||||
Since OpenFOAM uses C++11, a fairly recent version is required.
|
||||
The Intel compiler - icc (ICC) 17.0.1 20161005 is ok, but the
|
||||
initial release - icc (ICC) 17.0.0 20160721 - has a bug that
|
||||
will result in these types of error messages.
|
||||
|
||||
MatrixSpaceI.H(492): error: no instance of overloaded function
|
||||
"Foam::MatrixSpace<Form, Cmpt, Mrows, Ncols>::Block<SubTensor,
|
||||
BRowStart, BColStart>::operator=" matches the specified type
|
||||
|
||||
|
||||
---
|
||||
VTK
|
||||
---
|
||||
|
||||
If using the runTimePostProcessing to create on-the-fly images, you
|
||||
can simply just compile ParaView and these libraries will be used.
|
||||
|
||||
If you elect to use a separate VTK compilation (for example for
|
||||
off-screen rendering), it is advisable to reuse the VTK libraries that
|
||||
are provided with ParaView by making an appropriate symlink
|
||||
prior to using makeVTK. This doesn't just reduce disk-space, but works
|
||||
much better than using the VTK tar file.
|
||||
|
||||
Using runTimePostProcessing with the 'plain' VTK libraries does
|
||||
generally work, but does not exit cleanly:
|
||||
|
||||
symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonExecutionModel-7.1.so.1:
|
||||
undefined symbol: _ZN33vtkFilteringInformationKeyManager13ClassFinalizeEv
|
||||
|
||||
symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonDataModel-7.1.so.1:
|
||||
undefined symbol: _ZN49vtkInformationQuadratureSchemeDefinitionVectorKeyD1Ev
|
||||
|
||||
This error appears to be suppressed if VTK is compiled with a Debug build-type.
|
||||
|
||||
|
||||
-------------------------
|
||||
Building on older systems
|
||||
-------------------------
|
||||
|
||||
If the system gcc is too old for building OpenFOAM, a third-party gcc or
|
||||
clang/llvm installation can be used. If building clang/llvm, note that
|
||||
there are also minimum gcc/g++ requirements there:
|
||||
|
||||
Min gcc/g++
|
||||
=========== ==========
|
||||
4.4 llvm-3.4.2
|
||||
4.7 llvm-3.5.2 - llvm-3.7.0
|
||||
|
||||
|
||||
If your system compiler is too old to build the minimum required gcc or
|
||||
clang/llvm, it is just simply too old.
|
||||
|
||||
|
||||
---------------------------------
|
||||
ThirdParty clang without gmp/mpfr
|
||||
---------------------------------
|
||||
|
||||
If using ThirdParty clang without gmp/mpfr, the ThirdParty makeCGAL
|
||||
script will need to be run manually and specify that there is no
|
||||
gmp/mpfr. Eg,
|
||||
|
||||
cd $WM_THIRD_PARTY_DIR
|
||||
./makeCGAL gmp-none mpfr-none
|
||||
|
||||
Subequent compilation with Allwmake will now run largely without any
|
||||
problems, except that the components linking against CGAL
|
||||
(foamyMesh and surfaceBooleanFeatures) will also try to link against
|
||||
a nonexistent mpfr library. As a workaround, the link-dependency can
|
||||
be removed in wmake/rules/General/CGAL :
|
||||
|
||||
CGAL_LIBS = \
|
||||
-L$(BOOST_ARCH_PATH)/lib \
|
||||
-L$(BOOST_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-L$(CGAL_ARCH_PATH)/lib \
|
||||
-L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-lCGAL
|
||||
|
||||
This is a temporary inconvenience until a more robust solution is found.
|
||||
|
||||
|
||||
-------------------------
|
||||
Building with spack
|
||||
-------------------------
|
||||
|
||||
If you are building with spack, note that the depends_on for paraview
|
||||
resolves poorly. The +qt dependency (for building the reader module)
|
||||
may need to be specified as a preference by including the following in
|
||||
your `~/.spack/packages.yaml` file:
|
||||
|
||||
packages:
|
||||
paraview:
|
||||
variants: +qt
|
||||
|
||||
It appears that spack will otherwise ignore any paraview+qt version
|
||||
and attempt to install a paraview~qt version instead.
|
||||
|
||||
---------------------------
|
||||
Building on Darwin (Mac-OS)
|
||||
---------------------------
|
||||
|
||||
Support for Darwin is incomplete, but has been provisioned for.
|
||||
|
||||
The following are typical (as of yet) unresolved issues.
|
||||
|
||||
* Scotch, ptscotch:
|
||||
- The librt linkage is required for Linux, but not for Darwin.
|
||||
|
||||
Current resolution:
|
||||
Edit or patch
|
||||
src/parallel/decompose/ptscotchDecomp/Make/options
|
||||
src/parallel/decompose/scotchDecomp/Make/options
|
||||
|
||||
to remove the '-lrt' library
|
||||
|
||||
* CGAL:
|
||||
- ThirdParty CGAL will normally need to be compiled without mpfr/gmp.
|
||||
This should be done manually prior to building OpenFOAM or other
|
||||
ThirdParty. Eg,
|
||||
|
||||
cd $WM_THIRD_PARTY_DIR
|
||||
./makeCGAL gmp-none mpfr-none
|
||||
|
||||
The erroneous references to gmp/mpfr library can be directly removed
|
||||
from the wmake/rules/General/CGAL, but it is more advisable to
|
||||
override them instead in the wmake/rules/darwin64Clang/CGAL file.
|
||||
|
||||
--
|
||||
23
README.md
23
README.md
@ -1,27 +1,22 @@
|
||||
# About OpenFOAM
|
||||
OpenFOAM is a free, open source CFD software [released and developed primarily by OpenCFD Ltd](http://www.openfoam.com) since 2004. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics. [More...](http://www.openfoam.com/documentation)
|
||||
OpenFOAM is a free, open source CFD software package developed primarily by [OpenCFD](http://www.openfoam.com) since 2004 and is currently distributed by [ESI-OpenCFD](http://www.openfoam.com) and the [OpenFOAM Foundation](http://openfoam.org). It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics. [More...](http://www.openfoam.com/documentation)
|
||||
|
||||
|
||||
OpenFOAM is professionally released every six months to include customer sponsored developments and contributions from the community - individual and group contributors, fork re-integrations including from FOAM-extend and OpenFOAM Foundation Ltd - in this Official Release sanctioned by the OpenFOAM Worldwide Trademark Owner aiming towards one OpenFOAM.
|
||||
OpenFOAM+ uses the OpenFOAM Foundation version as a common code base, with wider functionality and platform support. Its purpose is to accelerate the public availability of new features which are sponsored by OpenCFD's customers and contributed by the OpenFOAM community.
|
||||
|
||||
|
||||
# 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 3 of the License, or (at your option) any later version. See the file COPYING in this directory or [http://www.gnu.org/licenses/](http://www.gnu.org/licenses), for a description of the GNU General Public License terms under which you can copy the files.
|
||||
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 3 of the License, or (at your option) any later version. See the file COPYING in this directory or [http://www.gnu.org/licenses/](http://www.gnu.org/licenses/), for a description of the GNU General Public License terms under which you can copy the files.
|
||||
|
||||
|
||||
# OpenFOAM Trademark
|
||||
OpenCFD Ltd grants use of its OpenFOAM trademark by Third Parties on a licence basis. ESI Group and OpenFOAM Foundation Ltd are currently permitted to use the Name and agreed Domain Name. For information on trademark use, please refer to the [trademark policy guidelines](http://www.openfoam.com/legal/trademark-policy.php).
|
||||
|
||||
Please [contact OpenCFD](http://www.openfoam.com/contact) if you have any questions on the use of the OpenFOAM trademark.
|
||||
|
||||
Violations of the Trademark are continuously monitored, and will be duly prosecuted.
|
||||
OpenCFD Limited, owner of the OpenFOAM Trademark, has granted the use of the Trademark to the OpenFOAM Foundation. Violations of the Trademark are continuously monitored and will be duly prosecuted. Please [contact OpenCFD](http://www.openfoam.com/contact) if you have any questions on the use of the OpenFOAM trademark.
|
||||
|
||||
|
||||
# Useful Links
|
||||
- [Download and installation instructions](http://www.openfoam.com/download/)
|
||||
- [Download and installation instructions](http://www.openfoam.com/releases)
|
||||
- [Documentation](http://www.openfoam.com/documentation)
|
||||
- [Reporting bugs/issues/feature requests](http://www.openfoam.com/code/bug-reporting.php)
|
||||
- [OpenFOAM Community](http://www.openfoam.com/community/)
|
||||
- [Contacting OpenCFD](http://www.openfoam.com/contact/)
|
||||
- [Reporting bugs/issues (including bugs/suggestions/feature requests) in OpenFOAM+](http://www.openfoam.com/code/bug-reporting.php)
|
||||
- [Collaborative and Community-based Developments](http://www.openfoam.com/services/community-projects.php)
|
||||
- [Contacting OpenCFD](http://www.openfoam.com/contact)
|
||||
|
||||
Copyright 2016-2018 OpenCFD Ltd
|
||||
Copyright 2016 OpenCFD Ltd
|
||||
|
||||
@ -1,21 +1,27 @@
|
||||
#!/bin/sh
|
||||
# Run from OPENFOAM applications/ directory only
|
||||
cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR/applications" 2>/dev/null || {
|
||||
echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR/applications"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
[ -d "$WM_PROJECT_DIR" -a -f "$WM_PROJECT_DIR/etc/bashrc" ] || {
|
||||
echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
|
||||
echo " Check your OpenFOAM environment and installation"
|
||||
exit 1
|
||||
}
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
targetType=libso
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
|
||||
echo "Allwmake error: Current directory is not \$WM_PROJECT_DIR/applications"
|
||||
echo " The environment variables are inconsistent with the installation."
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ -n "$FOAM_EXT_LIBBIN" ] || {
|
||||
echo "Allwmake error: FOAM_EXT_LIBBIN not set"
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
wmake -all solvers $*
|
||||
wmake -all utilities $*
|
||||
|
||||
wmake -all $targetType solvers
|
||||
wmake -all $targetType utilities
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if have_fftw
|
||||
if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
|
||||
[ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
|
||||
then
|
||||
wmake
|
||||
else
|
||||
echo "==> skip dnsFoam solver (no FFTW)"
|
||||
echo
|
||||
echo "Skipping dnsFoam solver (no FFTW)"
|
||||
echo
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
#include "readTransportProperties.H"
|
||||
|
||||
Info<< "Reading field p\n" << endl;
|
||||
volScalarField p
|
||||
(
|
||||
@ -31,5 +29,3 @@ volVectorField U
|
||||
#include "createPhi.H"
|
||||
|
||||
mesh.setFluxRequired(p.name());
|
||||
|
||||
#include "readTurbulenceProperties.H"
|
||||
|
||||
@ -28,7 +28,7 @@ Group
|
||||
grpDNSSolvers
|
||||
|
||||
Description
|
||||
Direct numerical simulation solver for boxes of isotropic turbulence.
|
||||
Direct numerical simulation solver for boxes of isotropic turbulence
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -44,36 +44,32 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
#include "createTime.H"
|
||||
#include "createMeshNoClear.H"
|
||||
#include "createControl.H"
|
||||
|
||||
pisoControl piso(mesh);
|
||||
|
||||
#include "readTransportProperties.H"
|
||||
#include "createFields.H"
|
||||
#include "readTurbulenceProperties.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
label ntot = 1;
|
||||
forAll(K.nn(), idim)
|
||||
{
|
||||
ntot *= K.nn()[idim];
|
||||
}
|
||||
const scalar recRootN = 1.0/Foam::sqrt(scalar(ntot));
|
||||
|
||||
Info<< nl << "Starting time loop" << endl;
|
||||
|
||||
while (runTime.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
force.primitiveFieldRef() = ReImSum
|
||||
force.internalField() = ReImSum
|
||||
(
|
||||
fft::reverseTransform
|
||||
(
|
||||
K/(mag(K) + 1.0e-6) ^ forceGen.newField(), K.nn()
|
||||
)*recRootN
|
||||
)
|
||||
);
|
||||
|
||||
#include "globalProperties.H"
|
||||
@ -123,7 +119,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
runTime.write();
|
||||
|
||||
if (runTime.writeTime())
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
calcEk(U, K).write
|
||||
(
|
||||
@ -133,7 +129,9 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -19,4 +19,3 @@
|
||||
|
||||
Kmesh K(mesh);
|
||||
UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties);
|
||||
|
||||
|
||||
@ -4,5 +4,4 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lmeshTools
|
||||
|
||||
@ -1,41 +1,37 @@
|
||||
Info<< "Reading field T\n" << endl;
|
||||
Info<< "Reading field T\n" << endl;
|
||||
|
||||
volScalarField T
|
||||
(
|
||||
IOobject
|
||||
volScalarField T
|
||||
(
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
IOobject
|
||||
(
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading diffusivity DT\n" << endl;
|
||||
Info<< "Reading diffusivity DT\n" << endl;
|
||||
|
||||
dimensionedScalar DT
|
||||
(
|
||||
"DT",
|
||||
dimArea/dimTime,
|
||||
transportProperties
|
||||
);
|
||||
|
||||
#include "createFvOptions.H"
|
||||
dimensionedScalar DT
|
||||
(
|
||||
transportProperties.lookup("DT")
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -52,14 +52,12 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "fvOptions.H"
|
||||
#include "simpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCase.H"
|
||||
|
||||
#include "createTime.H"
|
||||
@ -79,21 +77,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix TEqn
|
||||
solve
|
||||
(
|
||||
fvm::ddt(T) - fvm::laplacian(DT, T)
|
||||
==
|
||||
fvOptions(T)
|
||||
);
|
||||
|
||||
fvOptions.constrain(TEqn);
|
||||
TEqn.solve();
|
||||
fvOptions.correct(T);
|
||||
}
|
||||
|
||||
#include "write.H"
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
overLaplacianDyMFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/overLaplacianDyMFoam
|
||||
@ -1,8 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/overset/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-loverset
|
||||
@ -1,53 +0,0 @@
|
||||
Info<< "Reading field T\n" << endl;
|
||||
|
||||
volScalarField T
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
// Add overset specific interpolations
|
||||
{
|
||||
dictionary oversetDict;
|
||||
oversetDict.add("T", true);
|
||||
|
||||
const_cast<dictionary&>
|
||||
(
|
||||
mesh.schemesDict()
|
||||
).add
|
||||
(
|
||||
"oversetInterpolationRequired",
|
||||
oversetDict,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading diffusivity DT\n" << endl;
|
||||
|
||||
dimensionedScalar DT
|
||||
(
|
||||
transportProperties.lookup("DT")
|
||||
);
|
||||
@ -1,108 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
overLaplacianDyMFoam
|
||||
|
||||
Group
|
||||
grpBasicSolvers
|
||||
|
||||
Description
|
||||
Laplace equation solver for a scalar quantity.
|
||||
|
||||
\heading Solver details
|
||||
The solver is applicable to, e.g. for thermal diffusion in a solid. The
|
||||
equation is given by:
|
||||
|
||||
\f[
|
||||
\ddt{T} = \div \left( D_T \grad T \right)
|
||||
\f]
|
||||
|
||||
Where:
|
||||
\vartable
|
||||
T | Scalar field which is solved for, e.g. temperature
|
||||
D_T | Diffusion coefficient
|
||||
\endvartable
|
||||
|
||||
\heading Required fields
|
||||
\plaintable
|
||||
T | Scalar field which is solved for, e.g. temperature
|
||||
\endplaintable
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "fvOptions.H"
|
||||
#include "simpleControl.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
|
||||
#include "createTime.H"
|
||||
#include "createNamedDynamicFvMesh.H"
|
||||
|
||||
simpleControl simple(mesh);
|
||||
|
||||
#include "createFields.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nCalculating temperature distribution\n" << endl;
|
||||
|
||||
while (simple.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
mesh.update();
|
||||
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix TEqn
|
||||
(
|
||||
fvm::ddt(T) - fvm::laplacian(DT, T)
|
||||
==
|
||||
fvOptions(T)
|
||||
);
|
||||
|
||||
fvOptions.constrain(TEqn);
|
||||
TEqn.solve();
|
||||
fvOptions.correct(T);
|
||||
}
|
||||
|
||||
#include "write.H"
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,46 +0,0 @@
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
volVectorField gradT(fvc::grad(T));
|
||||
|
||||
volScalarField gradTx
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"gradTx",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
gradT.component(vector::X)
|
||||
);
|
||||
|
||||
volScalarField gradTy
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"gradTy",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
gradT.component(vector::Y)
|
||||
);
|
||||
|
||||
volScalarField gradTz
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"gradTz",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
gradT.component(vector::Z)
|
||||
);
|
||||
|
||||
|
||||
runTime.write();
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
if (runTime.writeTime())
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
volVectorField gradT(fvc::grad(T));
|
||||
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
const dictionary& potentialFlow
|
||||
(
|
||||
mesh.solutionDict().subDict("potentialFlow")
|
||||
);
|
||||
|
||||
const int nNonOrthCorr
|
||||
(
|
||||
potentialFlow.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0)
|
||||
);
|
||||
@ -13,7 +13,7 @@ volVectorField U
|
||||
);
|
||||
|
||||
// Initialise the velocity internal field to zero
|
||||
U = dimensionedVector(U.dimensions(), Zero);
|
||||
U = dimensionedVector("0", U.dimensions(), Zero);
|
||||
|
||||
surfaceScalarField phi
|
||||
(
|
||||
@ -28,7 +28,7 @@ surfaceScalarField phi
|
||||
fvc::flux(U)
|
||||
);
|
||||
|
||||
if (args.found("initialiseUBCs"))
|
||||
if (args.optionFound("initialiseUBCs"))
|
||||
{
|
||||
U.correctBoundaryConditions();
|
||||
phi = fvc::flux(U);
|
||||
@ -41,9 +41,9 @@ if (args.found("initialiseUBCs"))
|
||||
word pName("p");
|
||||
|
||||
// Update name of the pressure field from the command-line option
|
||||
args.readIfPresent("pName", pName);
|
||||
args.optionReadIfPresent("pName", pName);
|
||||
|
||||
// Infer the pressure BCs from the velocity
|
||||
// Infer the pressure BCs from the velocity BCs
|
||||
wordList pBCTypes
|
||||
(
|
||||
U.boundaryField().size(),
|
||||
@ -74,41 +74,67 @@ volScalarField p
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(sqr(dimVelocity), Zero),
|
||||
dimensionedScalar(pName, sqr(dimVelocity), 0),
|
||||
pBCTypes
|
||||
);
|
||||
|
||||
// Infer the velocity potential BCs from the pressure
|
||||
wordList PhiBCTypes
|
||||
(
|
||||
p.boundaryField().size(),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
forAll(p.boundaryField(), patchi)
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
if (args.optionFound("writep"))
|
||||
{
|
||||
if (p.boundaryField()[patchi].fixesValue())
|
||||
{
|
||||
PhiBCTypes[patchi] = fixedValueFvPatchScalarField::typeName;
|
||||
}
|
||||
setRefCell
|
||||
(
|
||||
p,
|
||||
potentialFlow.dict(),
|
||||
pRefCell,
|
||||
pRefValue
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Info<< "Constructing velocity potential field Phi\n" << endl;
|
||||
volScalarField Phi
|
||||
autoPtr<volScalarField> PhiPtr;
|
||||
|
||||
IOobject io
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
"Phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
dimensionedScalar(dimLength*dimVelocity, Zero),
|
||||
PhiBCTypes
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
if (io.typeHeaderOk<volScalarField>())
|
||||
{
|
||||
PhiPtr.reset(new volScalarField(io, mesh));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cannot just use p.boundaryField().types() since does not initialise
|
||||
// complex boundary types. Instead re-clone them from p.
|
||||
|
||||
io.readOpt() = IOobject::NO_READ;
|
||||
PhiPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
io,
|
||||
mesh,
|
||||
dimensionedScalar("Phi", dimLength*dimVelocity, 0),
|
||||
p.boundaryField().types()
|
||||
)
|
||||
);
|
||||
|
||||
const volScalarField::GeometricBoundaryField& bp = p.boundaryField();
|
||||
volScalarField::GeometricBoundaryField& bPhi = PhiPtr().boundaryField();
|
||||
|
||||
forAll(bp, patchI)
|
||||
{
|
||||
bPhi.set(patchI, bp[patchI].clone(PhiPtr().dimensionedInternalField()));
|
||||
}
|
||||
}
|
||||
volScalarField& Phi = PhiPtr();
|
||||
|
||||
label PhiRefCell = 0;
|
||||
scalar PhiRefValue = 0;
|
||||
setRefCell
|
||||
@ -119,5 +145,3 @@ setRefCell
|
||||
PhiRefValue
|
||||
);
|
||||
mesh.setFluxRequired(Phi.name());
|
||||
|
||||
#include "createMRF.H"
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
overPotentialFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/overPotentialFoam
|
||||
@ -1,12 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/overset/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lsampling \
|
||||
-loverset
|
||||
@ -1,9 +0,0 @@
|
||||
const dictionary& potentialFlow
|
||||
(
|
||||
mesh.solutionDict().subDict("potentialFlow")
|
||||
);
|
||||
|
||||
const int nNonOrthCorr
|
||||
(
|
||||
potentialFlow.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0)
|
||||
);
|
||||
@ -1,146 +0,0 @@
|
||||
Info<< "Reading velocity field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
// Initialise the velocity internal field to zero
|
||||
U = dimensionedVector(U.dimensions(), Zero);
|
||||
|
||||
surfaceScalarField phi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
fvc::flux(U)
|
||||
);
|
||||
|
||||
if (args.found("initialiseUBCs"))
|
||||
{
|
||||
U.correctBoundaryConditions();
|
||||
phi = fvc::flux(U);
|
||||
}
|
||||
|
||||
|
||||
// Construct a pressure field
|
||||
// If it is available read it otherwise construct from the velocity BCs
|
||||
// converting fixed-value BCs to zero-gradient and vice versa.
|
||||
word pName("p");
|
||||
|
||||
// Update name of the pressure field from the command-line option
|
||||
args.readIfPresent("pName", pName);
|
||||
|
||||
// Infer the pressure BCs from the velocity
|
||||
wordList pBCTypes
|
||||
(
|
||||
U.boundaryField().size(),
|
||||
fixedValueFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
forAll(U.boundaryField(), patchi)
|
||||
{
|
||||
if (U.boundaryField()[patchi].fixesValue())
|
||||
{
|
||||
pBCTypes[patchi] = zeroGradientFvPatchScalarField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
// Note that registerObject is false for the pressure field. The pressure
|
||||
// field in this solver doesn't have a physical value during the solution.
|
||||
// It shouldn't be looked up and used by sub models or boundary conditions.
|
||||
Info<< "Constructing pressure field " << pName << nl << endl;
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
pName,
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(sqr(dimVelocity), Zero),
|
||||
pBCTypes
|
||||
);
|
||||
|
||||
// Infer the velocity potential BCs from the pressure
|
||||
wordList PhiBCTypes
|
||||
(
|
||||
p.boundaryField().size(),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
forAll(p.boundaryField(), patchi)
|
||||
{
|
||||
if (p.boundaryField()[patchi].fixesValue())
|
||||
{
|
||||
PhiBCTypes[patchi] = fixedValueFvPatchScalarField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "Constructing velocity potential field Phi\n" << endl;
|
||||
volScalarField Phi
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Phi",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimLength*dimVelocity, Zero),
|
||||
PhiBCTypes
|
||||
);
|
||||
|
||||
label PhiRefCell = 0;
|
||||
scalar PhiRefValue = 0;
|
||||
setRefCell
|
||||
(
|
||||
Phi,
|
||||
potentialFlow.dict(),
|
||||
PhiRefCell,
|
||||
PhiRefValue
|
||||
);
|
||||
mesh.setFluxRequired(Phi.name());
|
||||
|
||||
#include "createMRF.H"
|
||||
|
||||
// Add overset specific interpolations
|
||||
{
|
||||
dictionary oversetDict;
|
||||
oversetDict.add("Phi", true);
|
||||
oversetDict.add("U", true);
|
||||
|
||||
const_cast<dictionary&>
|
||||
(
|
||||
mesh.schemesDict()
|
||||
).add
|
||||
(
|
||||
"oversetInterpolationRequired",
|
||||
oversetDict,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// Mask field for zeroing out contributions on hole cells
|
||||
#include "createCellMask.H"
|
||||
|
||||
// Create bool field with interpolated cells
|
||||
#include "createInterpolatedCells.H"
|
||||
@ -1,258 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
overPotentialFoam
|
||||
|
||||
Group
|
||||
grpBasicSolvers
|
||||
|
||||
Description
|
||||
Potential flow solver which solves for the velocity potential, to
|
||||
calculate the flux-field, from which the velocity field is obtained by
|
||||
reconstructing the flux.
|
||||
|
||||
\heading Solver details
|
||||
The potential flow solution is typically employed to generate initial fields
|
||||
for full Navier-Stokes codes. The flow is evolved using the equation:
|
||||
|
||||
\f[
|
||||
\laplacian \Phi = \div(\vec{U})
|
||||
\f]
|
||||
|
||||
Where:
|
||||
\vartable
|
||||
\Phi | Velocity potential [m2/s]
|
||||
\vec{U} | Velocity [m/s]
|
||||
\endvartable
|
||||
|
||||
The corresponding pressure field could be calculated from the divergence
|
||||
of the Euler equation:
|
||||
|
||||
\f[
|
||||
\laplacian p + \div(\div(\vec{U}\otimes\vec{U})) = 0
|
||||
\f]
|
||||
|
||||
but this generates excessive pressure variation in regions of large
|
||||
velocity gradient normal to the flow direction. A better option is to
|
||||
calculate the pressure field corresponding to velocity variation along the
|
||||
stream-lines:
|
||||
|
||||
\f[
|
||||
\laplacian p + \div(\vec{F}\cdot\div(\vec{U}\otimes\vec{U})) = 0
|
||||
\f]
|
||||
where the flow direction tensor \f$\vec{F}\f$ is obtained from
|
||||
\f[
|
||||
\vec{F} = \hat{\vec{U}}\otimes\hat{\vec{U}}
|
||||
\f]
|
||||
|
||||
\heading Required fields
|
||||
\plaintable
|
||||
U | Velocity [m/s]
|
||||
\endplaintable
|
||||
|
||||
\heading Optional fields
|
||||
\plaintable
|
||||
p | Kinematic pressure [m2/s2]
|
||||
Phi | Velocity potential [m2/s]
|
||||
| Generated from p (if present) or U if not present
|
||||
\endplaintable
|
||||
|
||||
\heading Options
|
||||
\plaintable
|
||||
-writep | write the Euler pressure
|
||||
-writePhi | Write the final velocity potential
|
||||
-initialiseUBCs | Update the velocity boundaries before solving for Phi
|
||||
\endplaintable
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "pisoControl.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "cellCellStencilObject.H"
|
||||
#include "localMin.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addOption
|
||||
(
|
||||
"pName",
|
||||
"pName",
|
||||
"Name of the pressure field"
|
||||
);
|
||||
|
||||
argList::addBoolOption
|
||||
(
|
||||
"initialiseUBCs",
|
||||
"Initialise U boundary conditions"
|
||||
);
|
||||
|
||||
argList::addBoolOption
|
||||
(
|
||||
"writePhi",
|
||||
"Write the final velocity potential field"
|
||||
);
|
||||
|
||||
argList::addBoolOption
|
||||
(
|
||||
"writep",
|
||||
"Calculate and write the Euler pressure field"
|
||||
);
|
||||
|
||||
argList::addBoolOption
|
||||
(
|
||||
"withFunctionObjects",
|
||||
"execute functionObjects"
|
||||
);
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createNamedDynamicFvMesh.H"
|
||||
|
||||
pisoControl potentialFlow(mesh, "potentialFlow");
|
||||
|
||||
#include "createFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< nl << "Calculating potential flow" << endl;
|
||||
|
||||
mesh.update();
|
||||
|
||||
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
|
||||
|
||||
// Since solver contains no time loop it would never execute
|
||||
// function objects so do it ourselves
|
||||
runTime.functionObjects().start();
|
||||
|
||||
MRF.makeRelative(phi);
|
||||
adjustPhi(phi, U, p);
|
||||
|
||||
// Non-orthogonal velocity potential corrector loop
|
||||
while (potentialFlow.correct())
|
||||
{
|
||||
phi = fvc::flux(U);
|
||||
|
||||
while (potentialFlow.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix PhiEqn
|
||||
(
|
||||
fvm::laplacian(faceMask, Phi)
|
||||
==
|
||||
fvc::div(phi)
|
||||
);
|
||||
|
||||
PhiEqn.setReference(PhiRefCell, PhiRefValue);
|
||||
PhiEqn.solve();
|
||||
|
||||
if (potentialFlow.finalNonOrthogonalIter())
|
||||
{
|
||||
phi -= PhiEqn.flux();
|
||||
}
|
||||
}
|
||||
|
||||
MRF.makeAbsolute(phi);
|
||||
|
||||
Info<< "Continuity error = "
|
||||
<< mag(fvc::div(phi))().weightedAverage(mesh.V()).value()
|
||||
<< endl;
|
||||
|
||||
U = fvc::reconstruct(phi);
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
Info<< "Interpolated velocity error = "
|
||||
<< (sqrt(sum(sqr(fvc::flux(U) - phi)))/sum(mesh.magSf())).value()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// Write U and phi
|
||||
U.write();
|
||||
phi.write();
|
||||
|
||||
// Optionally write Phi
|
||||
if (args.found("writePhi"))
|
||||
{
|
||||
Phi.write();
|
||||
}
|
||||
|
||||
// Calculate the pressure field from the Euler equation
|
||||
if (args.found("writep"))
|
||||
{
|
||||
Info<< nl << "Calculating approximate pressure field" << endl;
|
||||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell
|
||||
(
|
||||
p,
|
||||
potentialFlow.dict(),
|
||||
pRefCell,
|
||||
pRefValue
|
||||
);
|
||||
|
||||
// Calculate the flow-direction filter tensor
|
||||
volScalarField magSqrU(magSqr(U));
|
||||
volSymmTensorField F(sqr(U)/(magSqrU + SMALL*average(magSqrU)));
|
||||
|
||||
// Calculate the divergence of the flow-direction filtered div(U*U)
|
||||
// Filtering with the flow-direction generates a more reasonable
|
||||
// pressure distribution in regions of high velocity gradient in the
|
||||
// direction of the flow
|
||||
volScalarField divDivUU
|
||||
(
|
||||
fvc::div
|
||||
(
|
||||
F & fvc::div(phi, U),
|
||||
"div(div(phi,U))"
|
||||
)
|
||||
);
|
||||
|
||||
// Solve a Poisson equation for the approximate pressure
|
||||
while (potentialFlow.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::laplacian(p) + divDivUU
|
||||
);
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
pEqn.solve();
|
||||
}
|
||||
|
||||
p.write();
|
||||
}
|
||||
|
||||
runTime.functionObjects().end();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -28,9 +28,7 @@ Group
|
||||
grpBasicSolvers
|
||||
|
||||
Description
|
||||
Potential flow solver which solves for the velocity potential, to
|
||||
calculate the flux-field, from which the velocity field is obtained by
|
||||
reconstructing the flux.
|
||||
Potential flow solver.
|
||||
|
||||
\heading Solver details
|
||||
The potential flow solution is typically employed to generate initial fields
|
||||
@ -125,7 +123,6 @@ int main(int argc, char *argv[])
|
||||
"execute functionObjects"
|
||||
);
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
@ -133,6 +130,7 @@ int main(int argc, char *argv[])
|
||||
pisoControl potentialFlow(mesh, "potentialFlow");
|
||||
|
||||
#include "createFields.H"
|
||||
#include "createMRF.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -182,13 +180,13 @@ int main(int argc, char *argv[])
|
||||
phi.write();
|
||||
|
||||
// Optionally write Phi
|
||||
if (args.found("writePhi"))
|
||||
if (args.optionFound("writePhi"))
|
||||
{
|
||||
Phi.write();
|
||||
}
|
||||
|
||||
// Calculate the pressure field from the Euler equation
|
||||
if (args.found("writep"))
|
||||
if (args.optionFound("writep"))
|
||||
{
|
||||
Info<< nl << "Calculating approximate pressure field" << endl;
|
||||
|
||||
@ -236,7 +234,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
runTime.functionObjects().end();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
|
||||
@ -1,59 +1,55 @@
|
||||
Info<< "Reading field T\n" << endl;
|
||||
Info<< "Reading field T\n" << endl;
|
||||
|
||||
volScalarField T
|
||||
(
|
||||
IOobject
|
||||
volScalarField T
|
||||
(
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
IOobject
|
||||
(
|
||||
"T",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
Info<< "Reading field U\n" << endl;
|
||||
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
volVectorField U
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading diffusivity DT\n" << endl;
|
||||
Info<< "Reading diffusivity DT\n" << endl;
|
||||
|
||||
dimensionedScalar DT
|
||||
(
|
||||
"DT",
|
||||
dimArea/dimTime,
|
||||
transportProperties
|
||||
);
|
||||
dimensionedScalar DT
|
||||
(
|
||||
transportProperties.lookup("DT")
|
||||
);
|
||||
|
||||
#include "createPhi.H"
|
||||
|
||||
#include "createFvOptions.H"
|
||||
#include "createPhi.H"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -61,7 +61,6 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
@ -69,6 +68,7 @@ int main(int argc, char *argv[])
|
||||
simpleControl simple(mesh);
|
||||
|
||||
#include "createFields.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -15,8 +15,8 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
||||
|
||||
EXE_LIBS = \
|
||||
-lengine \
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -78,6 +78,7 @@ Description
|
||||
#include "XiModel.H"
|
||||
#include "PDRDragModel.H"
|
||||
#include "ignition.H"
|
||||
#include "Switch.H"
|
||||
#include "bound.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
@ -86,17 +87,18 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCase.H"
|
||||
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "readCombustionProperties.H"
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
@ -111,7 +113,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
@ -149,7 +151,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
Info<< "\nExecutionTime = "
|
||||
<< runTime.elapsedCpuTime()
|
||||
<< " s\n" << endl;
|
||||
}
|
||||
|
||||
Info<< "\n end\n";
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -63,6 +63,7 @@ Description
|
||||
#include "XiModel.H"
|
||||
#include "PDRDragModel.H"
|
||||
#include "ignition.H"
|
||||
#include "Switch.H"
|
||||
#include "bound.H"
|
||||
#include "dynamicRefineFvMesh.H"
|
||||
#include "pimpleControl.H"
|
||||
@ -97,12 +98,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
// Indicators for refinement. Note: before runTime++
|
||||
// only for post-processing reasons.
|
||||
// only for postprocessing reasons.
|
||||
tmp<volScalarField> tmagGradP = mag(fvc::grad(p));
|
||||
volScalarField normalisedGradP
|
||||
(
|
||||
@ -121,20 +122,20 @@ int main(int argc, char *argv[])
|
||||
fvc::makeAbsolute(phi, rho, U);
|
||||
|
||||
// Test : disable refinement for some cells
|
||||
bitSet& protectedCell =
|
||||
PackedBoolList& protectedCell =
|
||||
refCast<dynamicRefineFvMesh>(mesh).protectedCell();
|
||||
|
||||
if (protectedCell.empty())
|
||||
{
|
||||
protectedCell.setSize(mesh.nCells());
|
||||
protectedCell = false;
|
||||
protectedCell = 0;
|
||||
}
|
||||
|
||||
forAll(betav, celli)
|
||||
forAll(betav, cellI)
|
||||
{
|
||||
if (betav[celli] < 0.99)
|
||||
if (betav[cellI] < 0.99)
|
||||
{
|
||||
protectedCell.set(celli);
|
||||
protectedCell[cellI] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,7 +198,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
Info<< "\nExecutionTime = "
|
||||
<< runTime.elapsedCpuTime()
|
||||
<< " s\n" << endl;
|
||||
}
|
||||
|
||||
Info<< "\n end\n";
|
||||
|
||||
@ -103,9 +103,9 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(Nv.dimensions(), Zero)
|
||||
dimensionedScalar("zero", Nv.dimensions(), 0.0)
|
||||
);
|
||||
N.primitiveFieldRef() = Nv.primitiveField()*Cw;
|
||||
N.internalField() = Nv.internalField()*Cw;
|
||||
|
||||
volSymmTensorField ns
|
||||
(
|
||||
@ -118,9 +118,14 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U.mesh(),
|
||||
dimensionedSymmTensor(nsv.dimensions(), Zero)
|
||||
dimensionedSymmTensor
|
||||
(
|
||||
"zero",
|
||||
nsv.dimensions(),
|
||||
Zero
|
||||
)
|
||||
);
|
||||
ns.primitiveFieldRef() = nsv.primitiveField()*Cw;
|
||||
ns.internalField() = nsv.internalField()*Cw;
|
||||
|
||||
volScalarField n(max(N - (Uhat & ns & Uhat), scalar(1e-4)));
|
||||
volScalarField b((Uhat & B_ & Uhat)/sqrt(n));
|
||||
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::XiEqModels::basicSubGrid
|
||||
|
||||
Description
|
||||
Basic sub-grid obstacle flame-wrinkling enhancement factor model.
|
||||
Basic sub-grid obstacle flame-wrinking enhancement factor model.
|
||||
Details supplied by J Puttock 2/7/06.
|
||||
|
||||
<b> Sub-grid flame area generation </b>
|
||||
@ -94,11 +94,11 @@ class basicSubGrid
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
basicSubGrid(const basicSubGrid&) = delete;
|
||||
//- Disallow copy construct
|
||||
basicSubGrid(const basicSubGrid&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const basicSubGrid&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const basicSubGrid&);
|
||||
|
||||
|
||||
public:
|
||||
@ -125,7 +125,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
//- Return the flame-wrinking XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
|
||||
@ -73,7 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiGModels::basicSubGrid::G() const
|
||||
volScalarField& Gtot = tGtot.ref();
|
||||
|
||||
const scalarField Cw = pow(Su_.mesh().V(), 2.0/3.0);
|
||||
scalarField N(Nv.primitiveField()*Cw);
|
||||
scalarField N(Nv.internalField()*Cw);
|
||||
|
||||
forAll(N, celli)
|
||||
{
|
||||
|
||||
@ -26,7 +26,7 @@ Class
|
||||
|
||||
Description
|
||||
|
||||
Basic sub-grid obstacle flame-wrinkling generation rate coefficient model.
|
||||
Basic sub-grid obstacle flame-wrinking generation rate coefficient model.
|
||||
Details supplied by J Puttock 2/7/06.
|
||||
|
||||
\f$ G_{sub} \f$ denotes the generation coefficient and it is given by
|
||||
@ -82,11 +82,11 @@ class basicSubGrid
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
basicSubGrid(const basicSubGrid&) = delete;
|
||||
//- Disallow copy construct
|
||||
basicSubGrid(const basicSubGrid&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const basicSubGrid&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const basicSubGrid&);
|
||||
|
||||
|
||||
public:
|
||||
@ -113,7 +113,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling generation rate
|
||||
//- Return the flame-wrinking generation rate
|
||||
virtual tmp<volScalarField> G() const;
|
||||
|
||||
//- Return the flame diffusivity
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -58,14 +58,14 @@ Foam::PDRDragModel::PDRDragModel
|
||||
(
|
||||
PDRProperties.subDict
|
||||
(
|
||||
PDRProperties.get<word>("PDRDragModel") + "Coeffs"
|
||||
word(PDRProperties.lookup("PDRDragModel")) + "Coeffs"
|
||||
)
|
||||
),
|
||||
turbulence_(turbulence),
|
||||
rho_(rho),
|
||||
U_(U),
|
||||
phi_(phi),
|
||||
on_(PDRDragModelCoeffs_.get<bool>("drag"))
|
||||
on_(PDRDragModelCoeffs_.lookup("drag"))
|
||||
{}
|
||||
|
||||
|
||||
@ -79,9 +79,9 @@ Foam::PDRDragModel::~PDRDragModel()
|
||||
|
||||
bool Foam::PDRDragModel::read(const dictionary& PDRProperties)
|
||||
{
|
||||
PDRDragModelCoeffs_ = PDRProperties.optionalSubDict(type() + "Coeffs");
|
||||
PDRDragModelCoeffs_ = PDRProperties.subDict(type() + "Coeffs");
|
||||
|
||||
PDRDragModelCoeffs_.read("drag", on_);
|
||||
PDRDragModelCoeffs_.lookup("drag") >> on_;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -67,18 +67,18 @@ protected:
|
||||
const volVectorField& U_;
|
||||
const surfaceScalarField& phi_;
|
||||
|
||||
bool on_;
|
||||
Switch on_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
PDRDragModel(const PDRDragModel&) = delete;
|
||||
//- Disallow copy construct
|
||||
PDRDragModel(const PDRDragModel&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const PDRDragModel&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const PDRDragModel&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -36,18 +36,19 @@ Foam::autoPtr<Foam::PDRDragModel> Foam::PDRDragModel::New
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
{
|
||||
const word modelType(PDRProperties.get<word>("PDRDragModel"));
|
||||
const word modelType(PDRProperties.lookup("PDRDragModel"));
|
||||
|
||||
Info<< "Selecting drag model " << modelType << endl;
|
||||
Info<< "Selecting flame-wrinkling model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown PDRDragModel type "
|
||||
<< modelType << nl << nl
|
||||
<< "Valid PDRDragModel types :" << endl
|
||||
<< "Valid PDRDragModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -104,7 +104,12 @@ Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedSymmTensor(dimMass/dimTime/dimVolume, Zero)
|
||||
dimensionedSymmTensor
|
||||
(
|
||||
"zero",
|
||||
dimMass/dimTime/pow(dimLength, 3),
|
||||
Zero
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@ -138,7 +143,7 @@ Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
|
||||
dimensionedScalar("zero", dimMass/dimLength/pow(dimTime, 3), 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
@ -165,8 +170,8 @@ bool Foam::PDRDragModels::basic::read(const dictionary& PDRProperties)
|
||||
{
|
||||
PDRDragModel::read(PDRProperties);
|
||||
|
||||
PDRDragModelCoeffs_.read("Csu", Csu.value());
|
||||
PDRDragModelCoeffs_.read("Csk", Csk.value());
|
||||
PDRDragModelCoeffs_.lookup("Csu") >> Csu.value();
|
||||
PDRDragModelCoeffs_.lookup("Csk") >> Csk.value();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -108,11 +108,11 @@ class basic
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
basic(const basic&) = delete;
|
||||
//- Disallow copy construct
|
||||
basic(const basic&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const basic&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const basic&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -129,8 +129,8 @@ void PDRkEpsilon::correct()
|
||||
volScalarField G(GName(), rho_*nut_*(tgradU() && dev(twoSymm(tgradU()))));
|
||||
tgradU.clear();
|
||||
|
||||
// Update epsilon and G at the wall
|
||||
epsilon_.boundaryFieldRef().updateCoeffs();
|
||||
// Update espsilon and G at the wall
|
||||
epsilon_.boundaryField().updateCoeffs();
|
||||
|
||||
// Add the blockage generation term so that it is included consistently
|
||||
// in both the k and epsilon equations
|
||||
@ -163,7 +163,7 @@ void PDRkEpsilon::correct()
|
||||
|
||||
epsEqn.ref().relax();
|
||||
|
||||
epsEqn.ref().boundaryManipulate(epsilon_.boundaryFieldRef());
|
||||
epsEqn.ref().boundaryManipulate(epsilon_.boundaryField());
|
||||
|
||||
solve(epsEqn);
|
||||
bound(epsilon_, epsilonMin_);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,8 +36,8 @@ Description
|
||||
{
|
||||
scalarField sumPhi
|
||||
(
|
||||
fvc::surfaceSum(mag(phiSt))().primitiveField()
|
||||
/ rho.primitiveField()
|
||||
fvc::surfaceSum(mag(phiSt))().internalField()
|
||||
/ rho.internalField()
|
||||
);
|
||||
|
||||
StCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -74,7 +74,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::Gulder::XiEq() const
|
||||
|
||||
if (subGridSchelkin_)
|
||||
{
|
||||
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
|
||||
up.internalField() += calculateSchelkinEffect(uPrimeCoef_);
|
||||
}
|
||||
|
||||
volScalarField tauEta(sqrt(mag(thermo_.muu()/(thermo_.rhou()*epsilon))));
|
||||
|
||||
@ -70,11 +70,11 @@ class Gulder
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
Gulder(const Gulder&) = delete;
|
||||
//- Disallow copy construct
|
||||
Gulder(const Gulder&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const Gulder&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const Gulder&);
|
||||
|
||||
|
||||
public:
|
||||
@ -101,7 +101,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
//- Return the flame-wrinking XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
|
||||
@ -66,11 +66,11 @@ class SCOPEBlend
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
SCOPEBlend(const SCOPEBlend&) = delete;
|
||||
//- Disallow copy construct
|
||||
SCOPEBlend(const SCOPEBlend&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const SCOPEBlend&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const SCOPEBlend&);
|
||||
|
||||
|
||||
public:
|
||||
@ -97,7 +97,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
//- Return the flame-wrinking XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
|
||||
@ -82,7 +82,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
|
||||
volScalarField up(sqrt((2.0/3.0)*k));
|
||||
if (subGridSchelkin_)
|
||||
{
|
||||
up.primitiveFieldRef() += calculateSchelkinEffect(uPrimeCoef_);
|
||||
up.internalField() += calculateSchelkinEffect(uPrimeCoef_);
|
||||
}
|
||||
|
||||
volScalarField l(lCoef_*sqrt(3.0/2.0)*up*k/epsilon);
|
||||
@ -105,7 +105,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
epsilon.mesh(),
|
||||
dimensionedScalar(dimless, Zero)
|
||||
dimensionedScalar("XiEq", dimless, 0.0)
|
||||
)
|
||||
);
|
||||
volScalarField& xieq = tXiEq.ref();
|
||||
@ -119,11 +119,9 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
|
||||
}
|
||||
}
|
||||
|
||||
volScalarField::Boundary& xieqBf = xieq.boundaryFieldRef();
|
||||
|
||||
forAll(xieq.boundaryField(), patchi)
|
||||
{
|
||||
scalarField& xieqp = xieqBf[patchi];
|
||||
scalarField& xieqp = xieq.boundaryField()[patchi];
|
||||
const scalarField& Kp = K.boundaryField()[patchi];
|
||||
const scalarField& Map = Ma.boundaryField()[patchi];
|
||||
const scalarField& upBySup = upBySu.boundaryField()[patchi];
|
||||
|
||||
@ -84,11 +84,11 @@ class SCOPEXiEq
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
SCOPEXiEq(const SCOPEXiEq&) = delete;
|
||||
//- Disallow copy construct
|
||||
SCOPEXiEq(const SCOPEXiEq&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const SCOPEXiEq&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const SCOPEXiEq&);
|
||||
|
||||
|
||||
public:
|
||||
@ -115,7 +115,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
//- Return the flame-wrinking XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -67,7 +67,7 @@ Foam::XiEqModel::~XiEqModel()
|
||||
|
||||
bool Foam::XiEqModel::read(const dictionary& XiEqProperties)
|
||||
{
|
||||
XiEqModelCoeffs_ = XiEqProperties.optionalSubDict(type() + "Coeffs");
|
||||
XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs");
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -110,11 +110,11 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(Nv.dimensions(), Zero)
|
||||
dimensionedScalar("zero", Nv.dimensions(), 0.0)
|
||||
)
|
||||
);
|
||||
volScalarField& N = tN.ref();
|
||||
N.primitiveFieldRef() = Nv.primitiveField()*pow(mesh.V(), 2.0/3.0);
|
||||
N.internalField() = Nv.internalField()*pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
volSymmTensorField ns
|
||||
(
|
||||
@ -127,9 +127,14 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedSymmTensor(nsv.dimensions(), Zero)
|
||||
dimensionedSymmTensor
|
||||
(
|
||||
"zero",
|
||||
nsv.dimensions(),
|
||||
Zero
|
||||
)
|
||||
);
|
||||
ns.primitiveFieldRef() = nsv.primitiveField()*pow(mesh.V(), 2.0/3.0);
|
||||
ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
|
||||
|
||||
const volVectorField Uhat
|
||||
(
|
||||
@ -145,7 +150,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
|
||||
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
|
||||
|
||||
// Re use tN
|
||||
N.primitiveFieldRef() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
|
||||
N.internalField() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
|
||||
|
||||
return tN;
|
||||
}
|
||||
|
||||
@ -79,11 +79,11 @@ private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
XiEqModel(const XiEqModel&) = delete;
|
||||
//- Disallow copy construct
|
||||
XiEqModel(const XiEqModel&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const XiEqModel&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const XiEqModel&);
|
||||
|
||||
|
||||
public:
|
||||
@ -144,7 +144,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
//- Return the flame-wrinking XiEq
|
||||
virtual tmp<volScalarField> XiEq() const
|
||||
{
|
||||
return turbulence_.muEff();
|
||||
|
||||
@ -39,14 +39,15 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
|
||||
|
||||
Info<< "Selecting flame-wrinkling model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown XiEqModel type "
|
||||
<< modelType << nl << nl
|
||||
<< "Valid XiEqModel types :" << endl
|
||||
<< "Valid XiEqModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -65,11 +65,11 @@ class instability
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
instability(const instability&) = delete;
|
||||
//- Disallow copy construct
|
||||
instability(const instability&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const instability&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const instability&);
|
||||
|
||||
|
||||
public:
|
||||
@ -96,7 +96,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling XiEq
|
||||
//- Return the flame-wrinking XiEq
|
||||
virtual tmp<volScalarField> XiEq() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
|
||||
@ -60,11 +60,11 @@ class KTS
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
KTS(const KTS&) = delete;
|
||||
//- Disallow copy construct
|
||||
KTS(const KTS&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const KTS&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const KTS&);
|
||||
|
||||
|
||||
public:
|
||||
@ -91,7 +91,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling generation rate
|
||||
//- Return the flame-wrinking generation rate
|
||||
virtual tmp<volScalarField> G() const;
|
||||
|
||||
//- Update properties from given dictionary
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -67,7 +67,7 @@ Foam::XiGModel::~XiGModel()
|
||||
|
||||
bool Foam::XiGModel::read(const dictionary& XiGProperties)
|
||||
{
|
||||
XiGModelCoeffs_ = XiGProperties.optionalSubDict(type() + "Coeffs");
|
||||
XiGModelCoeffs_ = XiGProperties.subDict(type() + "Coeffs");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -70,11 +70,11 @@ private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
XiGModel(const XiGModel&) = delete;
|
||||
//- Disallow copy construct
|
||||
XiGModel(const XiGModel&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const XiGModel&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const XiGModel&);
|
||||
|
||||
|
||||
public:
|
||||
@ -135,7 +135,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling generation rate
|
||||
//- Return the flame-wrinking genration rate
|
||||
virtual tmp<volScalarField> G() const = 0;
|
||||
|
||||
//- Return the flame diffusivity
|
||||
|
||||
@ -39,14 +39,15 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
|
||||
|
||||
Info<< "Selecting flame-wrinkling model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown XiGModel type "
|
||||
<< modelType << nl << nl
|
||||
<< "Valid XiGModel types :" << endl
|
||||
<< "Valid XiGModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ Class
|
||||
Foam::XiGModels::instabilityG
|
||||
|
||||
Description
|
||||
Flame-surface instabilityG flame-wrinkling generation rate coefficient model
|
||||
Flame-surface instabilityG flame-wrinking generation rate coefficient model
|
||||
used in \link XiModel.H \endlink.
|
||||
|
||||
See Technical Report SH/RE/01R for details on the PDR modelling.
|
||||
@ -57,7 +57,7 @@ class instabilityG
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Flame instabilityG wrinkling generation rate coefficient
|
||||
//- Flame instabilityG wrinling generation rate coefficient
|
||||
dimensionedScalar GIn_;
|
||||
|
||||
//- InstabilityG length-scale
|
||||
@ -69,11 +69,11 @@ class instabilityG
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
instabilityG(const instabilityG&) = delete;
|
||||
//- Disallow copy construct
|
||||
instabilityG(const instabilityG&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const instabilityG&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const instabilityG&);
|
||||
|
||||
|
||||
public:
|
||||
@ -100,7 +100,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling generation rate
|
||||
//- Return the flame-wrinking generation rate
|
||||
virtual tmp<volScalarField> G() const;
|
||||
|
||||
//- Return the flame diffusivity
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -85,7 +85,7 @@ Foam::XiModel::~XiModel()
|
||||
|
||||
bool Foam::XiModel::read(const dictionary& XiProperties)
|
||||
{
|
||||
XiModelCoeffs_ = XiProperties.optionalSubDict(type() + "Coeffs");
|
||||
XiModelCoeffs_ = XiProperties.subDict(type() + "Coeffs");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ protected:
|
||||
const volScalarField& b_;
|
||||
const surfaceScalarField& phi_;
|
||||
|
||||
//- Flame wrinkling field
|
||||
//- Flame wrinking field
|
||||
volScalarField Xi_;
|
||||
|
||||
|
||||
@ -130,11 +130,11 @@ private:
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
XiModel(const XiModel&) = delete;
|
||||
//- Disallow copy construct
|
||||
XiModel(const XiModel&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const XiModel&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const XiModel&);
|
||||
|
||||
|
||||
public:
|
||||
@ -207,7 +207,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the flame-wrinkling Xi
|
||||
//- Return the flame-wrinking Xi
|
||||
virtual const volScalarField& Xi() const
|
||||
{
|
||||
return Xi_;
|
||||
@ -227,10 +227,10 @@ public:
|
||||
)
|
||||
{}
|
||||
|
||||
//- Correct the flame-wrinkling Xi
|
||||
//- Correct the flame-wrinking Xi
|
||||
virtual void correct() = 0;
|
||||
|
||||
//- Correct the flame-wrinkling Xi using the given convection scheme
|
||||
//- Correct the flame-wrinking Xi using the given convection scheme
|
||||
virtual void correct(const fv::convectionScheme<scalar>&)
|
||||
{
|
||||
correct();
|
||||
|
||||
@ -42,14 +42,15 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
|
||||
|
||||
Info<< "Selecting flame-wrinkling model " << modelType << endl;
|
||||
|
||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
|
||||
if (!cstrIter.found())
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown XiModel type "
|
||||
<< modelType << nl << nl
|
||||
<< "Valid XiModel types :" << endl
|
||||
<< "Valid XiModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -67,11 +67,11 @@ class algebraic
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
algebraic(const algebraic&) = delete;
|
||||
//- Disallow copy construct
|
||||
algebraic(const algebraic&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const algebraic&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const algebraic&);
|
||||
|
||||
|
||||
public:
|
||||
@ -104,7 +104,7 @@ public:
|
||||
//- Return the flame diffusivity
|
||||
virtual tmp<volScalarField> Db() const;
|
||||
|
||||
//- Correct the flame-wrinkling Xi
|
||||
//- Correct the flame-wrinking Xi
|
||||
virtual void correct();
|
||||
|
||||
//- Update properties from given dictionary
|
||||
|
||||
@ -55,11 +55,11 @@ class fixed
|
||||
{
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
fixed(const fixed&) = delete;
|
||||
//- Disallow copy construct
|
||||
fixed(const fixed&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const fixed&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const fixed&);
|
||||
|
||||
|
||||
public:
|
||||
@ -89,7 +89,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Correct the flame-wrinkling Xi
|
||||
//- Correct the flame-wrinking Xi
|
||||
virtual void correct()
|
||||
{}
|
||||
|
||||
|
||||
@ -67,11 +67,11 @@ class transport
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
transport(const transport&) = delete;
|
||||
//- Disallow copy construct
|
||||
transport(const transport&);
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const transport&) = delete;
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const transport&);
|
||||
|
||||
|
||||
public:
|
||||
@ -113,13 +113,13 @@ public:
|
||||
fields.add(Xi_);
|
||||
}
|
||||
|
||||
//- Correct the flame-wrinkling Xi
|
||||
//- Correct the flame-wrinking Xi
|
||||
virtual void correct()
|
||||
{
|
||||
NotImplemented;
|
||||
}
|
||||
|
||||
//- Correct the flame-wrinkling Xi using the given convection scheme
|
||||
//- Correct the flame-wrinking Xi using the given convection scheme
|
||||
virtual void correct(const fv::convectionScheme<scalar>& mvConvection);
|
||||
|
||||
//- Update properties from given dictionary
|
||||
|
||||
@ -1 +0,0 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
@ -7,7 +7,7 @@ autoPtr<psiuReactionThermo> pThermo
|
||||
psiuReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "ha", "ea");
|
||||
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -23,6 +23,7 @@ volScalarField rho
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
volScalarField& b = composition.Y("b");
|
||||
Info<< "min(b) = " << min(b).value() << endl;
|
||||
@ -58,6 +59,23 @@ autoPtr<compressible::RASModel> turbulence
|
||||
);
|
||||
|
||||
|
||||
Info<< "Creating field dpdt\n" << endl;
|
||||
volScalarField dpdt
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dpdt",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
|
||||
);
|
||||
|
||||
Info<< "Creating field kinetic energy K\n" << endl;
|
||||
volScalarField K("K", 0.5*magSqr(U));
|
||||
|
||||
|
||||
Info<< "Creating the unstrained laminar flame speed\n" << endl;
|
||||
autoPtr<laminarFlameSpeed> unstrainedLaminarFlameSpeed
|
||||
(
|
||||
@ -165,7 +183,7 @@ IOdictionary PDRProperties
|
||||
autoPtr<PDRDragModel> drag = PDRDragModel::New
|
||||
(
|
||||
PDRProperties,
|
||||
*turbulence,
|
||||
turbulence,
|
||||
rho,
|
||||
U,
|
||||
phi
|
||||
@ -176,7 +194,7 @@ autoPtr<XiModel> flameWrinkling = XiModel::New
|
||||
(
|
||||
PDRProperties,
|
||||
thermo,
|
||||
*turbulence,
|
||||
turbulence,
|
||||
Su,
|
||||
rho,
|
||||
b,
|
||||
@ -209,10 +227,3 @@ fields.add(b);
|
||||
fields.add(thermo.he());
|
||||
fields.add(thermo.heu());
|
||||
flameWrinkling->addXi(fields);
|
||||
|
||||
#include "createDpdt.H"
|
||||
|
||||
#include "createK.H"
|
||||
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -73,37 +73,17 @@ Foam::laminarFlameSpeedModels::SCOPE::SCOPE
|
||||
(
|
||||
dictionary
|
||||
(
|
||||
IFstream
|
||||
(
|
||||
fileName
|
||||
(
|
||||
dict.lookup("fuelFile")
|
||||
)
|
||||
)()
|
||||
).optionalSubDict(typeName + "Coeffs")
|
||||
),
|
||||
LFL_
|
||||
(
|
||||
readScalar
|
||||
(
|
||||
coeffsDict_.lookupCompat
|
||||
(
|
||||
"lowerFlammabilityLimit",
|
||||
{{"lowerFlamabilityLimit", 1712}}
|
||||
)
|
||||
)
|
||||
),
|
||||
UFL_
|
||||
(
|
||||
readScalar
|
||||
(
|
||||
coeffsDict_.lookupCompat
|
||||
(
|
||||
"upperFlammabilityLimit",
|
||||
{{"upperFlamabilityLimit", 1712}}
|
||||
)
|
||||
)
|
||||
IFstream
|
||||
(
|
||||
fileName
|
||||
(
|
||||
dict.lookup("fuelFile")
|
||||
)
|
||||
)()
|
||||
).subDict(typeName + "Coeffs")
|
||||
),
|
||||
LFL_(readScalar(coeffsDict_.lookup("lowerFlamabilityLimit"))),
|
||||
UFL_(readScalar(coeffsDict_.lookup("upperFlamabilityLimit"))),
|
||||
SuPolyL_(coeffsDict_.subDict("lowerSuPolynomial")),
|
||||
SuPolyU_(coeffsDict_.subDict("upperSuPolynomial")),
|
||||
Texp_(readScalar(coeffsDict_.lookup("Texp"))),
|
||||
@ -165,19 +145,19 @@ inline Foam::scalar Foam::laminarFlameSpeedModels::SCOPE::SuRef
|
||||
{
|
||||
if (phi < LFL_ || phi > UFL_)
|
||||
{
|
||||
// Return 0 beyond the flammability limits
|
||||
// Return 0 beyond the flamibility limits
|
||||
return scalar(0);
|
||||
}
|
||||
else if (phi < SuPolyL_.ll)
|
||||
{
|
||||
// Use linear interpolation between the low end of the
|
||||
// lower polynomial and the lower flammability limit
|
||||
// lower polynomial and the lower flamibility limit
|
||||
return SuPolyL_.llv*(phi - LFL_)/(SuPolyL_.ll - LFL_);
|
||||
}
|
||||
else if (phi > SuPolyU_.ul)
|
||||
{
|
||||
// Use linear interpolation between the upper end of the
|
||||
// upper polynomial and the upper flammability limit
|
||||
// upper polynomial and the upper flamibility limit
|
||||
return SuPolyU_.ulv*(UFL_ - phi)/(UFL_ - SuPolyU_.ul);
|
||||
}
|
||||
else if (phi < SuPolyL_.lu)
|
||||
@ -275,7 +255,7 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
p.mesh(),
|
||||
dimensionedScalar(dimVelocity, Zero)
|
||||
dimensionedScalar("Su0", dimVelocity, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
@ -286,11 +266,9 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
|
||||
Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi);
|
||||
}
|
||||
|
||||
volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
|
||||
|
||||
forAll(Su0Bf, patchi)
|
||||
forAll(Su0.boundaryField(), patchi)
|
||||
{
|
||||
scalarField& Su0p = Su0Bf[patchi];
|
||||
scalarField& Su0p = Su0.boundaryField()[patchi];
|
||||
const scalarField& pp = p.boundaryField()[patchi];
|
||||
const scalarField& Tup = Tu.boundaryField()[patchi];
|
||||
|
||||
@ -324,7 +302,7 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
p.mesh(),
|
||||
dimensionedScalar(dimVelocity, Zero)
|
||||
dimensionedScalar("Su0", dimVelocity, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
@ -335,11 +313,9 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
|
||||
Su0[celli] = Su0pTphi(p[celli], Tu[celli], phi[celli]);
|
||||
}
|
||||
|
||||
volScalarField::Boundary& Su0Bf = Su0.boundaryFieldRef();
|
||||
|
||||
forAll(Su0Bf, patchi)
|
||||
forAll(Su0.boundaryField(), patchi)
|
||||
{
|
||||
scalarField& Su0p = Su0Bf[patchi];
|
||||
scalarField& Su0p = Su0.boundaryField()[patchi];
|
||||
const scalarField& pp = p.boundaryField()[patchi];
|
||||
const scalarField& Tup = Tu.boundaryField()[patchi];
|
||||
const scalarField& phip = phi.boundaryField()[patchi];
|
||||
@ -378,7 +354,7 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Ma
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
phi.mesh(),
|
||||
dimensionedScalar(dimless, Zero)
|
||||
dimensionedScalar("Ma", dimless, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
@ -389,11 +365,9 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Ma
|
||||
ma[celli] = Ma(phi[celli]);
|
||||
}
|
||||
|
||||
volScalarField::Boundary& maBf = ma.boundaryFieldRef();
|
||||
|
||||
forAll(maBf, patchi)
|
||||
forAll(ma.boundaryField(), patchi)
|
||||
{
|
||||
scalarField& map = maBf[patchi];
|
||||
scalarField& map = ma.boundaryField()[patchi];
|
||||
const scalarField& phip = phi.boundaryField()[patchi];
|
||||
|
||||
forAll(map, facei)
|
||||
|
||||
@ -109,10 +109,10 @@ class SCOPE
|
||||
|
||||
dictionary coeffsDict_;
|
||||
|
||||
//- Lower flammability limit
|
||||
//- Lower flamability limit
|
||||
scalar LFL_;
|
||||
|
||||
//- Upper flammability limit
|
||||
//- Upper flamability limit
|
||||
scalar UFL_;
|
||||
|
||||
//- Lower Su polynomial
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -67,25 +67,25 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
#include "createTime.H"
|
||||
#include "createDynamicFvMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "readCombustionProperties.H"
|
||||
#include "readGravitationalAcceleration.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "createRhoUf.H"
|
||||
#include "createControls.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
@ -169,7 +169,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
|
||||
bool correctPhi
|
||||
(
|
||||
pimple.dict().lookupOrDefault("correctPhi", true)
|
||||
pimple.dict().lookupOrDefault<Switch>("correctPhi", true)
|
||||
);
|
||||
|
||||
bool checkMeshCourantNo
|
||||
(
|
||||
pimple.dict().lookupOrDefault("checkMeshCourantNo", false)
|
||||
pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false)
|
||||
);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#include "readTimeControls.H"
|
||||
#include "readTimeControls.H"
|
||||
|
||||
correctPhi = pimple.dict().lookupOrDefault("correctPhi", true);
|
||||
bool correctPhi =
|
||||
pimple.dict().lookupOrDefault<Switch>("correctPhi", true);
|
||||
|
||||
checkMeshCourantNo =
|
||||
pimple.dict().lookupOrDefault("checkMeshCourantNo", false);
|
||||
bool checkMeshCourantNo =
|
||||
pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false);
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
XiEngineFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/XiEngineFoam
|
||||
@ -1,27 +0,0 @@
|
||||
EXE_INC = \
|
||||
-I.. \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/engine/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lsampling \
|
||||
-lmeshTools \
|
||||
-lengine \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lspecie \
|
||||
-llaminarFlameSpeedModels
|
||||
@ -1,150 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
XiEngineFoam
|
||||
|
||||
Description
|
||||
Solver for internal combustion engines.
|
||||
|
||||
Combusting RANS code using the b-Xi two-equation model.
|
||||
Xi may be obtained by either the solution of the Xi transport
|
||||
equation or from an algebraic exression. Both approaches are
|
||||
based on Gulder's flame speed correlation which has been shown
|
||||
to be appropriate by comparison with the results from the
|
||||
spectral model.
|
||||
|
||||
Strain effects are encorporated directly into the Xi equation
|
||||
but not in the algebraic approximation. Further work need to be
|
||||
done on this issue, particularly regarding the enhanced removal rate
|
||||
caused by flame compression. Analysis using results of the spectral
|
||||
model will be required.
|
||||
|
||||
For cases involving very lean Propane flames or other flames which are
|
||||
very strain-sensitive, a transport equation for the laminar flame
|
||||
speed is present. This equation is derived using heuristic arguments
|
||||
involving the strain time scale and the strain-rate at extinction.
|
||||
the transport velocity is the same as that for the Xi equation.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "engineTime.H"
|
||||
#include "engineMesh.H"
|
||||
#include "psiuReactionThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "laminarFlameSpeed.H"
|
||||
#include "ignition.H"
|
||||
#include "Switch.H"
|
||||
#include "OFstream.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#define CREATE_TIME createEngineTime.H
|
||||
#define CREATE_MESH createEngineMesh.H
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createEngineTime.H"
|
||||
#include "createEngineMesh.H"
|
||||
#include "createControl.H"
|
||||
#include "readCombustionProperties.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createRhoUf.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "readEngineTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
#include "startSummary.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readEngineTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
runTime++;
|
||||
|
||||
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
|
||||
|
||||
mesh.move();
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "UEqn.H"
|
||||
|
||||
#include "ftEqn.H"
|
||||
#include "bEqn.H"
|
||||
#include "EauEqn.H"
|
||||
#include "EaEqn.H"
|
||||
|
||||
if (!ign.ignited())
|
||||
{
|
||||
thermo.heu() == thermo.he();
|
||||
}
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
|
||||
#include "logSummary.H"
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,100 +0,0 @@
|
||||
rho = thermo.rho();
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
|
||||
if (pimple.transonic())
|
||||
{
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
(
|
||||
fvc::flux(HbyA)
|
||||
+ MRF.zeroFilter
|
||||
(
|
||||
rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
fvc::makeRelative(phid, psi, U);
|
||||
MRF.makeRelative(fvc::interpolate(psi), phid);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvm::div(phid, p)
|
||||
- fvm::laplacian(rhorAUf, p)
|
||||
==
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi == pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(
|
||||
fvc::flux(rho*HbyA)
|
||||
+ MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, rhoUf))
|
||||
)
|
||||
);
|
||||
|
||||
fvc::makeRelative(phiHbyA, rho, U);
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvc::div(phiHbyA)
|
||||
- fvm::laplacian(rhorAUf, p)
|
||||
==
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phiHbyA + pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "compressibleContinuityErrs.H"
|
||||
|
||||
U = HbyA - rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
{
|
||||
rhoUf = fvc::interpolate(rho*U);
|
||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||
rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
|
||||
}
|
||||
|
||||
if (thermo.dpdt())
|
||||
{
|
||||
dpdt = fvc::ddt(p) - fvc::div(fvc::meshPhi(rho, U), p);
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
Info<< "Total cylinder mass: " << fvc::domainIntegrate(rho).value() << endl;
|
||||
|
||||
autoPtr<OFstream> logSummaryFile;
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
logSummaryFile.reset
|
||||
(
|
||||
new OFstream
|
||||
(
|
||||
runTime.rootPath()/runTime.globalCaseName()
|
||||
/("logSummary." + runTime.timeName() + ".dat")
|
||||
)
|
||||
);
|
||||
|
||||
logSummaryFile()
|
||||
<< "# CA" << " p" << " T" << " u'" << " c"
|
||||
<< endl;
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,16 +65,17 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "addCheckCaseOptions.H"
|
||||
#include "setRootCase.H"
|
||||
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "createControl.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "readCombustionProperties.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
@ -88,7 +89,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readTimeControls.H"
|
||||
#include "createTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
@ -128,7 +129,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
runTime.write();
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -243,7 +243,7 @@ if (ign.ignited())
|
||||
rho*max
|
||||
(
|
||||
sigmat - sigmas,
|
||||
dimensionedScalar(sigmat.dimensions(), Zero)
|
||||
dimensionedScalar("0", sigmat.dimensions(), 0)
|
||||
),
|
||||
Xi
|
||||
)
|
||||
|
||||
@ -1 +0,0 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
@ -7,7 +7,7 @@ autoPtr<psiuReactionThermo> pThermo
|
||||
psiuReactionThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "ha", "ea");
|
||||
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -23,6 +23,7 @@ volScalarField rho
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
volScalarField& b = composition.Y("b");
|
||||
Info<< "min(b) = " << min(b).value() << endl;
|
||||
@ -58,6 +59,21 @@ autoPtr<compressible::turbulenceModel> turbulence
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field dpdt\n" << endl;
|
||||
volScalarField dpdt
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dpdt",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
|
||||
);
|
||||
|
||||
Info<< "Creating field kinetic energy K\n" << endl;
|
||||
volScalarField K("K", 0.5*magSqr(U));
|
||||
|
||||
Info<< "Creating field Xi\n" << endl;
|
||||
volScalarField Xi
|
||||
@ -123,10 +139,3 @@ if (composition.contains("ft"))
|
||||
fields.add(b);
|
||||
fields.add(thermo.he());
|
||||
fields.add(thermo.heu());
|
||||
|
||||
#include "createDpdt.H"
|
||||
|
||||
#include "createK.H"
|
||||
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
|
||||
@ -9,4 +9,4 @@
|
||||
mesh.solver("Yi")
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,22 +28,23 @@ Group
|
||||
grpCombustionSolvers
|
||||
|
||||
Description
|
||||
Solver for chemistry problems, designed for use on single cell cases to
|
||||
provide comparison against other chemistry solvers, that uses a single cell
|
||||
mesh, and fields created from the initial conditions.
|
||||
Solver for chemistry problems designed for use on single cell cases to
|
||||
provide comparison against other chemistry solvers
|
||||
|
||||
Note:
|
||||
- single cell mesh created on-the-fly
|
||||
- fields created on the fly from the initial conditions
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "psiReactionThermo.H"
|
||||
#include "BasicChemistryModel.H"
|
||||
#include "reactingMixture.H"
|
||||
#include "psiChemistryModel.H"
|
||||
#include "chemistrySolver.H"
|
||||
#include "OFstream.H"
|
||||
#include "thermoPhysicsTypes.H"
|
||||
#include "basicSpecieMixture.H"
|
||||
#include "hexCellFvMesh.H"
|
||||
#include "basicMultiComponentMixture.H"
|
||||
#include "cellModeller.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -51,15 +52,10 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
|
||||
#define CREATE_MESH createSingleCellMesh.H
|
||||
#define NO_CONTROL
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createSingleCellMesh.H"
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "readInitialConditions.H"
|
||||
#include "createControls.H"
|
||||
|
||||
@ -83,7 +79,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "output.H"
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info << "Number of steps = " << runTime.timeIndex() << endl;
|
||||
|
||||
@ -54,3 +54,4 @@ Info<< "Creating base fields for time " << runTime.timeName() << endl;
|
||||
|
||||
T.write();
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
bool adjustTimeStep(runTime.controlDict().get<bool>("adjustTimeStep"));
|
||||
|
||||
scalar maxDeltaT(runTime.controlDict().get<scalar>("maxDeltaT"));
|
||||
Switch adjustTimeStep(runTime.controlDict().lookup("adjustTimeStep"));
|
||||
scalar maxDeltaT(readScalar(runTime.controlDict().lookup("maxDeltaT")));
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
BasicChemistryModel<psiReactionThermo>& chemistry = pChemistry();
|
||||
scalar dtChem = refCast<const BasicChemistryModel<psiReactionThermo>>
|
||||
(
|
||||
chemistry
|
||||
).deltaTChem()[0];
|
||||
basicSpecieMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
volScalarField& p = thermo.p();
|
||||
@ -12,7 +12,7 @@
|
||||
(
|
||||
"initialConditions",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
runTime,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
@ -23,15 +23,17 @@
|
||||
|
||||
#include "createBaseFields.H"
|
||||
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
autoPtr<psiReactionThermo> pThermo(psiReactionThermo::New(mesh));
|
||||
psiReactionThermo& thermo = pThermo();
|
||||
Info<< nl << "Reading thermophysicalProperties" << endl;
|
||||
autoPtr<psiChemistryModel> pChemistry(psiChemistryModel::New(mesh));
|
||||
|
||||
psiChemistryModel& chemistry = pChemistry();
|
||||
scalar dtChem = refCast<const psiChemistryModel>(chemistry).deltaTChem()[0];
|
||||
|
||||
psiReactionThermo& thermo = chemistry.thermo();
|
||||
thermo.validate(args.executable(), "h");
|
||||
|
||||
autoPtr<BasicChemistryModel<psiReactionThermo>> pChemistry
|
||||
(
|
||||
BasicChemistryModel<psiReactionThermo>::New(thermo)
|
||||
);
|
||||
basicMultiComponentMixture& composition = thermo.composition();
|
||||
PtrList<volScalarField>& Y = composition.Y();
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -39,25 +41,32 @@
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
runTime,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
volScalarField Rspecific
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Rspecific",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
runTime,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar(dimEnergy/dimMass/dimTemperature, Zero)
|
||||
dimensionedScalar
|
||||
(
|
||||
"zero",
|
||||
dimensionSet(dimEnergy/dimMass/dimTemperature),
|
||||
0.0
|
||||
)
|
||||
);
|
||||
|
||||
volVectorField U
|
||||
@ -66,12 +75,12 @@
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
runTime,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector(dimVelocity, Zero)
|
||||
dimensionedVector("zero", dimVelocity, Zero)
|
||||
);
|
||||
|
||||
#include "createPhi.H"
|
||||
|
||||
@ -1,3 +1,46 @@
|
||||
Info<< "Constructing single cell mesh" << nl << endl;
|
||||
|
||||
Foam::simplifiedMeshes::hexCellFvMesh mesh(runTime);
|
||||
labelList owner(6, label(0));
|
||||
labelList neighbour(0);
|
||||
|
||||
pointField points(8);
|
||||
points[0] = vector(0, 0, 0);
|
||||
points[1] = vector(1, 0, 0);
|
||||
points[2] = vector(1, 1, 0);
|
||||
points[3] = vector(0, 1, 0);
|
||||
points[4] = vector(0, 0, 1);
|
||||
points[5] = vector(1, 0, 1);
|
||||
points[6] = vector(1, 1, 1);
|
||||
points[7] = vector(0, 1, 1);
|
||||
|
||||
const cellModel& hexa = *(cellModeller::lookup("hex"));
|
||||
faceList faces = hexa.modelFaces();
|
||||
|
||||
fvMesh mesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
fvMesh::defaultRegion,
|
||||
runTime.timeName(),
|
||||
runTime,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
xferMove<Field<vector>>(points),
|
||||
faces.xfer(),
|
||||
owner.xfer(),
|
||||
neighbour.xfer()
|
||||
);
|
||||
|
||||
List<polyPatch*> patches(1);
|
||||
|
||||
patches[0] = new emptyPolyPatch
|
||||
(
|
||||
"boundary",
|
||||
6,
|
||||
0,
|
||||
0,
|
||||
mesh.boundaryMesh(),
|
||||
emptyPolyPatch::typeName
|
||||
);
|
||||
|
||||
mesh.addFvPatches(patches);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
runTime.write();
|
||||
|
||||
Info<< "Qdot = " << Qdot
|
||||
Info<< "Sh = " << Sh
|
||||
<< ", T = " << thermo.T()[0]
|
||||
<< ", p = " << thermo.p()[0]
|
||||
<< ", " << Y[0].name() << " = " << Y[0][0]
|
||||
@ -8,3 +8,4 @@
|
||||
|
||||
post<< runTime.value() << token::TAB << thermo.T()[0] << token::TAB
|
||||
<< thermo.p()[0] << endl;
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
runTime.controlDict().read("adjustTimeStep", adjustTimeStep);
|
||||
runTime.controlDict().lookup("adjustTimeStep") >> adjustTimeStep;
|
||||
|
||||
runTime.controlDict().read("maxDeltaT", maxDeltaT);
|
||||
maxDeltaT = readScalar(runTime.controlDict().lookup("maxDeltaT"));
|
||||
|
||||
@ -3,3 +3,4 @@ if (adjustTimeStep)
|
||||
runTime.setDeltaT(min(dtChem, maxDeltaT));
|
||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
dtChem = chemistry.solve(runTime.deltaT().value());
|
||||
scalar Qdot = chemistry.Qdot()()[0]/rho[0];
|
||||
integratedHeat += Qdot*runTime.deltaT().value();
|
||||
dtChem = chemistry.solve(runTime.deltaT().value());
|
||||
scalar Sh = chemistry.Sh()()[0]/rho[0];
|
||||
integratedHeat += Sh*runTime.deltaT().value();
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I. \
|
||||
-I../XiFoam/XiEngineFoam \
|
||||
-I../engineFoam \
|
||||
-I../XiFoam \
|
||||
-I../../compressible/rhoPimpleFoam \
|
||||
-I$(LIB_SRC)/engine/lnInclude \
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -45,16 +45,16 @@ Description
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#define CREATE_TIME createEngineTime.H
|
||||
#define CREATE_MESH createEngineMesh.H
|
||||
#include "postProcess.H"
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
#include "createEngineTime.H"
|
||||
#include "createEngineMesh.H"
|
||||
#include "createControl.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "createFields.H"
|
||||
#include "createFieldRefs.H"
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "createRhoUf.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "readEngineTimeControls.H"
|
||||
@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
runTime++;
|
||||
|
||||
Info<< "Engine time = " << runTime.theta() << runTime.unit()
|
||||
Info<< "Crank angle = " << runTime.theta() << " CA-deg"
|
||||
<< endl;
|
||||
|
||||
mesh.move();
|
||||
@ -105,7 +105,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "logSummary.H"
|
||||
|
||||
runTime.printExecutionTime(Info);
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
@ -1,59 +1,71 @@
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
autoPtr<psiThermo> pThermo
|
||||
(
|
||||
psiThermo::New(mesh)
|
||||
);
|
||||
psiThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
autoPtr<psiThermo> pThermo
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
psiThermo::New(mesh)
|
||||
);
|
||||
psiThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
const volScalarField& T = thermo.T();
|
||||
|
||||
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Creating field dpdt\n" << endl;
|
||||
volScalarField dpdt
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dpdt",
|
||||
runTime.timeName(),
|
||||
mesh
|
||||
),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo.rho()
|
||||
);
|
||||
dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo
|
||||
)
|
||||
);
|
||||
|
||||
#include "createDpdt.H"
|
||||
|
||||
#include "createK.H"
|
||||
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
Info<< "Creating field kinetic energy K\n" << endl;
|
||||
volScalarField K("K", 0.5*magSqr(U));
|
||||
|
||||
@ -1,20 +1,12 @@
|
||||
{
|
||||
const scalar meanp = p.weightedAverage(mesh.V()).value();
|
||||
const scalar meanT = T.weightedAverage(mesh.V()).value();
|
||||
const scalar meanup =
|
||||
(sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value();
|
||||
Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl;
|
||||
Info<< "Mean temperature:" << T.weightedAverage(mesh.V()).value() << endl;
|
||||
Info<< "Mean u':"
|
||||
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
|
||||
<< endl;
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
Info<< "Mean pressure:" << meanp << endl;
|
||||
Info<< "Mean temperature:" << meanT << endl;
|
||||
Info<< "Mean u':" << meanup << endl;
|
||||
|
||||
logSummaryFile()
|
||||
<< runTime.theta() << tab
|
||||
<< meanp << tab
|
||||
<< meanT << tab
|
||||
<< meanup
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
logSummaryFile
|
||||
<< runTime.theta() << tab
|
||||
<< p.weightedAverage(mesh.V()).value() << tab
|
||||
<< T.weightedAverage(mesh.V()).value() << tab
|
||||
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
|
||||
<< endl;
|
||||
|
||||
@ -1,18 +1,9 @@
|
||||
Info<< "Total cylinder mass: " << fvc::domainIntegrate(rho).value() << endl;
|
||||
|
||||
autoPtr<OFstream> logSummaryFile;
|
||||
OFstream logSummaryFile
|
||||
(
|
||||
runTime.path()/("logSummary." + runTime.timeName() + ".dat")
|
||||
);
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
logSummaryFile.reset
|
||||
(
|
||||
new OFstream
|
||||
(
|
||||
runTime.rootPath()/runTime.globalCaseName()
|
||||
/("logSummary." + runTime.timeName() + ".dat")
|
||||
)
|
||||
);
|
||||
|
||||
logSummaryFile()
|
||||
<< "# CA" << " p" << " T" << " u'" << endl;
|
||||
}
|
||||
logSummaryFile
|
||||
<< "# CA" << " p" << " T" << " u'" << endl;
|
||||
|
||||
27
applications/solvers/combustion/engineFoam/Make/options
Normal file
27
applications/solvers/combustion/engineFoam/Make/options
Normal file
@ -0,0 +1,27 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SOLVERS)/combustion/XiFoam \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/engine/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lfvOptions \
|
||||
-lsampling \
|
||||
-lmeshTools \
|
||||
-lengine \
|
||||
-lturbulenceModels \
|
||||
-lcompressibleTurbulenceModels \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lreactionThermophysicalModels \
|
||||
-lspecie \
|
||||
-llaminarFlameSpeedModels
|
||||
153
applications/solvers/combustion/engineFoam/engineFoam.C
Normal file
153
applications/solvers/combustion/engineFoam/engineFoam.C
Normal file
@ -0,0 +1,153 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
engineFoam
|
||||
|
||||
Group
|
||||
grpCombustionSolvers
|
||||
|
||||
Description
|
||||
Solver for internal combustion engines.
|
||||
|
||||
Combusting RANS code using the b-Xi two-equation model.
|
||||
Xi may be obtained by either the solution of the Xi transport
|
||||
equation or from an algebraic exression. Both approaches are
|
||||
based on Gulder's flame speed correlation which has been shown
|
||||
to be appropriate by comparison with the results from the
|
||||
spectral model.
|
||||
|
||||
Strain effects are encorporated directly into the Xi equation
|
||||
but not in the algebraic approximation. Further work need to be
|
||||
done on this issue, particularly regarding the enhanced removal rate
|
||||
caused by flame compression. Analysis using results of the spectral
|
||||
model will be required.
|
||||
|
||||
For cases involving very lean Propane flames or other flames which are
|
||||
very strain-sensitive, a transport equation for the laminar flame
|
||||
speed is present. This equation is derived using heuristic arguments
|
||||
involving the strain time scale and the strain-rate at extinction.
|
||||
the transport velocity is the same as that for the Xi equation.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "engineTime.H"
|
||||
#include "engineMesh.H"
|
||||
#include "psiuReactionThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "laminarFlameSpeed.H"
|
||||
#include "ignition.H"
|
||||
#include "Switch.H"
|
||||
#include "OFstream.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "pimpleControl.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
|
||||
#include "createEngineTime.H"
|
||||
#include "createEngineMesh.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
#include "readCombustionProperties.H"
|
||||
#include "createFields.H"
|
||||
#include "createMRF.H"
|
||||
#include "createFvOptions.H"
|
||||
#include "createRhoUf.H"
|
||||
#include "initContinuityErrs.H"
|
||||
#include "readEngineTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setInitialDeltaT.H"
|
||||
#include "startSummary.H"
|
||||
|
||||
turbulence->validate();
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
#include "readEngineTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
#include "setDeltaT.H"
|
||||
|
||||
runTime++;
|
||||
|
||||
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
|
||||
|
||||
mesh.move();
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "UEqn.H"
|
||||
|
||||
#include "ftEqn.H"
|
||||
#include "bEqn.H"
|
||||
#include "EauEqn.H"
|
||||
#include "EaEqn.H"
|
||||
|
||||
if (!ign.ignited())
|
||||
{
|
||||
thermo.heu() == thermo.he();
|
||||
}
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
|
||||
#include "logSummary.H"
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user