mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/hunt2/OpenFOAM/OpenFOAM-dev
This commit is contained in:
4
README
4
README
@ -2,9 +2,9 @@
|
|||||||
#
|
#
|
||||||
#+TITLE: *OpenFOAM README for version 1.5*
|
#+TITLE: *OpenFOAM README for version 1.5*
|
||||||
#+AUTHOR: OpenCFD Ltd.
|
#+AUTHOR: OpenCFD Ltd.
|
||||||
#+DATE: 14 July 2008
|
#+DATE: 26 August 2008
|
||||||
#+LINK: http://www.opencfd.co.uk
|
#+LINK: http://www.opencfd.co.uk
|
||||||
#+OPTIONS: author:nil
|
#+OPTIONS: author:nil ^:{}
|
||||||
|
|
||||||
* Copyright
|
* Copyright
|
||||||
OpenFOAM is free software; you can redistribute it and/or modify it under the
|
OpenFOAM is free software; you can redistribute it and/or modify it under the
|
||||||
|
|||||||
484
README.html
484
README.html
@ -1,42 +1,26 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
OpenFOAM README for version 1.5
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
1 Copyright
|
||||||
lang="en" xml:lang="en">
|
|
||||||
<head>
|
OpenFOAM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
|
||||||
<title><b>OpenFOAM README for version 1.5</b></title>
|
as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
|
See the file COPYING in this directory, for a description of the GNU General Public License terms under which you can
|
||||||
<meta name="generator" content="Org-mode"/>
|
copy the files.
|
||||||
<meta name="generated" content="14 July 2008"/>
|
|
||||||
<meta name="author" content="OpenCFD Ltd."/>
|
2 System requirements
|
||||||
<style type="text/css">
|
|
||||||
html {
|
OpenFOAM is developed and tested on Linux, but should work with other Unix style systems. To check your system setup,
|
||||||
font-family: Times, serif;
|
execute the foamSystemCheck script in the bin/ directory of the OpenFOAM installation. If no problems are reported,
|
||||||
font-size: 12pt;
|
proceed to "3. Installation"; otherwise contact your system administrator.
|
||||||
}
|
|
||||||
.title { text-align: center; }
|
If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the section "Running OpenFOAM in 32-bit mode".
|
||||||
.todo { color: red; }
|
|
||||||
.done { color: green; }
|
2.1 Qt (from http://trolltech.com/products/qt)
|
||||||
.timestamp { color: grey }
|
|
||||||
.timestamp-kwd { color: CadetBlue }
|
The ParaView 3.3 visualisation package requires that Qt version 4.3.x MUST be installed on the system. Earlier or more
|
||||||
.tag { background-color:lightblue; font-weight:normal }
|
recent versions (4.2.x or 4.4.x) will NOT work. To check whether Qt4 is installed, and the version, type:
|
||||||
.target { }
|
|
||||||
pre {
|
* qmake <div id="table-of-contents">
|
||||||
border: 1pt solid #AEBDCC;
|
|
||||||
background-color: #F3F5F7;
|
|
||||||
padding: 5pt;
|
|
||||||
font-family: courier, monospace;
|
|
||||||
font-size: 90%;
|
|
||||||
}
|
|
||||||
table { border-collapse: collapse; }
|
|
||||||
td, th {
|
|
||||||
vertical-align: top;
|
|
||||||
<!--border: 1pt solid #ADB9CC;-->
|
|
||||||
}
|
|
||||||
dt { font-weight: bold; }
|
|
||||||
</style>
|
|
||||||
</head><body>
|
|
||||||
<h1 class="title"><b>OpenFOAM README for version 1.5</b></h1>
|
|
||||||
<div id="table-of-contents">
|
|
||||||
<h2>Table of Contents</h2>
|
<h2>Table of Contents</h2>
|
||||||
<div id="text-table-of-contents">
|
<div id="text-table-of-contents">
|
||||||
<ul>
|
<ul>
|
||||||
@ -62,384 +46,152 @@ lang="en" xml:lang="en">
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
–version
|
||||||
|
|
||||||
<div id="outline-container-1" class="outline-2">
|
The ParaView binary executables in the ThirdParty distribution will only work with PRECISELY the same version of Qt
|
||||||
<h2 id="sec-1">1 Copyright</h2>
|
with which it was compiled. The 64-bit version of ParaView was compiled with Qt-4.3.1 (with openSuSE-10.3) and the
|
||||||
<div id="text-1">
|
32-bit version of ParaView was compiled with Qt-4.3.2 (with ubuntu-7.10). If the user finds that a ParaView binary
|
||||||
|
fails to run, then it is almost certainly due to a conflict in compiled and installed Qt versions and they will need to
|
||||||
|
consult the section below on "Compiling ParaView and the PV3FoamReader module."
|
||||||
|
|
||||||
<p>OpenFOAM is free software; you can redistribute it and/or modify it under the
|
|
||||||
terms of the GNU General Public License as published by the Free Software
|
|
||||||
Foundation; either version 2 of the License, or (at your option) any later
|
|
||||||
version. See the file COPYING in this directory, for a description of the GNU
|
|
||||||
General Public License terms under which you can copy the files.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="outline-container-2" class="outline-2">
|
|
||||||
<h2 id="sec-2">2 System requirements</h2>
|
|
||||||
<div id="text-2">
|
|
||||||
|
|
||||||
<p>OpenFOAM is developed and tested on Linux, but should work with other Unix
|
|
||||||
style systems. To check your system setup, execute the foamSystemCheck script
|
|
||||||
in the bin/ directory of the OpenFOAM installation. If no problems are
|
|
||||||
reported, proceed to "3. Installation"; otherwise contact your system
|
|
||||||
administrator.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
If the user wishes to run OpenFOAM in 32/64-bit mode they should consult the
|
|
||||||
section "Running OpenFOAM in 32-bit mode".
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="outline-container-2.1" class="outline-3">
|
|
||||||
<h3 id="sec-2.1">2.1 Qt (from <a href="http://trolltech.com/products/qt">http://trolltech.com/products/qt</a>)</h3>
|
|
||||||
<div id="text-2.1">
|
|
||||||
|
|
||||||
<p>The ParaView 3.3 visualisation package requires that Qt version 4.3.x MUST
|
|
||||||
be installed on the system. Earlier or more recent versions (4.2.x or
|
|
||||||
4.4.x) will NOT work. To check whether Qt4 is installed, and the version,
|
|
||||||
type:
|
|
||||||
</p><ul>
|
|
||||||
<li>
|
|
||||||
qmake –version
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>The ParaView binary executables in the ThirdParty distribution will only
|
|
||||||
work with PRECISELY the same version of Qt with which it was compiled. The
|
|
||||||
64-bit version of ParaView was compiled with Qt-4.3.1 (with openSuSE-10.3)
|
|
||||||
and the 32-bit version of ParaView was compiled with Qt-4.3.2 (with
|
|
||||||
ubuntu-7.10). If the user finds that a ParaView binary fails to run, then
|
|
||||||
it is almost certainly due to a conflict in compiled and installed Qt
|
|
||||||
versions and they will need to consult the section below on "Compiling
|
|
||||||
ParaView and the PV3FoamReader module."
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
The default versions of Qt used by some GNU/Linux releases are as follows.
|
The default versions of Qt used by some GNU/Linux releases are as follows.
|
||||||
</p><ul>
|
|
||||||
<li>
|
|
||||||
ubuntu-7.10: Version 4.3.2
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
ubuntu-8.04: Version 4.3.4
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
openSuSE-10.2: Version 4.2.1 - too old
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
openSuSE-10.3: Version 4.3.1
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
openSuSE-11.0: Version 4.4.0 - too new
|
|
||||||
|
|
||||||
</li>
|
* ubuntu-7.10: Version 4.3.2
|
||||||
</ul>
|
* ubuntu-8.04: Version 4.3.4
|
||||||
|
* openSuSE-10.2: Version 4.2.1 - too old
|
||||||
|
* openSuSE-10.3: Version 4.3.1
|
||||||
|
* openSuSE-11.0: Version 4.4.0 - too new
|
||||||
|
|
||||||
<p>Compilation and running of ParaView has been successful using the libraries
|
Compilation and running of ParaView has been successful using the libraries downloaded in the "libqt4-dev" package on
|
||||||
downloaded in the "libqt4-dev" package on ubuntu.
|
ubuntu.
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
If you don't have an appropriate version of Qt installed you can download
|
|
||||||
the sources from TrollTech e.g.:
|
|
||||||
<a href="ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.3.5.tar.bz2">ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.3.5.tar.bz2</a>
|
|
||||||
and compile and install in /usr/local or some other location that does to
|
|
||||||
conflict with the pre-installed version.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
If you don't have an appropriate version of Qt installed you can download the sources from TrollTech e.g.: ftp://
|
||||||
|
ftp.trolltech.com/qt/source/qt-x11-opensource-src-4.3.5.tar.bz2 and compile and install in /usr/local or some other
|
||||||
|
location that does to conflict with the pre-installed version.
|
||||||
|
|
||||||
<div id="outline-container-3" class="outline-2">
|
3 Installation
|
||||||
<h2 id="sec-3">3 Installation</h2>
|
|
||||||
<div id="text-3">
|
|
||||||
|
|
||||||
<p>Download and unpack the files in the $HOME/OpenFOAM directory as described in:
|
Download and unpack the files in the $HOME/OpenFOAM directory as described in: http://www.OpenFOAM.org/download.html
|
||||||
<a href="http://www.OpenFOAM.org/download.html">http://www.OpenFOAM.org/download.html</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
The environment variable settings are contained in files in an etc/ directory
|
|
||||||
in the OpenFOAM release. e.g. in
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
$HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
where <VERSION> corresponds to the version 1.4, 1.5, …
|
|
||||||
|
|
||||||
</li>
|
The environment variable settings are contained in files in an etc/ directory in the OpenFOAM release. e.g. in
|
||||||
<li>
|
|
||||||
EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the
|
|
||||||
etc/bashrc file by adding the following line to the end of your
|
|
||||||
$HOME/.bashrc file:
|
|
||||||
|
|
||||||
<ul>
|
* $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/
|
||||||
<li>
|
* where <VERSION> corresponds to the version 1.4, 1.5, …
|
||||||
. $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/bashrc
|
|
||||||
|
|
||||||
</li>
|
* EITHER, if running bash or ksh (if in doubt type 'echo $SHELL'), source the etc/bashrc file by adding the following
|
||||||
</ul>
|
line to the end of your $HOME/.bashrc file:
|
||||||
|
|
||||||
<p>Then update the environment variables by sourcing the $HOME/.bashrc file by
|
+ . $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/bashrc
|
||||||
typing in the terminal:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
. $HOME/.bashrc
|
|
||||||
|
|
||||||
</li>
|
Then update the environment variables by sourcing the $HOME/.bashrc file by typing in the terminal:
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
OR, if running tcsh or csh, source the etc/cshrc file by adding the
|
|
||||||
following line to the end of your $HOME/.cshrc file:
|
|
||||||
|
|
||||||
<ul>
|
+ . $HOME/.bashrc
|
||||||
<li>
|
|
||||||
source $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/cshrc
|
|
||||||
|
|
||||||
</li>
|
* OR, if running tcsh or csh, source the etc/cshrc file by adding the following line to the end of your $HOME/.cshrc
|
||||||
</ul>
|
file:
|
||||||
|
|
||||||
<p>Then update the environment variables by sourcing the $HOME/.cshrc file by
|
+ source $HOME/OpenFOAM/OpenFOAM-<VERSION>/etc/cshrc
|
||||||
typing in the terminal:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
source $HOME/.cshrc
|
|
||||||
|
|
||||||
</li>
|
Then update the environment variables by sourcing the $HOME/.cshrc file by typing in the terminal:
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
+ source $HOME/.cshrc
|
||||||
|
|
||||||
<div id="outline-container-3.1" class="outline-3">
|
3.1 Installation in alternative locations
|
||||||
<h3 id="sec-3.1">3.1 Installation in alternative locations</h3>
|
|
||||||
<div id="text-3.1">
|
|
||||||
|
|
||||||
<p>OpenFOAM may also be installed in alternative locations. However, the
|
OpenFOAM may also be installed in alternative locations. However, the installation directory should be network
|
||||||
installation directory should be network available (e.g., NFS) if parallel
|
available (e.g., NFS) if parallel calculations are planned.
|
||||||
calculations are planned.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
The environment variable 'FOAM_INST_DIR' can be used to find and source the
|
|
||||||
appropriate resource file. Here is a bash/ksh/sh example:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
export FOAM_INST_DIR=/data/app/OpenFOAM
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
[ -f $foamDotFile ] && . $foamDotFile
|
|
||||||
|
|
||||||
</li>
|
The environment variable 'FOAM_INST_DIR' can be used to find and source the appropriate resource file. Here is a bash/
|
||||||
</ul>
|
ksh/sh example:
|
||||||
|
|
||||||
<p>and a csh/tcsh example:
|
* export FOAM_INST_DIR=/data/app/OpenFOAM
|
||||||
</p>
|
* foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
|
||||||
<ul>
|
* [ -f $foamDotFile ] && . $foamDotFile
|
||||||
<li>
|
|
||||||
setenv FOAM_INST_DIR /data/app/OpenFOAM
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
if ( -f $foamDotFile ) source $foamDotFile
|
|
||||||
|
|
||||||
</li>
|
and a csh/tcsh example:
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts
|
* setenv FOAM_INST_DIR /data/app/OpenFOAM
|
||||||
of the OpenFOAM installation.
|
* foamDotFile=$FOAM_INST_DIR/OpenFOAM-<VERSION>/etc/bashrc
|
||||||
</p>
|
* if ( -f $foamDotFile ) source $foamDotFile
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
The value set in '$FOAM_INST_DIR' will be used to locate the remaining parts of the OpenFOAM installation.
|
||||||
|
|
||||||
<div id="outline-container-4" class="outline-2">
|
4 Building from Sources (Optional)
|
||||||
<h2 id="sec-4">4 Building from Sources (Optional)</h2>
|
|
||||||
<div id="text-4">
|
|
||||||
|
|
||||||
<p>If you cannot find an appropriate binary pack for your platform, you can build
|
If you cannot find an appropriate binary pack for your platform, you can build the complete OpenFOAM from the
|
||||||
the complete OpenFOAM from the source-pack. You will first need to compile or
|
source-pack. You will first need to compile or obtain a recent version of gcc (we recomend gcc-4.3.?) for your
|
||||||
obtain a recent version of gcc (we recomend gcc-4.3.?) for your platform,
|
platform, which may be obtained from http://gcc.gnu.org/.
|
||||||
which may be obtained from <a href="http://gcc.gnu.org/">http://gcc.gnu.org/</a>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Install the compiler in
|
|
||||||
$WM_PROJECT_INST_DIR/ThirdParty/gcc-<GCC_VERSION>/platforms/$WM_ARCH$WM_COMPILER_ARCH/
|
|
||||||
and change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and
|
|
||||||
$WM_PROJECT_DIR/etc/settings.csh appropriately and finally update the
|
|
||||||
environment variables as in section 3.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Now go to the top-level source directory $WM_PROJECT_DIR and execute the
|
|
||||||
top-level build script './Allwmake'. In principle this will build everything,
|
|
||||||
but if problems occur with the build order it may be necessary to update the
|
|
||||||
environment variables and re-execute 'Allwmake'. If you experience
|
|
||||||
difficulties with building the source-pack, or your platform is not currently
|
|
||||||
supported, please contact <enquiries@OpenCFD.co.uk> to negotiate a support
|
|
||||||
contract and we will do the port and maintain it for future releases.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
Install the compiler in $WM_PROJECT_INST_DIR/ThirdParty/gcc-<GCC_VERSION>/platforms/$WM_ARCH$WM_COMPILER_ARCH/ and
|
||||||
|
change the gcc version number in $WM_PROJECT_DIR/etc/settings.sh and $WM_PROJECT_DIR/etc/settings.csh appropriately and
|
||||||
|
finally update the environment variables as in section 3.
|
||||||
|
|
||||||
<div id="outline-container-5" class="outline-2">
|
Now go to the top-level source directory $WM_PROJECT_DIR and execute the top-level build script './Allwmake'. In
|
||||||
<h2 id="sec-5">5 Testing the installation</h2>
|
principle this will build everything, but if problems occur with the build order it may be necessary to update the
|
||||||
<div id="text-5">
|
environment variables and re-execute 'Allwmake'. If you experience difficulties with building the source-pack, or your
|
||||||
|
platform is not currently supported, please contact <enquiries@OpenCFD.co.uk> to negotiate a support contract and we
|
||||||
|
will do the port and maintain it for future releases.
|
||||||
|
|
||||||
<p>To check your installation setup, execute the 'foamInstallationTest' script
|
5 Testing the installation
|
||||||
(in the bin/ directory of the OpenFOAM installation). If no problems are
|
|
||||||
reported, proceed to getting started with OpenFOAM; otherwise, go back and
|
|
||||||
check you have installed the software correctly and/or contact your system
|
|
||||||
administrator.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
To check your installation setup, execute the 'foamInstallationTest' script (in the bin/ directory of the OpenFOAM
|
||||||
|
installation). If no problems are reported, proceed to getting started with OpenFOAM; otherwise, go back and check you
|
||||||
|
have installed the software correctly and/or contact your system administrator.
|
||||||
|
|
||||||
<div id="outline-container-6" class="outline-2">
|
6 Getting Started
|
||||||
<h2 id="sec-6">6 Getting Started</h2>
|
|
||||||
<div id="text-6">
|
|
||||||
|
|
||||||
<p>Create a project directory within the $HOME/OpenFOAM directory named
|
Create a project directory within the $HOME/OpenFOAM directory named <USER>-<VERSION> (e.g. 'chris-1.5' for user chris
|
||||||
<USER>-<VERSION> (e.g. 'chris-1.5' for user chris and OpenFOAM version 1.5)
|
and OpenFOAM version 1.5) and create a directory named 'run' within it, e.g. by typing:
|
||||||
and create a directory named 'run' within it, e.g. by typing:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
mkdir -p $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
|
|
||||||
|
|
||||||
</li>
|
* mkdir -p $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>Copy the 'tutorial' examples directory in the OpenFOAM distribution to the
|
Copy the 'tutorial' examples directory in the OpenFOAM distribution to the 'run' directory. If the OpenFOAM environment
|
||||||
'run' directory. If the OpenFOAM environment variables are set correctly,
|
variables are set correctly, then the following command will be correct:
|
||||||
then the following command will be correct:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
cp -r $WM_PROJECT_DIR/tutorials
|
|
||||||
$HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
|
|
||||||
|
|
||||||
</li>
|
* cp -r $WM_PROJECT_DIR/tutorials $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>Run the first example case of incompressible laminar flow in a cavity:
|
Run the first example case of incompressible laminar flow in a cavity:
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
cd $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run/tutorials/icoFoam/cavity
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
blockMesh
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
icoFoam
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
paraFoam
|
|
||||||
|
|
||||||
</li>
|
* cd $HOME/OpenFOAM/${USER}-${WM_PROJECT_VERSION}/run/tutorials/icoFoam/cavity
|
||||||
</ul>
|
* blockMesh
|
||||||
</div>
|
* icoFoam
|
||||||
|
* paraFoam
|
||||||
|
|
||||||
</div>
|
7 Compiling Paraview 3.3 and the PV3FoamReader module
|
||||||
|
|
||||||
<div id="outline-container-7" class="outline-2">
|
A version of Qt 4.3.x must be installed to compile ParaView. The compilation is a fairly simple process using the
|
||||||
<h2 id="sec-7">7 Compiling Paraview 3.3 and the PV3FoamReader module</h2>
|
supplied buildParaView3.3-cvs script that has worked is our tests with other packages supplied in the ThirdParty
|
||||||
<div id="text-7">
|
directory, namely cmake-2.4.6 and gcc-4.3.1. Execute the following:
|
||||||
|
|
||||||
<p>A version of Qt 4.3.x must be installed to compile ParaView. The compilation
|
* cd $FOAM_INST_DIR/ThirdParty
|
||||||
is a fairly simple process using the supplied buildParaView3.3-cvs script that
|
* rm -rf ParaView3.3-cvs/platforms
|
||||||
has worked is our tests with other packages supplied in the ThirdParty
|
* buildParaView3.3-cvs
|
||||||
directory, namely cmake-2.4.6 and gcc-4.3.1. Execute the following:
|
|
||||||
</p><ul>
|
|
||||||
<li>
|
|
||||||
cd $FOAM_INST_DIR/ThirdParty
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
rm -rf ParaView3.3-cvs/platforms
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
buildParaView3.3-cvs
|
|
||||||
|
|
||||||
</li>
|
The PV3FoamReader module is an OpenFOAM utility that can be compiled in the usual manner as follows:
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>The PV3FoamReader module is an OpenFOAM utility that can be compiled in the
|
* cd $FOAM_UTILITIES/postProcessing/graphics/PV3FoamReader
|
||||||
usual manner as follows:
|
* ./Allwclean
|
||||||
</p><ul>
|
* ./Allwmake
|
||||||
<li>
|
|
||||||
cd $FOAM_UTILITIES/postProcessing/graphics/PV3FoamReader
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
./Allwclean
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
./Allwmake
|
|
||||||
|
|
||||||
</li>
|
8 Documentation
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
http://www.OpenFOAM.org/doc
|
||||||
|
|
||||||
<div id="outline-container-8" class="outline-2">
|
9 Help
|
||||||
<h2 id="sec-8">8 Documentation</h2>
|
|
||||||
<div id="text-8">
|
|
||||||
|
|
||||||
<p><a href="http://www.OpenFOAM.org/doc">http://www.OpenFOAM.org/doc</a>
|
http://www.OpenFOAM.org http://www.OpenFOAM.org/discussion.html
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
10 Reporting Bugs in OpenFOAM
|
||||||
|
|
||||||
<div id="outline-container-9" class="outline-2">
|
http://www.OpenFOAM.org/bugs.html
|
||||||
<h2 id="sec-9">9 Help</h2>
|
|
||||||
<div id="text-9">
|
|
||||||
|
|
||||||
<p><a href="http://www.OpenFOAM.org">http://www.OpenFOAM.org</a> <a href="http://www.OpenFOAM.org/discussion.html">http://www.OpenFOAM.org/discussion.html</a>
|
11 Running OpenFOAM in 32-bit mode on 64-bit machines
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
Linux users with a 64-bit machine may install either the OpenFOAM 32-bit version (linux) or the OpenFOAM 64-bit version
|
||||||
|
(linux64), or both. The 64-bit is the default mode on a 64-bit machine. To use an installed 32-bit version, the user
|
||||||
|
must set the environment variable WM_ARCH_OPTION to 32 before sourcing the etc/bashrc (or etc/cshrc) file.
|
||||||
|
|
||||||
<div id="outline-container-10" class="outline-2">
|
Date: 26 August 2008
|
||||||
<h2 id="sec-10">10 Reporting Bugs in OpenFOAM</h2>
|
|
||||||
<div id="text-10">
|
|
||||||
|
|
||||||
<p><a href="http://www.OpenFOAM.org/bugs.html">http://www.OpenFOAM.org/bugs.html</a>
|
HTML generated by org-mode 6.06b in emacs 23
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="outline-container-11" class="outline-2">
|
|
||||||
<h2 id="sec-11">11 Running OpenFOAM in 32-bit mode on 64-bit machines</h2>
|
|
||||||
<div id="text-11">
|
|
||||||
|
|
||||||
<p>Linux users with a 64-bit machine may install either the OpenFOAM 32-bit
|
|
||||||
version (linux) or the OpenFOAM 64-bit version (linux64), or both. The 64-bit
|
|
||||||
is the default mode on a 64-bit machine. To use an installed 32-bit version,
|
|
||||||
the user must set the environment variable $WM_32 (to anything, e.g. "on")
|
|
||||||
before sourcing the etc/bashrc (or etc/cshrc) file.
|
|
||||||
</p></div>
|
|
||||||
</div>
|
|
||||||
<div id="postamble"><p class="date"> Date: 14 July 2008</p>
|
|
||||||
<p>HTML generated by org-mode 6.05a in emacs 23<p>
|
|
||||||
</div></body>
|
|
||||||
</html>
|
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
#
|
#
|
||||||
#+TITLE: *OpenFOAM release notes for version 1.5*
|
#+TITLE: *OpenFOAM release notes for version 1.5*
|
||||||
#+AUTHOR: OpenCFD Ltd.
|
#+AUTHOR: OpenCFD Ltd.
|
||||||
#+DATE: 14 July 2008
|
#+DATE: 26 August 2008
|
||||||
#+LINK: http://www.opencfd.co.uk
|
#+LINK: http://www.opencfd.co.uk
|
||||||
#+OPTIONS: author:nil
|
#+OPTIONS: author:nil ^:{}
|
||||||
|
|
||||||
* Overview
|
* Overview
|
||||||
OpenFOAM-1.5 is is a significant upgrade to version 1.4 in ways which are
|
OpenFOAM-1.5 is is a significant upgrade to version 1.4 in ways which are
|
||||||
|
|||||||
@ -1,42 +1,27 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
OpenFOAM release notes for version 1.5
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
1 Overview
|
||||||
lang="en" xml:lang="en">
|
|
||||||
<head>
|
OpenFOAM-1.5 is is a significant upgrade to version 1.4 in ways which are
|
||||||
<title><b>OpenFOAM release notes for version 1.5</b></title>
|
outlined below. This release passes all our standard tests and the tutorials
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
|
have been broadly checked. If there are any bugs, please report them using the
|
||||||
<meta name="generator" content="Org-mode"/>
|
instructions set out in: http://www.openfoam.org/bugs.html.
|
||||||
<meta name="generated" content="14 July 2008"/>
|
|
||||||
<meta name="author" content="OpenCFD Ltd."/>
|
Most of the developments for this release are in: new applications, e.g. for
|
||||||
<style type="text/css">
|
multiphase flow and cavitation, buoyancy-flow and heat transfer, high speed
|
||||||
html {
|
flows and even molecular dynamics; new utilities, e.g. for meshing and case
|
||||||
font-family: Times, serif;
|
monitoring; and, new modelling, e.g. in Lagrangian particle tracking,
|
||||||
font-size: 12pt;
|
radiation and rotating frames of reference. With these new applications come
|
||||||
}
|
numerous new example cases.
|
||||||
.title { text-align: center; }
|
|
||||||
.todo { color: red; }
|
2 GNU/Linux version
|
||||||
.done { color: green; }
|
|
||||||
.timestamp { color: grey }
|
The 64bit binary packs of the OpenFOAM release were compiled on a machine
|
||||||
.timestamp-kwd { color: CadetBlue }
|
running SuSE GNU/Linux version 10.3 and the 32bit on a machine running Ubuntu
|
||||||
.tag { background-color:lightblue; font-weight:normal }
|
GNU/Linux version 7.1 and also tested on Ubuntu 8.04. We recommend that users
|
||||||
.target { }
|
run OpenFOAM on one of these or a similar recent version of GNU/Linux. This
|
||||||
pre {
|
release has also been successfully compiled and tested on older GNU/Linux
|
||||||
border: 1pt solid #AEBDCC;
|
releases but this re<div id="table-of-contents">
|
||||||
background-color: #F3F5F7;
|
|
||||||
padding: 5pt;
|
|
||||||
font-family: courier, monospace;
|
|
||||||
font-size: 90%;
|
|
||||||
}
|
|
||||||
table { border-collapse: collapse; }
|
|
||||||
td, th {
|
|
||||||
vertical-align: top;
|
|
||||||
<!--border: 1pt solid #ADB9CC;-->
|
|
||||||
}
|
|
||||||
dt { font-weight: bold; }
|
|
||||||
</style>
|
|
||||||
</head><body>
|
|
||||||
<h1 class="title"><b>OpenFOAM release notes for version 1.5</b></h1>
|
|
||||||
<div id="table-of-contents">
|
|
||||||
<h2>Table of Contents</h2>
|
<h2>Table of Contents</h2>
|
||||||
<div id="text-table-of-contents">
|
<div id="text-table-of-contents">
|
||||||
<ul>
|
<ul>
|
||||||
@ -54,376 +39,170 @@ lang="en" xml:lang="en">
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
quires the installation of Qt 4.3.? for ParaView-3 to run.
|
||||||
|
|
||||||
<div id="outline-container-1" class="outline-2">
|
3 C++ Compiler version
|
||||||
<h2 id="sec-1">1 Overview</h2>
|
|
||||||
<div id="text-1">
|
|
||||||
|
|
||||||
<p>OpenFOAM-1.5 is is a significant upgrade to version 1.4 in ways which are
|
* Released compiled with GCC 4.3.1, the latest version.
|
||||||
outlined below. This release passes all our standard tests and the tutorials
|
* Built in support for the Intel C++ 10.? compiler (untested).
|
||||||
have been broadly checked. If there are any bugs, please report them using
|
* The choice of the compiler is controlled by the setting of the
|
||||||
the instructions set out in: <a href="http://www.openfoam.org/bugs.html">http://www.openfoam.org/bugs.html</a>.
|
$WM_COMPILER and $WM_COMPILER_ARCH environment variables in the
|
||||||
</p>
|
OpenFOAM-1.5/etc/bashrc (or cshrc) file.
|
||||||
<p>
|
* The location of the installation of the compiler is controlled by the
|
||||||
Most of the developments for this release are in: new applications, e.g. for
|
$WM_COMPILER_INST environment variable in the OpenFOAM-1.5/etc/settings.sh
|
||||||
multiphase flow and cavitation, buoyancy-flow and heat transfer, high speed
|
(or settings.csh) file.
|
||||||
flows and even molecular dynamics; new utilities, e.g. for meshing and case
|
|
||||||
monitoring; and, new modelling, e.g. in Lagrangian particle tracking,
|
|
||||||
radiation and rotating frames of reference. With these new applications come
|
|
||||||
numerous new example cases.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
4 Developments to solvers (applications)
|
||||||
|
|
||||||
<div id="outline-container-2" class="outline-2">
|
* New rhoCentralFoam solver for high-speed, viscous, compressible flows
|
||||||
<h2 id="sec-2">2 GNU/Linux version</h2>
|
using non-oscillatory, central-upwind schemes.
|
||||||
<div id="text-2">
|
* New interDyMFoam solver for 2 incompressible, isothermal, immiscible
|
||||||
|
fluids using a VoF phase-fraction based interface capturing approach, with
|
||||||
|
optional mesh motion and mesh topology changes including adaptive mesh
|
||||||
|
(un)refinement. Useful for simulations such as tank filling, sloshing ---
|
||||||
|
using solid body motion e.g. SDA or SKA (6DoF) — and slamming (using the
|
||||||
|
mesh motion solver) and other large-scale applications that benefit from
|
||||||
|
the efficiency gain of adaptive mesh (un)refinement of the interface.
|
||||||
|
* New compressibleInterFoam solver for 2 compressible, isothermal,
|
||||||
|
immiscible fluids using a volume of fluid (VoF) phase-fraction approach
|
||||||
|
for interface-capturing. The momentum and other fluid properties are of
|
||||||
|
the "mixture" and a single momentum equation is solved. Turbulence is
|
||||||
|
modelled using a run-time selectable incompressible LES model.
|
||||||
|
* New interPhaseChangeFoam solver for 2 incompressible, isothermal,
|
||||||
|
immiscible fluids with phase-change, e.g. cavitation. Uses VoF interface
|
||||||
|
capturing, with momentum and other fluid properties described for the
|
||||||
|
``mixture'' and a single momentum equation is solved. The set of
|
||||||
|
phase-change models provided are designed to simulate cavitation but other
|
||||||
|
mechanisms of phase-change are supported within this solver framework.
|
||||||
|
* New rasCavitatingFoam solver for transient cavitation using a barotropic
|
||||||
|
compressibility model, with RAS turbulence.
|
||||||
|
* New lesCavitatingFoam solver for transient cavitation using a barotropic
|
||||||
|
compressibility model, with LES turbulence.
|
||||||
|
* New chtMultiRegionFoam solver that couples conjugate heat transfer in a
|
||||||
|
solid to a buoyancy-driven flow simulation.
|
||||||
|
* New PDRFoam solver for compressible premixed/partially-premixed turbulent
|
||||||
|
combustion that includes porosity/distributed resistance (PDR) modelling
|
||||||
|
to handle regions containing solid blockages which cannot be resolved by
|
||||||
|
the mesh. Requires the PDR fields.
|
||||||
|
* New lesBuoyantFoam solver for transient, buoyant, turbulent flow of
|
||||||
|
compressible fluids for ventilation and heat-transfer. Turbulence is
|
||||||
|
modelled using a run-time selectable compressible LES model.
|
||||||
|
* New rhoPimpleFoam solver for transient, turbulent flow of compressible
|
||||||
|
fluids for ventilation and heat-transfer. Uses the flexible PIMPLE
|
||||||
|
(PISO-SIMPLE) solution for time-resolved and pseudo-transient simulations.
|
||||||
|
* New buoyantSimpleRadiationFoam solver for steady-state, buoyant, turbulent
|
||||||
|
flow of compressible fluids with radiation, for ventilation and
|
||||||
|
heat-transfer.
|
||||||
|
* New rhoTurbTwinParcelFoam solver for transient for compressible, turbulent
|
||||||
|
flow with two thermo-clouds.
|
||||||
|
* New gnemdFOAM solver for general purpose molecular dynamics that simulates
|
||||||
|
atoms in arbitrary shaped domains and average atomic/molecular quantities
|
||||||
|
to the mesh to create field data.
|
||||||
|
* New mdEqulibrationFoam solver to equilibrates and/or preconditions
|
||||||
|
molecular dynamics systems.
|
||||||
|
* Demonstration SRFSimpleFoam solver based on simpleFoam that incorporates
|
||||||
|
the SRF extensions (see below) for rotating flows.
|
||||||
|
|
||||||
<p>The 64bit binary packs of the OpenFOAM release were compiled on a machine
|
5 Automatic mesher
|
||||||
running SuSE GNU/Linux version 10.3 and the 32bit on a machine running Ubuntu
|
|
||||||
GNU/Linux version 7.1 and also tested on Ubuntu 8.04. We recommend that
|
|
||||||
users run OpenFOAM on one of these or a similar recent version of GNU/Linux.
|
|
||||||
This release has also been successfully compiled and tested on older GNU/Linux
|
|
||||||
releases but this requires the installation of Qt 4.3.? for ParaView-3 to run.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
New snappyHexMesh utility that generates split-hex meshes automatically from
|
||||||
|
triangulated (STL) surface geometries. The mesh approximately conforms to the
|
||||||
|
surface by iteratively refining a starting mesh and morphing the resulting
|
||||||
|
split-hex mesh to the surface. An optional phase will shrink back the
|
||||||
|
resulting mesh and insert cell layers. It has a flexible specification of mesh
|
||||||
|
refinement level and robust surface handling with a pre-specified final mesh
|
||||||
|
quality. It runs in parallel with a load balancing step every iteration.
|
||||||
|
|
||||||
<div id="outline-container-3" class="outline-2">
|
6 Developments to utilities
|
||||||
<h2 id="sec-3">3 C++ Compiler version</h2>
|
|
||||||
<div id="text-3">
|
|
||||||
|
|
||||||
<ul>
|
* New extrude2DMesh utility that extrudes 2D meshes into a 3D mesh. 2D
|
||||||
<li>
|
meshes are described by faces with 2 points, so can be used in combination
|
||||||
Released compiled with GCC 4.3.1, the latest version.
|
with 2D meshes converted with ccm26ToFoam.
|
||||||
</li>
|
* New couplePatches functionality integrated into createPatch, which
|
||||||
<li>
|
optionally synchronises ("couples") points and faces of coupled (cyclic,
|
||||||
Built in support for the Intel C++ 10.? compiler (untested).
|
processor) patches.
|
||||||
</li>
|
* New applyBoundaryLayer pre-processing utility to apply 1/7th power-law
|
||||||
<li>
|
boundary layers at walls, starting from uniform or potential flow
|
||||||
The choice of the compiler is controlled by the setting of the $WM_COMPILER
|
solutions.
|
||||||
and $WM_COMPILER_ARCH environment variables in the OpenFOAM-1.5/etc/bashrc
|
* New execFlowFunctionObjects utility executes functionObjects as a
|
||||||
(or cshrc) file.
|
post-processing activity, e.g. probes, sampling, force calculation.
|
||||||
</li>
|
* New changeDictionary utility makes batch changes to OpenFOAM input files,
|
||||||
<li>
|
e.g. to change boundary conditions of field files.
|
||||||
The location of the installation of the compiler is controlled by the
|
* New foamCalc utility, a generic post-processing field calculator tool
|
||||||
$WM_COMPILER_INST environment variable in the OpenFOAM-1.5/etc/settings.sh
|
* New molConfig pre-processing utility for molecular dynamics cases. Fills
|
||||||
(or settings.csh) file.
|
zones of a mesh with single crystal lattices of specified structure,
|
||||||
|
density, orientation, alignment and temperature.
|
||||||
|
* Extended splitMeshRegions utility to split multi-zone meshes, e.g. defined
|
||||||
|
through cellZones, into separate meshes.
|
||||||
|
* Extended the foamToVTK, decomposePar, reconstructPar and mapFields
|
||||||
|
utilities to include support for multiple particle clouds in parallel
|
||||||
|
processing.
|
||||||
|
|
||||||
</li>
|
7 Migration from ParaView 2.4 to ParaView 3.x
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
* Rewritten OpenFOAM Reader Module for version 3, a major redesign of
|
||||||
|
ParaView.
|
||||||
|
* New features include viewing patch names, reading of Lagrangian data,
|
||||||
|
handling of cell, face and point sets, multiple views.
|
||||||
|
|
||||||
<div id="outline-container-4" class="outline-2">
|
8 Model development
|
||||||
<h2 id="sec-4">4 Developments to solvers (applications)</h2>
|
|
||||||
<div id="text-4">
|
|
||||||
|
|
||||||
<ul>
|
* Overhauled the lagrangian library to support multiple clouds.
|
||||||
<li>
|
* New lagrangianIntermediate library incorporating a hierarchy of parcel and
|
||||||
New rhoCentralFoam solver for high-speed, viscous, compressible flows using
|
cloud types, accommodating kinematic, thermodynamic and reacting
|
||||||
non-oscillatory, central-upwind schemes.
|
applications, including coupling to the new radiation library. Sub-models
|
||||||
</li>
|
are added at the relevant level of physics, e.g.:
|
||||||
<li>
|
+ kinematic: injection, wall interaction, drag, dispersion;
|
||||||
New interDyMFoam solver for 2 incompressible, isothermal, immiscible fluids
|
+ thermo: heat transfer;
|
||||||
using a VoF phase-fraction based interface capturing approach, with optional
|
+ reacting: reacting composition, mass transfer, surface reactions.
|
||||||
mesh motion and mesh topology changes including adaptive mesh
|
* New single rotating frame of reference (SRF) library for rotating flow
|
||||||
(un)refinement. Useful for simulations such as tank filling, sloshing ---
|
applications, e.g. turbo-machinery.
|
||||||
using solid body motion e.g. SDA or SKA (6DoF) — and slamming (using the
|
* New radiation library including the P1 model and associated Marshak
|
||||||
mesh motion solver) and other large-scale applications that benefit from the
|
boundary conditions for incident radiation.
|
||||||
efficiency gain of adaptive mesh (un)refinement of the interface.
|
* New displacementInterpolation motion solver for flexible mesh scaling.
|
||||||
</li>
|
* New molecularDynamics Lagrangian library to calculate intermolecular
|
||||||
<li>
|
forces between spherically symmetrical monatomic species in arbitrary
|
||||||
New compressibleInterFoam solver for 2 compressible, isothermal, immiscible
|
geometries.
|
||||||
fluids using a volume of fluid (VoF) phase-fraction approach for
|
|
||||||
interface-capturing. The momentum and other fluid properties are of the
|
|
||||||
"mixture" and a single momentum equation is solved. Turbulence is modelled
|
|
||||||
using a run-time selectable incompressible LES model.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New interPhaseChangeFoam solver for 2 incompressible, isothermal, immiscible
|
|
||||||
fluids with phase-change, e.g. cavitation. Uses VoF interface capturing,
|
|
||||||
with momentum and other fluid properties described for the ``mixture'' and a
|
|
||||||
single momentum equation is solved. The set of phase-change models provided
|
|
||||||
are designed to simulate cavitation but other mechanisms of phase-change are
|
|
||||||
supported within this solver framework.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New rasCavitatingFoam solver for transient cavitation using a barotropic
|
|
||||||
compressibility model, with RAS turbulence.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New lesCavitatingFoam solver for transient cavitation using a barotropic
|
|
||||||
compressibility model, with LES turbulence.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New chtMultiRegionFoam solver that couples conjugate heat transfer in a
|
|
||||||
solid to a buoyancy-driven flow simulation.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New PDRFoam solver for compressible premixed/partially-premixed turbulent
|
|
||||||
combustion that includes porosity/distributed resistance (PDR) modelling to
|
|
||||||
handle regions containing solid blockages which cannot be resolved by the
|
|
||||||
mesh. Requires the PDR fields.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New lesBuoyantFoam solver for transient, buoyant, turbulent flow of
|
|
||||||
compressible fluids for ventilation and heat-transfer. Turbulence is
|
|
||||||
modelled using a run-time selectable compressible LES model.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New rhoPimpleFoam solver for transient, turbulent flow of compressible
|
|
||||||
fluids for ventilation and heat-transfer. Uses the flexible PIMPLE
|
|
||||||
(PISO-SIMPLE) solution for time-resolved and pseudo-transient simulations.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New buoyantSimpleRadiationFoam solver for steady-state, buoyant, turbulent
|
|
||||||
flow of compressible fluids with radiation, for ventilation and
|
|
||||||
heat-transfer.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New rhoTurbTwinParcelFoam solver for transient for compressible, turbulent
|
|
||||||
flow with two thermo-clouds.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New gnemdFOAM solver for general purpose molecular dynamics that simulates
|
|
||||||
atoms in arbitrary shaped domains and average atomic/molecular quantities to
|
|
||||||
the mesh to create field data.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New mdEqulibrationFoam solver to equilibrates and/or preconditions molecular
|
|
||||||
dynamics systems.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Demonstration SRFSimpleFoam solver based on simpleFoam that incorporates the
|
|
||||||
SRF extensions (see below) for rotating flows.
|
|
||||||
|
|
||||||
</li>
|
9 New functionObjects
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
To aid common monitoring and post-processing activities.
|
||||||
|
|
||||||
<div id="outline-container-5" class="outline-2">
|
* forces: calculate the force and moment on a patch or set of patches, e.g.
|
||||||
<h2 id="sec-5">5 Automatic mesher</h2>
|
to calculate the lift, drag and moment of an object in the flow.
|
||||||
<div id="text-5">
|
* forceCoeffs: calculate the normalised force and moment on a patch or set
|
||||||
|
of patches, e.g. to calculate the lift, drag and moment coefficients of an
|
||||||
|
object in the flow.
|
||||||
|
* fieldAverage: calculate field arithmetic mean and prime-squared averages
|
||||||
|
for a list of fields.
|
||||||
|
* foamCalcFunctions: calculate field components, div, mag, magGrad or
|
||||||
|
magSqr.
|
||||||
|
|
||||||
<p>New snappyHexMesh utility that generates split-hex meshes automatically from
|
10 Improvements to boundary conditions
|
||||||
triangulated (STL) surface geometries. The mesh approximately conforms to
|
|
||||||
the surface by iteratively refining a starting mesh and morphing the
|
|
||||||
resulting split-hex mesh to the surface. An optional phase will shrink back
|
|
||||||
the resulting mesh and insert cell layers. It has a flexible specification
|
|
||||||
of mesh refinement level and robust surface handling with a pre-specified
|
|
||||||
final mesh quality. It runs in parallel with a load balancing step every
|
|
||||||
iteration.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
* Generalised jumpCyclic type: cyclic condition with an additional
|
||||||
|
prescribed jump in value.
|
||||||
|
* fan type: specialisation of jumpCyclic, applying a prescribed jump in
|
||||||
|
pressure to simulate a fan within a mesh.
|
||||||
|
* Generalised advective outflow boundary condition based on solving D/Dt
|
||||||
|
(psi, U) = 0 at the boundary.
|
||||||
|
* Additional turbulent flow inlet to specify mixing length and frequency.
|
||||||
|
* Generalisation of time varying set of boundary conditions.
|
||||||
|
|
||||||
<div id="outline-container-6" class="outline-2">
|
11 Other
|
||||||
<h2 id="sec-6">6 Developments to utilities</h2>
|
|
||||||
<div id="text-6">
|
|
||||||
|
|
||||||
<ul>
|
* New argument-free command execution, e.g typing "icoFoam" without root and
|
||||||
<li>
|
case directory arguments.
|
||||||
New extrude2DMesh utility that extrudes 2D meshes into a 3D mesh. 2D meshes
|
* Extended time command line options.
|
||||||
are described by faces with 2 points, so can be used in combination with 2D
|
* Many enhancements to dictionary including macro substitution, optional
|
||||||
meshes converted with ccm26ToFoam.
|
merging and default/overwrite behaviour, enhanced "#include" file handling
|
||||||
</li>
|
and the framework to support function evaluation.
|
||||||
<li>
|
* Cross-links between applications and Doxygen documentation with the "-doc"
|
||||||
New couplePatches functionality integrated into createPatch, which
|
argument.
|
||||||
optionally synchronises ("couples") points and faces of coupled (cyclic,
|
* Non-blocking, non-buffered, parallel transfers with potential scaling
|
||||||
processor) patches.
|
benefits for larger number of processors.
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New applyBoundaryLayer pre-processing utility to apply 1/7th power-law
|
|
||||||
boundary layers at walls, starting from uniform or potential flow solutions.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New execFlowFunctionObjects utility executes functionObjects as a
|
|
||||||
post-processing activity, e.g. probes, sampling, force calculation.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New changeDictionary utility makes batch changes to OpenFOAM input files,
|
|
||||||
e.g. to change boundary conditions of field files.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New foamCalc utility, a generic post-processing field calculator tool
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New molConfig pre-processing utility for molecular dynamics cases. Fills
|
|
||||||
zones of a mesh with single crystal lattices of specified structure,
|
|
||||||
density, orientation, alignment and temperature.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Extended splitMeshRegions utility to split multi-zone meshes, e.g. defined
|
|
||||||
through cellZones, into separate meshes.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Extended the foamToVTK, decomposePar, reconstructPar and mapFields utilities
|
|
||||||
to include support for multiple particle clouds in parallel processing.
|
|
||||||
|
|
||||||
</li>
|
Date: 26 August 2008
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
HTML generated by org-mode 6.06b in emacs 23
|
||||||
|
|
||||||
<div id="outline-container-7" class="outline-2">
|
|
||||||
<h2 id="sec-7">7 Migration from ParaView 2.4 to ParaView 3.x</h2>
|
|
||||||
<div id="text-7">
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
Rewritten OpenFOAM Reader Module for version 3, a major redesign of
|
|
||||||
ParaView.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New features include viewing patch names, reading of Lagrangian data,
|
|
||||||
handling of cell, face and point sets, multiple views.
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="outline-container-8" class="outline-2">
|
|
||||||
<h2 id="sec-8">8 Model development</h2>
|
|
||||||
<div id="text-8">
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
Overhauled the lagrangian library to support multiple clouds.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New lagrangianIntermediate library incorporating a hierarchy of parcel and
|
|
||||||
cloud types, accommodating kinematic, thermodynamic and reacting
|
|
||||||
applications, including coupling to the new radiation library. Sub-models
|
|
||||||
are added at the relevant level of physics, e.g.:
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
kinematic: injection, wall interaction, drag, dispersion;
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
thermo: heat transfer;
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
reacting: reacting composition, mass transfer, surface reactions.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New single rotating frame of reference (SRF) library for rotating flow
|
|
||||||
applications, e.g. turbo-machinery.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New radiation library including the P1 model and associated Marshak boundary
|
|
||||||
conditions for incident radiation.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New displacementInterpolation motion solver for flexible mesh scaling.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
New molecularDynamics Lagrangian library to calculate intermolecular forces
|
|
||||||
between spherically symmetrical monatomic species in arbitrary geometries.
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="outline-container-9" class="outline-2">
|
|
||||||
<h2 id="sec-9">9 New functionObjects</h2>
|
|
||||||
<div id="text-9">
|
|
||||||
|
|
||||||
<p>To aid common monitoring and post-processing activities.
|
|
||||||
</p><ul>
|
|
||||||
<li>
|
|
||||||
forces: calculate the force and moment on a patch or set of patches, e.g. to
|
|
||||||
calculate the lift, drag and moment of an object in the flow.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
forceCoeffs: calculate the normalised force and moment on a patch or set of
|
|
||||||
patches, e.g. to calculate the lift, drag and moment coefficients of an
|
|
||||||
object in the flow.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
fieldAverage: calculate field arithmetic mean and prime-squared averages for
|
|
||||||
a list of fields.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
foamCalcFunctions: calculate field components, div, mag, magGrad or magSqr.
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="outline-container-10" class="outline-2">
|
|
||||||
<h2 id="sec-10">10 Improvements to boundary conditions</h2>
|
|
||||||
<div id="text-10">
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
Generalised jumpCyclic type: cyclic condition with an additional prescribed
|
|
||||||
jump in value.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
fan type: specialisation of jumpCyclic, applying a prescribed jump in
|
|
||||||
pressure to simulate a fan within a mesh.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Generalised advective outflow boundary condition based on solving D/Dt(psi,
|
|
||||||
U) = 0 at the boundary.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Additional turbulent flow inlet to specify mixing length and frequency.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Generalisation of time varying set of boundary conditions.
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="outline-container-11" class="outline-2">
|
|
||||||
<h2 id="sec-11">11 Other</h2>
|
|
||||||
<div id="text-11">
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
New argument-free command execution, e.g typing "icoFoam" without root and
|
|
||||||
case directory arguments.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Extended time command line options.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Many enhancements to dictionary including macro substitution, optional
|
|
||||||
merging and default/overwrite behaviour, enhanced "#include" file handling
|
|
||||||
and the framework to support function evaluation.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Cross-links between applications and Doxygen documentation with the "-doc"
|
|
||||||
argument.
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Non-blocking, non-buffered, parallel transfers with potential scaling
|
|
||||||
benefits for larger number of processors.
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="postamble"><p class="date"> Date: 14 July 2008</p>
|
|
||||||
<p>HTML generated by org-mode 6.05a in emacs 23<p>
|
|
||||||
</div></body>
|
|
||||||
</html>
|
|
||||||
|
|||||||
@ -0,0 +1,3 @@
|
|||||||
|
kinematicParcelFoam.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/kinematicParcelFoam
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels/RAS
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-llagrangian \
|
||||||
|
-llagrangianIntermediate \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lmeshTools \
|
||||||
|
-lthermophysicalFunctions \
|
||||||
|
-lbasicThermophysicalModels \
|
||||||
|
/* -lcombustionThermophysicalModels */ \
|
||||||
|
-lspecie \
|
||||||
|
-lradiation \
|
||||||
|
-lcompressibleRASModels
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
Info<< "Reading thermophysical properties\n" << endl;
|
||||||
|
|
||||||
|
autoPtr<basicThermo> thermo
|
||||||
|
(
|
||||||
|
basicThermo::New(mesh)
|
||||||
|
);
|
||||||
|
|
||||||
|
volScalarField rho
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"rho",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
thermo->rho()
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< "\nReading field U\n" << endl;
|
||||||
|
volVectorField U
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"U",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
# include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
|
autoPtr<compressible::RASModel> turbulence
|
||||||
|
(
|
||||||
|
compressible::RASModel::New
|
||||||
|
(
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
phi,
|
||||||
|
thermo()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
pointMesh pMesh(mesh);
|
||||||
|
volPointInterpolation vpi(mesh, pMesh);
|
||||||
|
|
||||||
|
word kinematicCloudName("kinematicCloud");
|
||||||
|
|
||||||
|
if (args.options().found("cloudName"))
|
||||||
|
{
|
||||||
|
kinematicCloudName = args.options()["cloudName"];
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
|
basicKinematicCloud kinematicCloud
|
||||||
|
(
|
||||||
|
kinematicCloudName,
|
||||||
|
vpi,
|
||||||
|
rho,
|
||||||
|
U,
|
||||||
|
thermo().mu(),
|
||||||
|
g
|
||||||
|
);
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Application
|
||||||
|
kinematicParcelFoam
|
||||||
|
|
||||||
|
Description
|
||||||
|
Transient solver a single kinematicCloud.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "fvCFD.H"
|
||||||
|
#include "basicThermo.H"
|
||||||
|
#include "compressible/RASModel/RASModel.H"
|
||||||
|
#include "basicKinematicCloud.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
argList::validOptions.insert("cloudName", "cloud name");
|
||||||
|
|
||||||
|
#include "setRootCase.H"
|
||||||
|
#include "createTime.H"
|
||||||
|
#include "createMesh.H"
|
||||||
|
#include "readEnvironmentalProperties.H"
|
||||||
|
#include "createFields.H"
|
||||||
|
#include "compressibleCourantNo.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
|
while (runTime.run())
|
||||||
|
{
|
||||||
|
runTime++;
|
||||||
|
|
||||||
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
|
Info<< "Evolving " << kinematicCloud.name() << endl;
|
||||||
|
kinematicCloud.evolve();
|
||||||
|
kinematicCloud.info();
|
||||||
|
|
||||||
|
runTime.write();
|
||||||
|
|
||||||
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||||
|
<< nl << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -5,7 +5,7 @@
|
|||||||
- fvm::Sp(fvc::div(phi), h)
|
- fvm::Sp(fvc::div(phi), h)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||||
==
|
==
|
||||||
fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p, "div(U,p)"))
|
fvc::div(phi/fvc::interpolate(rho), p, "div(U,p)")
|
||||||
- p*fvc::div(phi/fvc::interpolate(rho))
|
- p*fvc::div(phi/fvc::interpolate(rho))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -1,40 +1,92 @@
|
|||||||
volScalarField AU = UEqn().A();
|
rho = thermo->rho();
|
||||||
U = UEqn().H()/AU;
|
|
||||||
UEqn.clear();
|
|
||||||
phi = fvc::interpolate(rho*U) & mesh.Sf();
|
|
||||||
bool closedVolume = adjustPhi(phi, U, p);
|
|
||||||
|
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
volScalarField rUA = 1.0/UEqn().A();
|
||||||
|
U = rUA*UEqn().H();
|
||||||
|
UEqn.clear();
|
||||||
|
|
||||||
|
bool closedVolume = false;
|
||||||
|
|
||||||
|
if (transonic)
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
surfaceScalarField phid
|
||||||
(
|
(
|
||||||
fvm::laplacian(rho/AU, p) == fvc::div(phi)
|
"phid",
|
||||||
|
fvc::interpolate(thermo->psi())*(fvc::interpolate(U) & mesh.Sf())
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
// retain the residual from the first iteration
|
|
||||||
if (nonOrth == 0)
|
|
||||||
{
|
{
|
||||||
eqnResidual = pEqn.solve().initialResidual();
|
fvScalarMatrix pEqn
|
||||||
maxResidual = max(eqnResidual, maxResidual);
|
(
|
||||||
}
|
fvm::div(phid, p)
|
||||||
else
|
- fvm::laplacian(rho*rUA, p)
|
||||||
{
|
);
|
||||||
pEqn.solve();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nonOrth == nNonOrthCorr)
|
// Relax the pressure equation to ensure diagonal-dominance
|
||||||
{
|
pEqn.relax(mesh.relaxationFactor("pEqn"));
|
||||||
phi -= pEqn.flux();
|
|
||||||
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
|
// retain the residual from the first iteration
|
||||||
|
if (nonOrth == 0)
|
||||||
|
{
|
||||||
|
eqnResidual = pEqn.solve().initialResidual();
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pEqn.solve();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nonOrth == nNonOrthCorr)
|
||||||
|
{
|
||||||
|
phi == pEqn.flux();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
|
||||||
|
closedVolume = adjustPhi(phi, U, p);
|
||||||
|
|
||||||
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn
|
||||||
|
(
|
||||||
|
fvm::laplacian(rho*rUA, p) == fvc::div(phi)
|
||||||
|
);
|
||||||
|
|
||||||
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
|
// Retain the residual from the first iteration
|
||||||
|
if (nonOrth == 0)
|
||||||
|
{
|
||||||
|
eqnResidual = pEqn.solve().initialResidual();
|
||||||
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pEqn.solve();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nonOrth == nNonOrthCorr)
|
||||||
|
{
|
||||||
|
phi -= pEqn.flux();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "incompressible/continuityErrs.H"
|
#include "incompressible/continuityErrs.H"
|
||||||
|
|
||||||
// Explicitly relax pressure for momentum corrector
|
// Explicitly relax pressure for momentum corrector
|
||||||
p.relax();
|
p.relax();
|
||||||
|
|
||||||
U -= fvc::grad(p)/AU;
|
rho = thermo->rho();
|
||||||
|
rho.relax();
|
||||||
|
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;
|
||||||
|
|
||||||
|
U -= rUA*fvc::grad(p);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
|
||||||
bound(p, pMin);
|
bound(p, pMin);
|
||||||
@ -46,7 +98,3 @@ if (closedVolume)
|
|||||||
p += (initialMass - fvc::domainIntegrate(thermo->psi()*p))
|
p += (initialMass - fvc::domainIntegrate(thermo->psi()*p))
|
||||||
/fvc::domainIntegrate(thermo->psi());
|
/fvc::domainIntegrate(thermo->psi());
|
||||||
}
|
}
|
||||||
|
|
||||||
rho = thermo->rho();
|
|
||||||
rho.relax();
|
|
||||||
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;
|
|
||||||
|
|||||||
@ -84,6 +84,7 @@ $(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields
|
|||||||
$(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C
|
$(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/partialSlip/partialSlipFvPatchFields.C
|
$(derivedFvPatchFields)/partialSlip/partialSlipFvPatchFields.C
|
||||||
$(derivedFvPatchFields)/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C
|
||||||
|
$(derivedFvPatchFields)/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C
|
||||||
$(derivedFvPatchFields)/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C
|
$(derivedFvPatchFields)/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C
|
||||||
|
|||||||
@ -74,20 +74,10 @@ fluxCorrectedVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
zeroGradientFvPatchVectorField(p, iF),
|
zeroGradientFvPatchVectorField(p, iF),
|
||||||
phiName_("phi"),
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
rhoName_("rho")
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(patchInternalField());
|
fvPatchVectorField::operator=(patchInternalField());
|
||||||
|
|
||||||
if (dict.found("phi"))
|
|
||||||
{
|
|
||||||
dict.lookup("phi") >> phiName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dict.found("rho"))
|
|
||||||
{
|
|
||||||
dict.lookup("rho") >> rhoName_;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -118,10 +108,8 @@ void fluxCorrectedVelocityFvPatchVectorField::evaluate
|
|||||||
|
|
||||||
zeroGradientFvPatchVectorField::evaluate();
|
zeroGradientFvPatchVectorField::evaluate();
|
||||||
|
|
||||||
const surfaceScalarField& phi = db().lookupObject<surfaceScalarField>
|
const surfaceScalarField& phi =
|
||||||
(
|
db().lookupObject<surfaceScalarField>(phiName_);
|
||||||
phiName_
|
|
||||||
);
|
|
||||||
|
|
||||||
const fvsPatchField<scalar>& phip =
|
const fvsPatchField<scalar>& phip =
|
||||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||||
|
|||||||
@ -26,7 +26,10 @@ Class
|
|||||||
Foam::fluxCorrectedVelocityFvPatchVectorField
|
Foam::fluxCorrectedVelocityFvPatchVectorField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::fluxCorrectedVelocityFvPatchVectorField
|
Velocity outlet boundary condition for patches where the pressure is
|
||||||
|
specified. The outflow velocity is obtained by "zeroGradient" and then
|
||||||
|
corrected from the flux. If reverse flow is possible or expected use
|
||||||
|
the "pressureInletOutletVelocityFvPatchVectorField" BC instead.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
fluxCorrectedVelocityFvPatchVectorField.C
|
fluxCorrectedVelocityFvPatchVectorField.C
|
||||||
|
|||||||
@ -158,6 +158,22 @@ void inletOutletFvPatchField<Type>::write(Ostream& os) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void inletOutletFvPatchField<Type>::operator=
|
||||||
|
(
|
||||||
|
const fvPatchField<Type>& ptf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
fvPatchField<Type>::operator=
|
||||||
|
(
|
||||||
|
this->valueFraction()*this->refValue()
|
||||||
|
+ (1 - this->valueFraction())*ptf
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -134,6 +134,11 @@ public:
|
|||||||
|
|
||||||
//- Write
|
//- Write
|
||||||
virtual void write(Ostream&) const;
|
virtual void write(Ostream&) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member operators
|
||||||
|
|
||||||
|
virtual void operator=(const fvPatchField<Type>& pvf);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,8 @@ pressureDirectedInletOutletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchVectorField(p, iF),
|
mixedFvPatchVectorField(p, iF),
|
||||||
|
phiName_("phi"),
|
||||||
|
rhoName_("rho"),
|
||||||
inletDir_(p.size())
|
inletDir_(p.size())
|
||||||
{
|
{
|
||||||
refValue() = *this;
|
refValue() = *this;
|
||||||
@ -63,6 +65,8 @@ pressureDirectedInletOutletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchVectorField(ptf, p, iF, mapper),
|
mixedFvPatchVectorField(ptf, p, iF, mapper),
|
||||||
|
phiName_(ptf.phiName_),
|
||||||
|
rhoName_(ptf.rhoName_),
|
||||||
inletDir_(ptf.inletDir_, mapper)
|
inletDir_(ptf.inletDir_, mapper)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -76,6 +80,8 @@ pressureDirectedInletOutletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchVectorField(p, iF),
|
mixedFvPatchVectorField(p, iF),
|
||||||
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
inletDir_("inletDirection", dict, p.size())
|
inletDir_("inletDirection", dict, p.size())
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||||
@ -92,6 +98,8 @@ pressureDirectedInletOutletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchVectorField(pivpvf),
|
mixedFvPatchVectorField(pivpvf),
|
||||||
|
phiName_(pivpvf.phiName_),
|
||||||
|
rhoName_(pivpvf.rhoName_),
|
||||||
inletDir_(pivpvf.inletDir_)
|
inletDir_(pivpvf.inletDir_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -104,6 +112,8 @@ pressureDirectedInletOutletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchVectorField(pivpvf, iF),
|
mixedFvPatchVectorField(pivpvf, iF),
|
||||||
|
phiName_(pivpvf.phiName_),
|
||||||
|
rhoName_(pivpvf.rhoName_),
|
||||||
inletDir_(pivpvf.inletDir_)
|
inletDir_(pivpvf.inletDir_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -129,7 +139,8 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::rmap
|
|||||||
mixedFvPatchVectorField::rmap(ptf, addr);
|
mixedFvPatchVectorField::rmap(ptf, addr);
|
||||||
|
|
||||||
const pressureDirectedInletOutletVelocityFvPatchVectorField& tiptf =
|
const pressureDirectedInletOutletVelocityFvPatchVectorField& tiptf =
|
||||||
refCast<const pressureDirectedInletOutletVelocityFvPatchVectorField>(ptf);
|
refCast<const pressureDirectedInletOutletVelocityFvPatchVectorField>
|
||||||
|
(ptf);
|
||||||
|
|
||||||
inletDir_.rmap(tiptf.inletDir_, addr);
|
inletDir_.rmap(tiptf.inletDir_, addr);
|
||||||
}
|
}
|
||||||
@ -143,7 +154,7 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const surfaceScalarField& phi =
|
const surfaceScalarField& phi =
|
||||||
db().lookupObject<surfaceScalarField>("phi");
|
db().lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
|
||||||
const fvsPatchField<scalar>& phip =
|
const fvsPatchField<scalar>& phip =
|
||||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||||
@ -158,7 +169,7 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||||
{
|
{
|
||||||
const fvPatchField<scalar>& rhop =
|
const fvPatchField<scalar>& rhop =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("rho");
|
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||||
|
|
||||||
refValue() = inletDir_*phip/(rhop*ndmagS);
|
refValue() = inletDir_*phip/(rhop*ndmagS);
|
||||||
}
|
}
|
||||||
@ -185,11 +196,28 @@ void pressureDirectedInletOutletVelocityFvPatchVectorField::
|
|||||||
write(Ostream& os) const
|
write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchVectorField::write(os);
|
fvPatchVectorField::write(os);
|
||||||
|
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
|
||||||
inletDir_.writeEntry("inletDirection", os);
|
inletDir_.writeEntry("inletDirection", os);
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void pressureDirectedInletOutletVelocityFvPatchVectorField::operator=
|
||||||
|
(
|
||||||
|
const fvPatchField<vector>& pvf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
fvPatchField<vector>::operator=
|
||||||
|
(
|
||||||
|
valueFraction()*(inletDir_*(inletDir_ & pvf))
|
||||||
|
+ (1 - valueFraction())*pvf
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeField
|
makePatchTypeField
|
||||||
|
|||||||
@ -26,7 +26,10 @@ Class
|
|||||||
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
|
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
|
Velocity inlet/outlet boundary condition for pressure boundary where the
|
||||||
|
pressure is specified. zero-gradient is applied for outflow (as defined
|
||||||
|
by the flux) and for inflow the velocity is obtained from the flux with
|
||||||
|
the specified `inletDirection'.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
pressureDirectedInletOutletVelocityFvPatchVectorField.C
|
pressureDirectedInletOutletVelocityFvPatchVectorField.C
|
||||||
@ -53,7 +56,9 @@ class pressureDirectedInletOutletVelocityFvPatchVectorField
|
|||||||
public mixedFvPatchVectorField
|
public mixedFvPatchVectorField
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
word phiName_;
|
||||||
|
word rhoName_;
|
||||||
vectorField inletDir_;
|
vectorField inletDir_;
|
||||||
|
|
||||||
|
|
||||||
@ -133,9 +138,35 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return the name of rho
|
||||||
|
const word& rhoName() const
|
||||||
|
{
|
||||||
|
return rhoName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the name of rho to allow adjustment
|
||||||
|
word& rhoName()
|
||||||
|
{
|
||||||
|
return rhoName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the name of phi
|
||||||
|
const word& phiName() const
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the name of phi to allow adjustment
|
||||||
|
word& phiName()
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Mapping functions
|
// Mapping functions
|
||||||
|
|
||||||
//- Map (and resize as needed) from self given a mapping object
|
//- Map (and resize as needed) from self given a mapping object
|
||||||
@ -157,6 +188,11 @@ public:
|
|||||||
|
|
||||||
//- Write
|
//- Write
|
||||||
virtual void write(Ostream&) const;
|
virtual void write(Ostream&) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member operators
|
||||||
|
|
||||||
|
virtual void operator=(const fvPatchField<vector>& pvf);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -45,6 +45,8 @@ pressureDirectedInletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(p, iF),
|
fixedValueFvPatchVectorField(p, iF),
|
||||||
|
phiName_("phi"),
|
||||||
|
rhoName_("rho"),
|
||||||
inletDir_(p.size())
|
inletDir_(p.size())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -59,6 +61,8 @@ pressureDirectedInletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
|
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
|
||||||
|
phiName_(ptf.phiName_),
|
||||||
|
rhoName_(ptf.rhoName_),
|
||||||
inletDir_(ptf.inletDir_, mapper)
|
inletDir_(ptf.inletDir_, mapper)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -72,6 +76,8 @@ pressureDirectedInletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(p, iF),
|
fixedValueFvPatchVectorField(p, iF),
|
||||||
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
inletDir_("inletDirection", dict, p.size())
|
inletDir_("inletDirection", dict, p.size())
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||||
@ -85,6 +91,8 @@ pressureDirectedInletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(pivpvf),
|
fixedValueFvPatchVectorField(pivpvf),
|
||||||
|
phiName_(pivpvf.phiName_),
|
||||||
|
rhoName_(pivpvf.rhoName_),
|
||||||
inletDir_(pivpvf.inletDir_)
|
inletDir_(pivpvf.inletDir_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -97,6 +105,8 @@ pressureDirectedInletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(pivpvf, iF),
|
fixedValueFvPatchVectorField(pivpvf, iF),
|
||||||
|
phiName_(pivpvf.phiName_),
|
||||||
|
rhoName_(pivpvf.rhoName_),
|
||||||
inletDir_(pivpvf.inletDir_)
|
inletDir_(pivpvf.inletDir_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -135,8 +145,8 @@ void pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const surfaceScalarField& phi =
|
const surfaceScalarField& phi =
|
||||||
db().lookupObject<surfaceScalarField>("phi");
|
db().lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
|
||||||
const fvsPatchField<scalar>& phip =
|
const fvsPatchField<scalar>& phip =
|
||||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||||
@ -151,7 +161,7 @@ void pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||||
{
|
{
|
||||||
const fvPatchField<scalar>& rhop =
|
const fvPatchField<scalar>& rhop =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("rho");
|
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||||
|
|
||||||
operator==(inletDir_*phip/(rhop*ndmagS));
|
operator==(inletDir_*phip/(rhop*ndmagS));
|
||||||
}
|
}
|
||||||
@ -174,11 +184,24 @@ void pressureDirectedInletVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
void pressureDirectedInletVelocityFvPatchVectorField::write(Ostream& os) const
|
void pressureDirectedInletVelocityFvPatchVectorField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchVectorField::write(os);
|
fvPatchVectorField::write(os);
|
||||||
|
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
|
||||||
inletDir_.writeEntry("inletDirection", os);
|
inletDir_.writeEntry("inletDirection", os);
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void pressureDirectedInletVelocityFvPatchVectorField::operator=
|
||||||
|
(
|
||||||
|
const fvPatchField<vector>& pvf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
fvPatchField<vector>::operator=(inletDir_*(inletDir_ & pvf));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeField
|
makePatchTypeField
|
||||||
|
|||||||
@ -23,10 +23,14 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Class
|
Class
|
||||||
Foam::pressureDirectedInletVelocityFvPatchVectorField
|
Foam::pressureDirectedInletVelocityFvPatchVectorField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
|
Velocity inlet boundary condition for patches where the pressure is
|
||||||
|
specified. The inflow velocity is obtained from the flux with the
|
||||||
|
specified "inletDirection" direction. If reverse flow is possible or
|
||||||
|
expected use the "pressureDirectedInletOutletVelocityFvPatchVectorField"
|
||||||
|
BC instead.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
pressureDirectedInletVelocityFvPatchVectorField.C
|
pressureDirectedInletVelocityFvPatchVectorField.C
|
||||||
@ -53,7 +57,9 @@ class pressureDirectedInletVelocityFvPatchVectorField
|
|||||||
public fixedValueFvPatchVectorField
|
public fixedValueFvPatchVectorField
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
word phiName_;
|
||||||
|
word rhoName_;
|
||||||
vectorField inletDir_;
|
vectorField inletDir_;
|
||||||
|
|
||||||
|
|
||||||
@ -130,9 +136,35 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return the name of rho
|
||||||
|
const word& rhoName() const
|
||||||
|
{
|
||||||
|
return rhoName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the name of rho to allow adjustment
|
||||||
|
word& rhoName()
|
||||||
|
{
|
||||||
|
return rhoName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the name of phi
|
||||||
|
const word& phiName() const
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the name of phi to allow adjustment
|
||||||
|
word& phiName()
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Mapping functions
|
// Mapping functions
|
||||||
|
|
||||||
//- Map (and resize as needed) from self given a mapping object
|
//- Map (and resize as needed) from self given a mapping object
|
||||||
@ -154,6 +186,11 @@ public:
|
|||||||
|
|
||||||
//- Write
|
//- Write
|
||||||
virtual void write(Ostream&) const;
|
virtual void write(Ostream&) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member operators
|
||||||
|
|
||||||
|
virtual void operator=(const fvPatchField<vector>& pvf);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,10 @@ Class
|
|||||||
Foam::pressureInletOutletVelocityFvPatchVectorField
|
Foam::pressureInletOutletVelocityFvPatchVectorField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::pressureInletOutletVelocityFvPatchVectorField
|
Velocity inlet/outlet boundary condition patches for where the pressure is
|
||||||
|
specified. zero-gradient is applied for outflow (as defined by the flux)
|
||||||
|
and for inflow the velocity is obtained from the patch-face normal
|
||||||
|
component of the internal-cell value.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
pressureInletOutletVelocityFvPatchVectorField.C
|
pressureInletOutletVelocityFvPatchVectorField.C
|
||||||
|
|||||||
@ -108,6 +108,17 @@ void pressureInletUniformVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void pressureInletUniformVelocityFvPatchVectorField::operator=
|
||||||
|
(
|
||||||
|
const fvPatchField<vector>& pvf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
operator==(patch().nf()*sum(patch().Sf() & pvf)/sum(patch().magSf()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeField
|
makePatchTypeField
|
||||||
|
|||||||
@ -26,7 +26,9 @@ Class
|
|||||||
Foam::pressureInletUniformVelocityFvPatchVectorField
|
Foam::pressureInletUniformVelocityFvPatchVectorField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::pressureInletUniformVelocityFvPatchVectorField
|
Velocity inlet boundary condition for patches where the pressure is
|
||||||
|
specified. The uniform inflow velocity is obtained by averaging the flux
|
||||||
|
over the patch and apply it in the direction normal to the patch faces.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
pressureInletUniformVelocityFvPatchVectorField.C
|
pressureInletUniformVelocityFvPatchVectorField.C
|
||||||
@ -124,6 +126,11 @@ public:
|
|||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the coefficients associated with the patch field
|
||||||
virtual void updateCoeffs();
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
|
|
||||||
|
// Member operators
|
||||||
|
|
||||||
|
virtual void operator=(const fvPatchField<vector>& pvf);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -70,20 +70,10 @@ pressureInletVelocityFvPatchVectorField::pressureInletVelocityFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(p, iF),
|
fixedValueFvPatchVectorField(p, iF),
|
||||||
phiName_("phi"),
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
rhoName_("rho")
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||||
|
|
||||||
if (dict.found("phi"))
|
|
||||||
{
|
|
||||||
dict.lookup("phi") >> phiName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dict.found("rho"))
|
|
||||||
{
|
|
||||||
dict.lookup("rho") >> rhoName_;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -164,6 +154,17 @@ void pressureInletVelocityFvPatchVectorField::write(Ostream& os) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void pressureInletVelocityFvPatchVectorField::operator=
|
||||||
|
(
|
||||||
|
const fvPatchField<vector>& pvf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
fvPatchField<vector>::operator=(patch().nf()*(patch().nf() & pvf));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeField
|
makePatchTypeField
|
||||||
|
|||||||
@ -26,7 +26,10 @@ Class
|
|||||||
Foam::pressureInletVelocityFvPatchVectorField
|
Foam::pressureInletVelocityFvPatchVectorField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::pressureInletVelocityFvPatchVectorField
|
Velocity inlet boundary condition for patches where the pressure is
|
||||||
|
specified. The inflow velocity is obtained from the flux with a direction
|
||||||
|
normal to the patch faces. If reverse flow is possible or expected use
|
||||||
|
the "pressureInletOutletVelocityFvPatchVectorField" BC instead.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
pressureInletVelocityFvPatchVectorField.C
|
pressureInletVelocityFvPatchVectorField.C
|
||||||
@ -57,6 +60,7 @@ class pressureInletVelocityFvPatchVectorField
|
|||||||
word phiName_;
|
word phiName_;
|
||||||
word rhoName_;
|
word rhoName_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -127,6 +131,33 @@ public:
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return the name of rho
|
||||||
|
const word& rhoName() const
|
||||||
|
{
|
||||||
|
return rhoName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the name of rho to allow adjustment
|
||||||
|
word& rhoName()
|
||||||
|
{
|
||||||
|
return rhoName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the name of phi
|
||||||
|
const word& phiName() const
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the name of phi to allow adjustment
|
||||||
|
word& phiName()
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the coefficients associated with the patch field
|
||||||
virtual void updateCoeffs();
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
@ -136,10 +167,7 @@ public:
|
|||||||
|
|
||||||
// Member operators
|
// Member operators
|
||||||
|
|
||||||
virtual void operator=(const fvPatchField<vector>& pvf)
|
virtual void operator=(const fvPatchField<vector>& pvf);
|
||||||
{
|
|
||||||
fvPatchField<vector>::operator=(pvf);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,201 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "pressureNormalInletOutletVelocityFvPatchVectorField.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "fvPatchFieldMapper.H"
|
||||||
|
#include "volFields.H"
|
||||||
|
#include "surfaceFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mixedFvPatchVectorField(p, iF),
|
||||||
|
phiName_("phi"),
|
||||||
|
rhoName_("rho")
|
||||||
|
{
|
||||||
|
refValue() = *this;
|
||||||
|
refGrad() = vector::zero;
|
||||||
|
valueFraction() = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const pressureNormalInletOutletVelocityFvPatchVectorField& ptf,
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
|
const fvPatchFieldMapper& mapper
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mixedFvPatchVectorField(ptf, p, iF, mapper),
|
||||||
|
phiName_(ptf.phiName_),
|
||||||
|
rhoName_(ptf.rhoName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mixedFvPatchVectorField(p, iF),
|
||||||
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
|
||||||
|
{
|
||||||
|
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||||
|
refValue() = *this;
|
||||||
|
refGrad() = vector::zero;
|
||||||
|
valueFraction() = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const pressureNormalInletOutletVelocityFvPatchVectorField& pivpvf
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mixedFvPatchVectorField(pivpvf),
|
||||||
|
phiName_(pivpvf.phiName_),
|
||||||
|
rhoName_(pivpvf.rhoName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const pressureNormalInletOutletVelocityFvPatchVectorField& pivpvf,
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mixedFvPatchVectorField(pivpvf, iF),
|
||||||
|
phiName_(pivpvf.phiName_),
|
||||||
|
rhoName_(pivpvf.rhoName_)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void pressureNormalInletOutletVelocityFvPatchVectorField::updateCoeffs()
|
||||||
|
{
|
||||||
|
if (updated())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const surfaceScalarField& phi =
|
||||||
|
db().lookupObject<surfaceScalarField>(phiName_);
|
||||||
|
|
||||||
|
const fvsPatchField<scalar>& phip =
|
||||||
|
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||||
|
|
||||||
|
vectorField n = patch().nf();
|
||||||
|
const Field<scalar>& magS = patch().magSf();
|
||||||
|
|
||||||
|
if (phi.dimensions() == dimVelocity*dimArea)
|
||||||
|
{
|
||||||
|
refValue() = n*phip/magS;
|
||||||
|
}
|
||||||
|
else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||||
|
{
|
||||||
|
const fvPatchField<scalar>& rhop =
|
||||||
|
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||||
|
|
||||||
|
refValue() = n*phip/(rhop*magS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"pressureNormalInletOutletVelocityFvPatchVectorField::"
|
||||||
|
"updateCoeffs()"
|
||||||
|
) << "dimensions of phi are not correct"
|
||||||
|
<< "\n on patch " << this->patch().name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
valueFraction() = 1.0 - pos(phip);
|
||||||
|
|
||||||
|
mixedFvPatchVectorField::updateCoeffs();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void pressureNormalInletOutletVelocityFvPatchVectorField::
|
||||||
|
write(Ostream& os) const
|
||||||
|
{
|
||||||
|
fvPatchVectorField::write(os);
|
||||||
|
os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl;
|
||||||
|
writeEntry("value", os);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void pressureNormalInletOutletVelocityFvPatchVectorField::operator=
|
||||||
|
(
|
||||||
|
const fvPatchField<vector>& pvf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
fvPatchField<vector>::operator=
|
||||||
|
(
|
||||||
|
valueFraction()*(patch().nf()*(patch().nf() & pvf))
|
||||||
|
+ (1 - valueFraction())*pvf
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
makePatchTypeField
|
||||||
|
(
|
||||||
|
fvPatchVectorField,
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
);
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,191 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
|
||||||
|
Description
|
||||||
|
Velocity inlet/outlet boundary condition for patches where the pressure is
|
||||||
|
specified. zero-gradient is applied for outflow (as defined by the flux)
|
||||||
|
and for inflow the velocity is obtained from the flux with a direction
|
||||||
|
normal to the patch faces.
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef pressureNormalInletOutletVelocityFvPatchVectorField_H
|
||||||
|
#define pressureNormalInletOutletVelocityFvPatchVectorField_H
|
||||||
|
|
||||||
|
#include "fvPatchFields.H"
|
||||||
|
#include "mixedFvPatchFields.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class pressureNormalInletOutletVelocityFvPatch Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
:
|
||||||
|
public mixedFvPatchVectorField
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
word phiName_;
|
||||||
|
word rhoName_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("pressureNormalInletOutletVelocity");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from patch and internal field
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct from patch, internal field and dictionary
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&,
|
||||||
|
const dictionary&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct by mapping given
|
||||||
|
// pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
// onto a new patch
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const pressureNormalInletOutletVelocityFvPatchVectorField&,
|
||||||
|
const fvPatch&,
|
||||||
|
const DimensionedField<vector, volMesh>&,
|
||||||
|
const fvPatchFieldMapper&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct as copy
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const pressureNormalInletOutletVelocityFvPatchVectorField&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone
|
||||||
|
virtual tmp<fvPatchVectorField> clone() const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchVectorField>
|
||||||
|
(
|
||||||
|
new pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
*this
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Construct as copy setting internal field reference
|
||||||
|
pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
const pressureNormalInletOutletVelocityFvPatchVectorField&,
|
||||||
|
const DimensionedField<vector, volMesh>&
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Construct and return a clone setting internal field reference
|
||||||
|
virtual tmp<fvPatchVectorField> clone
|
||||||
|
(
|
||||||
|
const DimensionedField<vector, volMesh>& iF
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
return tmp<fvPatchVectorField>
|
||||||
|
(
|
||||||
|
new pressureNormalInletOutletVelocityFvPatchVectorField
|
||||||
|
(
|
||||||
|
*this,
|
||||||
|
iF
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return the name of rho
|
||||||
|
const word& rhoName() const
|
||||||
|
{
|
||||||
|
return rhoName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return reference to the name of rho to allow adjustment
|
||||||
|
word& rhoName()
|
||||||
|
{
|
||||||
|
return rhoName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return the name of phi
|
||||||
|
const word& phiName() const
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Return reference to the name of phi to allow adjustment
|
||||||
|
word& phiName()
|
||||||
|
{
|
||||||
|
return phiName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//- Update the coefficients associated with the patch field
|
||||||
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
|
|
||||||
|
|
||||||
|
// Member operators
|
||||||
|
|
||||||
|
virtual void operator=(const fvPatchField<vector>& pvf);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -26,7 +26,10 @@ Class
|
|||||||
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField
|
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::rotatingPressureInletOutletVelocityFvPatchVectorField
|
Velocity inlet/outlet boundary condition in a rotating frame
|
||||||
|
for patches where the pressure is specified. zero-gradient is applied for
|
||||||
|
outflow (as defined by the flux) and for inflow the velocity is obtained
|
||||||
|
from the flux with a direction normal to the patch faces.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
rotatingPressureInletOutletVelocityFvPatchVectorField.C
|
rotatingPressureInletOutletVelocityFvPatchVectorField.C
|
||||||
|
|||||||
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "gaussConvectionScheme.H"
|
#include "gaussConvectionScheme.H"
|
||||||
|
|||||||
@ -50,7 +50,8 @@ Foam::Analytical<Type>::~Analytical()
|
|||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Type Foam::Analytical<Type>::integrate
|
typename Foam::IntegrationScheme<Type>::integrationResult
|
||||||
|
Foam::Analytical<Type>::integrate
|
||||||
(
|
(
|
||||||
const Type phi,
|
const Type phi,
|
||||||
const scalar dt,
|
const scalar dt,
|
||||||
@ -58,7 +59,11 @@ Type Foam::Analytical<Type>::integrate
|
|||||||
const scalar beta
|
const scalar beta
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return alpha + (phi - alpha)*exp(-beta*dt);
|
typename IntegrationScheme<Type>::integrationResult retValue;
|
||||||
|
retValue.average() = alpha + (phi - alpha)*(1 - exp(-beta*dt))/(beta*dt);
|
||||||
|
retValue.value() = alpha + (phi - alpha)*exp(-beta*dt);
|
||||||
|
|
||||||
|
return retValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Perform the integration
|
//- Perform the integration
|
||||||
virtual Type integrate
|
virtual typename IntegrationScheme<Type>::integrationResult integrate
|
||||||
(
|
(
|
||||||
const Type phi,
|
const Type phi,
|
||||||
const scalar dt,
|
const scalar dt,
|
||||||
|
|||||||
@ -50,7 +50,8 @@ Foam::Euler<Type>::~Euler()
|
|||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Type Foam::Euler<Type>::integrate
|
typename Foam::IntegrationScheme<Type>::integrationResult
|
||||||
|
Foam::Euler<Type>::integrate
|
||||||
(
|
(
|
||||||
const Type phi,
|
const Type phi,
|
||||||
const scalar dt,
|
const scalar dt,
|
||||||
@ -58,7 +59,11 @@ Type Foam::Euler<Type>::integrate
|
|||||||
const scalar beta
|
const scalar beta
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return (phi + dt*alpha)/(1.0 + dt/beta);
|
typename IntegrationScheme<Type>::integrationResult retValue;
|
||||||
|
retValue.value() = (phi + beta*dt*alpha)/(1.0 + beta*dt);
|
||||||
|
retValue.average() = 0.5*(phi + retValue.value());
|
||||||
|
|
||||||
|
return retValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Perform the integration
|
//- Perform the integration
|
||||||
virtual Type integrate
|
virtual typename IntegrationScheme<Type>::integrationResult integrate
|
||||||
(
|
(
|
||||||
const Type phi,
|
const Type phi,
|
||||||
const scalar dt,
|
const scalar dt,
|
||||||
|
|||||||
@ -53,6 +53,63 @@ namespace Foam
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
class IntegrationScheme
|
class IntegrationScheme
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Helper class to supply results of integration
|
||||||
|
class integrationResult
|
||||||
|
{
|
||||||
|
//- Integration value
|
||||||
|
Type value_;
|
||||||
|
|
||||||
|
//- Average value across integration step
|
||||||
|
Type average_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Constructor
|
||||||
|
integrationResult()
|
||||||
|
:
|
||||||
|
value_(pTraits<Type>::zero),
|
||||||
|
average_(pTraits<Type>::zero)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return const access to the value
|
||||||
|
Type value() const
|
||||||
|
{
|
||||||
|
return value_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return const access to the average
|
||||||
|
Type average() const
|
||||||
|
{
|
||||||
|
return average_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Edit
|
||||||
|
|
||||||
|
//- Return access to the value for changing
|
||||||
|
Type& value()
|
||||||
|
{
|
||||||
|
return value_;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- Return access to the average for changing
|
||||||
|
Type& average()
|
||||||
|
{
|
||||||
|
return average_;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Name of the Integration variable
|
//- Name of the Integration variable
|
||||||
@ -120,7 +177,7 @@ public:
|
|||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Perform the Integration
|
//- Perform the Integration
|
||||||
virtual Type integrate
|
virtual integrationResult integrate
|
||||||
(
|
(
|
||||||
const Type phi,
|
const Type phi,
|
||||||
const scalar dt,
|
const scalar dt,
|
||||||
@ -151,7 +208,7 @@ public:
|
|||||||
\
|
\
|
||||||
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
|
defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
|
||||||
\
|
\
|
||||||
IntegrationScheme<Type>::adddictionaryConstructorToTable<SS<Type> > \
|
IntegrationScheme<Type>::adddictionaryConstructorToTable<SS<Type> > \
|
||||||
add##SS##Type##ConstructorToTable_;
|
add##SS##Type##ConstructorToTable_;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -332,21 +332,11 @@ void Foam::KinematicCloud<ParcelType>::evolve()
|
|||||||
|
|
||||||
inject(td);
|
inject(td);
|
||||||
|
|
||||||
move(td);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
|
||||||
template<class TrackingData>
|
|
||||||
void Foam::KinematicCloud<ParcelType>::move
|
|
||||||
(
|
|
||||||
TrackingData& td
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (coupled_)
|
if (coupled_)
|
||||||
{
|
{
|
||||||
resetSourceTerms();
|
resetSourceTerms();
|
||||||
}
|
}
|
||||||
|
|
||||||
Cloud<ParcelType>::move(td);
|
Cloud<ParcelType>::move(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -109,7 +109,6 @@ private:
|
|||||||
|
|
||||||
//- References to the mesh and time databases
|
//- References to the mesh and time databases
|
||||||
const fvMesh& mesh_;
|
const fvMesh& mesh_;
|
||||||
// const Time& runTime_;
|
|
||||||
|
|
||||||
//- Reference to the interpolation for the carrier phase to the parcels
|
//- Reference to the interpolation for the carrier phase to the parcels
|
||||||
const volPointInterpolation& vpi_;
|
const volPointInterpolation& vpi_;
|
||||||
@ -257,19 +256,12 @@ protected:
|
|||||||
ParcelType* p
|
ParcelType* p
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Move the parcels
|
|
||||||
template<class TrackingData>
|
|
||||||
void move(TrackingData& td);
|
|
||||||
|
|
||||||
//- Post-injection checks
|
//- Post-injection checks
|
||||||
void postInjectCheck();
|
void postInjectCheck();
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
// TypeName("KinematicCloud");
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct given carrier gas fields
|
//- Construct given carrier gas fields
|
||||||
@ -284,9 +276,8 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
//- Destructor
|
||||||
|
virtual ~KinematicCloud();
|
||||||
virtual ~KinematicCloud();
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
@ -395,7 +386,6 @@ public:
|
|||||||
inline tmp<fvVectorMatrix> SU2(volVectorField& U) const;
|
inline tmp<fvVectorMatrix> SU2(volVectorField& U) const;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Check
|
// Check
|
||||||
|
|
||||||
//- Total mass injected
|
//- Total mass injected
|
||||||
@ -436,7 +426,7 @@ public:
|
|||||||
//- Reset the spray source terms
|
//- Reset the spray source terms
|
||||||
void resetSourceTerms();
|
void resetSourceTerms();
|
||||||
|
|
||||||
//- Evolve the spray (move, inject)
|
//- Evolve the spray (inject, inject)
|
||||||
void evolve();
|
void evolve();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -185,7 +185,12 @@ void Foam::ReactingCloud<ParcelType>::evolve()
|
|||||||
|
|
||||||
inject(td);
|
inject(td);
|
||||||
|
|
||||||
this->move(td);
|
if (this->coupled())
|
||||||
|
{
|
||||||
|
resetSourceTerms();
|
||||||
|
}
|
||||||
|
|
||||||
|
Cloud<ParcelType>::move(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -204,7 +204,7 @@ public:
|
|||||||
//- Reset the spray source terms
|
//- Reset the spray source terms
|
||||||
void resetSourceTerms();
|
void resetSourceTerms();
|
||||||
|
|
||||||
//- Evolve the spray (move, inject)
|
//- Evolve the spray (inject, move)
|
||||||
void evolve();
|
void evolve();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -176,7 +176,12 @@ void Foam::ThermoCloud<ParcelType>::evolve()
|
|||||||
|
|
||||||
inject(td);
|
inject(td);
|
||||||
|
|
||||||
this->move(td);
|
if (this->coupled())
|
||||||
|
{
|
||||||
|
resetSourceTerms();
|
||||||
|
}
|
||||||
|
|
||||||
|
Cloud<ParcelType>::move(td);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -209,11 +209,11 @@ public:
|
|||||||
|
|
||||||
// Cloud evolution functions
|
// Cloud evolution functions
|
||||||
|
|
||||||
//- Evolve the spray (move, inject)
|
|
||||||
void evolve();
|
|
||||||
|
|
||||||
//- Reset the spray source terms
|
//- Reset the spray source terms
|
||||||
void resetSourceTerms();
|
void resetSourceTerms();
|
||||||
|
|
||||||
|
//- Evolve the spray (inject, move)
|
||||||
|
void evolve();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -155,15 +155,16 @@ Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
|
|||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
// Update velocity - treat as 3-D
|
// Update velocity - treat as 3-D
|
||||||
const scalar bp = 1.0/(Cud + VSMALL);
|
const vector ap = Uc_ + (1 - rhoc_/rho_)/(Cud + VSMALL)*td.g();
|
||||||
const vector ap = Uc_/bp + rhoc_/rho_*td.g();
|
const scalar bp = Cud;
|
||||||
|
|
||||||
vector Unew = td.cloud().UIntegrator().integrate(U_, dt, ap, bp);
|
vector Unew = td.cloud().UIntegrator().integrate(U_, dt, ap, bp).value();
|
||||||
|
|
||||||
// Info<< "U_, Unew = " << U_ << ", " << Unew << endl;
|
// Info<< "U_, Unew = " << U_ << ", " << Unew << endl;
|
||||||
|
|
||||||
// Calculate the momentum transfer to the continuous phase
|
// Calculate the momentum transfer to the continuous phase
|
||||||
dUTrans = -mass()*(Unew - U_);
|
// - do not include gravity impulse
|
||||||
|
dUTrans = -mass()*(Unew - U_ - dt*td.g());
|
||||||
|
|
||||||
// Make corrections for 2-D cases
|
// Make corrections for 2-D cases
|
||||||
if (meshInfo.caseIs2d())
|
if (meshInfo.caseIs2d())
|
||||||
@ -233,13 +234,17 @@ bool Foam::KinematicParcel<ParcelType>::move
|
|||||||
// Update cell based properties
|
// Update cell based properties
|
||||||
p.updateCellQuantities(td, dt, celli);
|
p.updateCellQuantities(td, dt, celli);
|
||||||
|
|
||||||
if (td.cloud().coupled())
|
// Avoid problems with extremely small timesteps
|
||||||
|
if (dt > ROOTVSMALL)
|
||||||
{
|
{
|
||||||
p.calcCoupled(td, dt, celli);
|
if (td.cloud().coupled())
|
||||||
}
|
{
|
||||||
else
|
p.calcCoupled(td, dt, celli);
|
||||||
{
|
}
|
||||||
p.calcUncoupled(td, dt, celli);
|
else
|
||||||
|
{
|
||||||
|
p.calcUncoupled(td, dt, celli);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p.onBoundary() && td.keepParticle)
|
if (p.onBoundary() && td.keepParticle)
|
||||||
|
|||||||
@ -203,7 +203,7 @@ Foam::Ostream& Foam::operator<<
|
|||||||
os << static_cast<const Particle<ParcelType>& >(p);
|
os << static_cast<const Particle<ParcelType>& >(p);
|
||||||
os.write
|
os.write
|
||||||
(
|
(
|
||||||
reinterpret_cast<const char*>(p.typeId()),
|
reinterpret_cast<const char*>(&p.typeId_),
|
||||||
sizeof(p.typeId())
|
sizeof(p.typeId())
|
||||||
+ sizeof(p.d())
|
+ sizeof(p.d())
|
||||||
+ sizeof(p.U())
|
+ sizeof(p.U())
|
||||||
|
|||||||
@ -59,6 +59,164 @@ void Foam::ReactingParcel<ParcelType>::calcCoupled
|
|||||||
const scalar mass0 = this->mass();
|
const scalar mass0 = this->mass();
|
||||||
const scalar np0 = this->nParticle_;
|
const scalar np0 = this->nParticle_;
|
||||||
const scalar T0 = this->T_;
|
const scalar T0 = this->T_;
|
||||||
|
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Initialise transfer terms
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Momentum transfer from the particle to the carrier phase
|
||||||
|
vector dUTrans = vector::zero;
|
||||||
|
|
||||||
|
// Enthalpy transfer from the particle to the carrier phase
|
||||||
|
scalar dhTrans = 0.0;
|
||||||
|
|
||||||
|
// Mass transfer from particle to carrier phase
|
||||||
|
// - components exist in particle already
|
||||||
|
scalarList dMassMT(td.cloud().gases().size(), 0.0);
|
||||||
|
|
||||||
|
// Mass transfer due to surface reactions from particle to carrier phase
|
||||||
|
// - components do not necessarily exist in particle already
|
||||||
|
scalarList dMassSR(td.cloud().gases().size(), 0.0);
|
||||||
|
|
||||||
|
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Calculate velocity - update U
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
scalar Cud = 0.0;
|
||||||
|
const vector U1 = calcVelocity(td, dt, Cud, dUTrans);
|
||||||
|
|
||||||
|
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Calculate heat transfer - update T
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
scalar htc = 0.0;
|
||||||
|
scalar T1 = calcHeatTransfer(td, dt, celli, htc, dhTrans);
|
||||||
|
|
||||||
|
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Calculate mass transfer
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
calcMassTransfer(td, dt, T0, T1, dMassMT);
|
||||||
|
|
||||||
|
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Calculate surface reactions
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Initialise enthalpy retention to zero
|
||||||
|
scalar dhRet = 0.0;
|
||||||
|
|
||||||
|
calcSurfaceReactions(td, dt, celli, T0, T1, dMassMT, dMassSR, dhRet);
|
||||||
|
|
||||||
|
// New total mass
|
||||||
|
const scalar mass1 = mass0 - sum(dMassMT) - sum(dMassSR);
|
||||||
|
|
||||||
|
// Correct particle temperature to account for latent heat of
|
||||||
|
// devolatilisation
|
||||||
|
T1 -=
|
||||||
|
td.constProps().Ldevol()
|
||||||
|
*sum(dMassMT)
|
||||||
|
/(0.5*(mass0 + mass1)*this->cp_);
|
||||||
|
|
||||||
|
// Add retained enthalpy from surface reaction to particle and remove
|
||||||
|
// from gas
|
||||||
|
T1 += dhRet/(0.5*(mass0 + mass1)*this->cp_);
|
||||||
|
dhTrans -= dhRet;
|
||||||
|
|
||||||
|
// Correct dhTrans to account for enthalpy of evolved volatiles
|
||||||
|
dhTrans +=
|
||||||
|
sum(dMassMT)
|
||||||
|
*td.cloud().composition().HGas(YGas_, 0.5*(T0 + T1));
|
||||||
|
|
||||||
|
// Correct dhTrans to account for enthalpy of consumed solids
|
||||||
|
dhTrans +=
|
||||||
|
sum(dMassSR)
|
||||||
|
*td.cloud().composition().HSolid(YSolid_, 0.5*(T0 + T1));
|
||||||
|
|
||||||
|
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Accumulate source terms
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Transfer mass lost from particle to carrier mass source
|
||||||
|
forAll(dMassMT, i)
|
||||||
|
{
|
||||||
|
td.cloud().rhoTrans(i)[celli] += np0*(dMassMT[i] + dMassSR[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update momentum transfer
|
||||||
|
td.cloud().UTrans()[celli] += np0*dUTrans;
|
||||||
|
|
||||||
|
// Accumulate coefficient to be applied in carrier phase momentum coupling
|
||||||
|
td.cloud().UCoeff()[celli] += np0*mass0*Cud;
|
||||||
|
|
||||||
|
// Update enthalpy transfer
|
||||||
|
// - enthalpy of lost solids already accounted for
|
||||||
|
td.cloud().hTrans()[celli] += np0*dhTrans;
|
||||||
|
|
||||||
|
// Accumulate coefficient to be applied in carrier phase enthalpy coupling
|
||||||
|
td.cloud().hCoeff()[celli] += np0*htc*this->areaS();
|
||||||
|
|
||||||
|
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Remove the particle when mass falls below minimum threshold
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
if (mass1 < td.constProps().minParticleMass())
|
||||||
|
{
|
||||||
|
td.keepParticle = false;
|
||||||
|
|
||||||
|
// Absorb particle(s) into carrier phase
|
||||||
|
forAll(dMassMT, i)
|
||||||
|
{
|
||||||
|
td.cloud().rhoTrans(i)[celli] += np0*dMassMT[i];
|
||||||
|
}
|
||||||
|
td.cloud().hTrans()[celli] +=
|
||||||
|
np0*mass1
|
||||||
|
*(
|
||||||
|
YMixture_[0]*td.cloud().composition().HGas(YGas_, T1)
|
||||||
|
+ YMixture_[2]*td.cloud().composition().HSolid(YSolid_, T1)
|
||||||
|
);
|
||||||
|
td.cloud().UTrans()[celli] += np0*mass1*U1;
|
||||||
|
}
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Set new particle properties
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->U_ = U1;
|
||||||
|
this->T_ = T1;
|
||||||
|
this->cp_ =
|
||||||
|
YMixture_[0]*td.cloud().composition().cpGas(YGas_, T1)
|
||||||
|
+ YMixture_[1]*td.cloud().composition().cpLiquid(YLiquid_, pc_, T1)
|
||||||
|
+ YMixture_[2]*td.cloud().composition().cpSolid(YSolid_);
|
||||||
|
|
||||||
|
// Update particle density or diameter
|
||||||
|
if (td.constProps().constantVolume())
|
||||||
|
{
|
||||||
|
this->rho_ = mass1/this->volume();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->d_ = cbrt(mass1/this->rho_*6.0/mathematicalConstant::pi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
template<class TrackData>
|
||||||
|
void Foam::ReactingParcel<ParcelType>::calcUncoupled
|
||||||
|
(
|
||||||
|
TrackData& td,
|
||||||
|
const scalar dt,
|
||||||
|
const label celli
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Define local properties at beginning of timestep
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
const scalar T0 = this->T_;
|
||||||
|
const scalar mass0 = this->mass();
|
||||||
const scalar cp0 = this->cp_;
|
const scalar cp0 = this->cp_;
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -79,9 +237,12 @@ void Foam::ReactingParcel<ParcelType>::calcCoupled
|
|||||||
// - components do not necessarily exist in particle already
|
// - components do not necessarily exist in particle already
|
||||||
scalarList dMassSR(td.cloud().gases().size(), 0.0);
|
scalarList dMassSR(td.cloud().gases().size(), 0.0);
|
||||||
|
|
||||||
// Total mass lost from particle due to surface reactions
|
|
||||||
// - sub-model will adjust component mass fractions
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
scalar dMassMTSR = 0.0;
|
// Calculate velocity - update U
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
scalar Cud = 0.0;
|
||||||
|
const vector U1 = calcVelocity(td, dt, Cud, dUTrans);
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -91,13 +252,6 @@ void Foam::ReactingParcel<ParcelType>::calcCoupled
|
|||||||
scalar T1 = calcHeatTransfer(td, dt, celli, htc, dhTrans);
|
scalar T1 = calcHeatTransfer(td, dt, celli, htc, dhTrans);
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Calculate velocity - update U
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
scalar Cud = 0.0;
|
|
||||||
const vector U1 = calcVelocity(td, dt, Cud, dUTrans);
|
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
// Calculate mass transfer
|
// Calculate mass transfer
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -107,186 +261,23 @@ void Foam::ReactingParcel<ParcelType>::calcCoupled
|
|||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
// Calculate surface reactions
|
// Calculate surface reactions
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
calcSurfaceReactions(td, dt, celli, T0, T1, dMassMTSR, dMassSR);
|
|
||||||
|
// Initialise enthalpy retention to zero
|
||||||
|
scalar dhRet = 0.0;
|
||||||
|
|
||||||
|
calcSurfaceReactions(td, dt, celli, T0, T1, dMassMT, dMassSR, dhRet);
|
||||||
|
|
||||||
// New total mass
|
// New total mass
|
||||||
const scalar mass1 = mass0 - sum(dMassMT) - dMassMTSR;
|
const scalar mass1 = mass0 - sum(dMassMT) - sum(dMassSR);
|
||||||
|
|
||||||
// Ratio of mass devolatilised to the total volatile mass of the particle
|
// New specific heat capacity
|
||||||
const scalar fVol = 1 -
|
const scalar cp1 =
|
||||||
(YMixture_[0]*mass1)
|
YMixture_[0]*td.cloud().composition().cpGas(YGas_, T1)
|
||||||
/(td.cloud().composition().YMixture0()[0]*mass0_);
|
+ YMixture_[1]*td.cloud().composition().cpLiquid(YLiquid_, pc_, T1)
|
||||||
|
+ YMixture_[2]*td.cloud().composition().cpSolid(YSolid_);
|
||||||
// Specific heat capacity of non-volatile components
|
|
||||||
const scalar cpNonVolatile =
|
|
||||||
(
|
|
||||||
YMixture_[1]*td.cloud().composition().cpLiquid(YLiquid_, pc_, this->Tc_)
|
|
||||||
+ YMixture_[2]*td.cloud().composition().cpSolid(YSolid_)
|
|
||||||
)/(YMixture_[1] + YMixture_[2]);
|
|
||||||
|
|
||||||
// New specific heat capacity - linear variation until volatiles
|
|
||||||
// have evolved
|
|
||||||
const scalar cp1 = (cpNonVolatile - td.constProps().cp0())*fVol
|
|
||||||
+ td.constProps().cp0();
|
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Accumulate source terms
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
// Transfer mass lost from particle to carrier mass source
|
|
||||||
forAll(dMassMT, i)
|
|
||||||
{
|
|
||||||
td.cloud().rhoTrans(i)[celli] += np0*(dMassMT[i] + dMassSR[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update momentum transfer
|
|
||||||
td.cloud().UTrans()[celli] += np0*dUTrans;
|
|
||||||
|
|
||||||
// Accumulate coefficient to be applied in carrier phase momentum coupling
|
|
||||||
td.cloud().UCoeff()[celli] += np0*mass0*Cud;
|
|
||||||
|
|
||||||
// Update enthalpy transfer
|
|
||||||
// td.cloud().hTrans()[celli] += np0*(mass0*cp0*T0 - mass1*cp1*T1);
|
|
||||||
td.cloud().hTrans()[celli] += np0*((mass0*cp0 - mass1*cp1)*T0 + dhTrans);
|
|
||||||
|
|
||||||
// Accumulate coefficient to be applied in carrier phase enthalpy coupling
|
|
||||||
td.cloud().hCoeff()[celli] += np0*htc*this->areaS();
|
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Remove the particle when mass falls below minimum threshold
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
if (mass1 < td.constProps().minParticleMass())
|
|
||||||
{
|
|
||||||
td.keepParticle = false;
|
|
||||||
|
|
||||||
// Absorb particle(s) into carrier phase
|
|
||||||
forAll(dMassMT, i)
|
|
||||||
{
|
|
||||||
td.cloud().rhoTrans(i)[celli] += np0*dMassMT[i];
|
|
||||||
}
|
|
||||||
td.cloud().hTrans()[celli] += np0*mass1*cp1*T1;
|
|
||||||
td.cloud().UTrans()[celli] += np0*mass1*U1;
|
|
||||||
}
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Set new particle properties
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->U_ = U1;
|
|
||||||
this->T_ = T1;
|
|
||||||
this->cp_ = cp1;
|
|
||||||
|
|
||||||
// Update particle density or diameter
|
|
||||||
if (td.cloud().massTransfer().changesVolume())
|
|
||||||
{
|
|
||||||
this->d_ = cbrt(mass1/this->rho_*6.0/mathematicalConstant::pi);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->rho_ = mass1/this->volume();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ParcelType>
|
|
||||||
template<class TrackData>
|
|
||||||
void Foam::ReactingParcel<ParcelType>::calcUncoupled
|
|
||||||
(
|
|
||||||
TrackData& td,
|
|
||||||
const scalar dt,
|
|
||||||
const label celli
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Define local properties at beginning of timestep
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
const scalar T0 = this->T_;
|
|
||||||
const scalar mass0 = this->mass();
|
|
||||||
// const scalar cp0 = this->cp();
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Initialise transfer terms
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
// Momentum transfer from the particle to the carrier phase
|
|
||||||
vector dUTrans = vector::zero;
|
|
||||||
|
|
||||||
// Enthalpy transfer from the particle to the carrier phase
|
|
||||||
scalar dhTrans = 0.0;
|
|
||||||
|
|
||||||
// Mass transfer from particle to carrier phase
|
|
||||||
// - components exist in particle already
|
|
||||||
scalarList dMassMT(td.cloud().gases().size(), 0.0);
|
|
||||||
|
|
||||||
// Mass transfer due to surface reactions from particle to carrier phase
|
|
||||||
// - components do not necessarily exist in particle already
|
|
||||||
scalarList dMassSR(td.cloud().gases().size(), 0.0);
|
|
||||||
|
|
||||||
// Total mass lost from particle due to surface reactions
|
|
||||||
// - sub-model will adjust component mass fractions
|
|
||||||
scalar dMassMTSR = 0.0;
|
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Calculate heat transfer - update T
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
scalar htc = 0.0;
|
|
||||||
scalar T1 = calcHeatTransfer(td, dt, celli, htc, dhTrans);
|
|
||||||
|
|
||||||
// Limit new temp max by vapourisarion temperature
|
|
||||||
T1 = min(td.constProps().Tvap(), T1);
|
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Calculate velocity - update U
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
scalar Cud = 0.0;
|
|
||||||
const vector U1 = calcVelocity(td, dt, Cud, dUTrans);
|
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Calculate mass transfer
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
calcMassTransfer(td, dt, T0, T1, dMassMT);
|
|
||||||
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Calculate surface reactions
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
calcSurfaceReactions
|
|
||||||
(
|
|
||||||
td,
|
|
||||||
dt,
|
|
||||||
celli,
|
|
||||||
T0,
|
|
||||||
T1,
|
|
||||||
dMassMTSR,
|
|
||||||
dMassSR
|
|
||||||
);
|
|
||||||
|
|
||||||
// New total mass
|
|
||||||
const scalar mass1 = mass0 - sum(dMassMT) - dMassMTSR;
|
|
||||||
|
|
||||||
// Ratio of mass devolatilised to the total volatile mass of the particle
|
|
||||||
const scalar fVol = 1 -
|
|
||||||
(YMixture_[0]*mass1)
|
|
||||||
/(td.cloud().composition().YMixture0()[0]*mass0_);
|
|
||||||
|
|
||||||
// Specific heat capacity of non-volatile components
|
|
||||||
const scalar cpNonVolatile =
|
|
||||||
(
|
|
||||||
YMixture_[1]*td.cloud().composition().cpLiquid(YLiquid_, pc_, this->Tc_)
|
|
||||||
+ YMixture_[2]*td.cloud().composition().cpSolid(YSolid_)
|
|
||||||
)/(YMixture_[1] + YMixture_[2]);
|
|
||||||
|
|
||||||
// New specific heat capacity - linear variation until volatiles
|
|
||||||
// have evolved
|
|
||||||
const scalar cp1 = (cpNonVolatile - td.constProps().cp0())*fVol
|
|
||||||
+ td.constProps().cp0();
|
|
||||||
|
|
||||||
|
// Add retained enthalpy to particle
|
||||||
|
T1 += dhRet/(mass0*0.5*(cp0 + cp1));
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
// Remove the particle when mass falls below minimum threshold
|
// Remove the particle when mass falls below minimum threshold
|
||||||
@ -305,13 +296,13 @@ void Foam::ReactingParcel<ParcelType>::calcUncoupled
|
|||||||
this->cp_ = cp1;
|
this->cp_ = cp1;
|
||||||
|
|
||||||
// Update particle density or diameter
|
// Update particle density or diameter
|
||||||
if (td.cloud().massTransfer().changesVolume())
|
if (td.constProps().constantVolume())
|
||||||
{
|
{
|
||||||
this->d_ = cbrt(mass1/this->rho_*6.0/mathematicalConstant::pi);
|
this->rho_ = mass1/this->volume();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->rho_ = mass1/this->volume();
|
this->d_ = cbrt(mass1/this->rho_*6.0/mathematicalConstant::pi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -389,8 +380,9 @@ void Foam::ReactingParcel<ParcelType>::calcSurfaceReactions
|
|||||||
const label celli,
|
const label celli,
|
||||||
const scalar T0,
|
const scalar T0,
|
||||||
const scalar T1,
|
const scalar T1,
|
||||||
scalar& dMassMTSR,
|
const scalarList& dMassMT,
|
||||||
scalarList& dMassMT
|
scalarList& dMassSR,
|
||||||
|
scalar& dhRet
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Check that model is active
|
// Check that model is active
|
||||||
@ -409,21 +401,20 @@ void Foam::ReactingParcel<ParcelType>::calcSurfaceReactions
|
|||||||
T0,
|
T0,
|
||||||
T1,
|
T1,
|
||||||
this->Tc_,
|
this->Tc_,
|
||||||
|
pc_,
|
||||||
this->rhoc_,
|
this->rhoc_,
|
||||||
this->mass(),
|
this->mass(),
|
||||||
|
dMassMT,
|
||||||
YGas_,
|
YGas_,
|
||||||
YLiquid_,
|
YLiquid_,
|
||||||
YSolid_,
|
YSolid_,
|
||||||
YMixture_,
|
YMixture_,
|
||||||
dMassMTSR,
|
dMassSR,
|
||||||
dMassMT
|
dhRet
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
||||||
|
|
||||||
#include "ReactingParcelIO.C"
|
#include "ReactingParcelIO.C"
|
||||||
|
|||||||
@ -89,6 +89,12 @@ public:
|
|||||||
//- Boiling point [K]
|
//- Boiling point [K]
|
||||||
const scalar Tbp_;
|
const scalar Tbp_;
|
||||||
|
|
||||||
|
//- Latent heat of devolatilisation [J/kg]
|
||||||
|
const scalar Ldevol_;
|
||||||
|
|
||||||
|
//- Constant volume flag - e.g. during mass transfer
|
||||||
|
Switch constantVolume_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -102,6 +108,12 @@ public:
|
|||||||
|
|
||||||
//- Return const access to the boiling point
|
//- Return const access to the boiling point
|
||||||
inline scalar Tbp() const;
|
inline scalar Tbp() const;
|
||||||
|
|
||||||
|
//- Return const access to the latent heat of devolatilisation
|
||||||
|
inline scalar Ldevol() const;
|
||||||
|
|
||||||
|
//- Return const access to the constant volume flag
|
||||||
|
inline Switch constantVolume() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -210,8 +222,9 @@ protected:
|
|||||||
const label celli,
|
const label celli,
|
||||||
const scalar T0,
|
const scalar T0,
|
||||||
const scalar T1,
|
const scalar T1,
|
||||||
scalar& dMassMTSR,
|
const scalarList& dMassMT,
|
||||||
scalarList& dMassMT
|
scalarList& dMassSR,
|
||||||
|
scalar& dhRet
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,9 @@ inline Foam::ReactingParcel<ParcelType>::constantProperties::constantProperties
|
|||||||
:
|
:
|
||||||
ThermoParcel<ParcelType>::constantProperties(dict),
|
ThermoParcel<ParcelType>::constantProperties(dict),
|
||||||
Tvap_(dimensionedScalar(dict.lookup("Tvap")).value()),
|
Tvap_(dimensionedScalar(dict.lookup("Tvap")).value()),
|
||||||
Tbp_(dimensionedScalar(dict.lookup("Tbp")).value())
|
Tbp_(dimensionedScalar(dict.lookup("Tbp")).value()),
|
||||||
|
Ldevol_(dimensionedScalar(dict.lookup("Ldevol")).value()),
|
||||||
|
constantVolume_(dict.lookup("constantVolume"))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -127,6 +129,22 @@ Foam::ReactingParcel<ParcelType>::constantProperties::Tbp() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
inline Foam::scalar
|
||||||
|
Foam::ReactingParcel<ParcelType>::constantProperties::Ldevol() const
|
||||||
|
{
|
||||||
|
return Ldevol_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ParcelType>
|
||||||
|
inline Foam::Switch
|
||||||
|
Foam::ReactingParcel<ParcelType>::constantProperties::constantVolume() const
|
||||||
|
{
|
||||||
|
return constantVolume_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
|
|||||||
@ -297,10 +297,7 @@ Foam::Ostream& Foam::operator<<
|
|||||||
os << static_cast<const ThermoParcel<ParcelType>& >(p);
|
os << static_cast<const ThermoParcel<ParcelType>& >(p);
|
||||||
os.write
|
os.write
|
||||||
(
|
(
|
||||||
reinterpret_cast<const char*>
|
reinterpret_cast<const char*>(&p.mass0_),
|
||||||
(
|
|
||||||
&const_cast<ReactingParcel<ParcelType>&>(p).mass0()
|
|
||||||
),
|
|
||||||
sizeof(p.mass0())
|
sizeof(p.mass0())
|
||||||
);
|
);
|
||||||
os << p.YMixture() << YGasLoc << YLiquidLoc << YSolidLoc;
|
os << p.YMixture() << YGasLoc << YLiquidLoc << YSolidLoc;
|
||||||
|
|||||||
@ -203,17 +203,17 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
|
|||||||
// Set new particle temperature
|
// Set new particle temperature
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
scalar Tnew = td.cloud().TIntegrator().integrate(T_, dt, ap, bp);
|
// Integrate to find the new parcel temperature
|
||||||
|
IntegrationScheme<scalar>::integrationResult Tres =
|
||||||
|
td.cloud().TIntegrator().integrate(T_, dt, ap, bp);
|
||||||
|
|
||||||
dhTrans = -this->mass()*cp_*(Tnew - T_);
|
// Using average parcel temperature for enthalpy transfer calculation
|
||||||
|
dhTrans = dt*this->areaS()*htc*(Tres.average() - Tc_);
|
||||||
|
|
||||||
return Tnew;
|
return Tres.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
||||||
|
|
||||||
#include "ThermoParcelIO.C"
|
#include "ThermoParcelIO.C"
|
||||||
|
|||||||
@ -149,10 +149,7 @@ Foam::Ostream& Foam::operator<<
|
|||||||
os << static_cast<const KinematicParcel<ParcelType>& >(p);
|
os << static_cast<const KinematicParcel<ParcelType>& >(p);
|
||||||
os.write
|
os.write
|
||||||
(
|
(
|
||||||
reinterpret_cast<const char*>
|
reinterpret_cast<const char*>(&p.T_),
|
||||||
(
|
|
||||||
&const_cast<ThermoParcel<ParcelType>&>(p).T()
|
|
||||||
),
|
|
||||||
sizeof(p.T()) + sizeof(p.cp())
|
sizeof(p.T()) + sizeof(p.cp())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -209,13 +209,20 @@ public:
|
|||||||
//- Return the gas constant for the gas mixture
|
//- Return the gas constant for the gas mixture
|
||||||
virtual scalar RGas(const scalarField& YGas) const = 0;
|
virtual scalar RGas(const scalarField& YGas) const = 0;
|
||||||
|
|
||||||
//- Return enthalpy for the gas mixture
|
//- Return enthalpy for the gas mixture [energy per unit mass]
|
||||||
virtual scalar HGas
|
virtual scalar HGas
|
||||||
(
|
(
|
||||||
const scalarField& YGas,
|
const scalarField& YGas,
|
||||||
const scalar T
|
const scalar T
|
||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
|
//- Return enthalpy for the solid mixture [energy per unit mass]
|
||||||
|
virtual scalar HSolid
|
||||||
|
(
|
||||||
|
const scalarField& YSolid,
|
||||||
|
const scalar T
|
||||||
|
) const = 0;
|
||||||
|
|
||||||
//- Return specific heat caparcity for the gas mixture
|
//- Return specific heat caparcity for the gas mixture
|
||||||
virtual scalar cpGas
|
virtual scalar cpGas
|
||||||
(
|
(
|
||||||
|
|||||||
@ -519,6 +519,29 @@ const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::scalar Foam::SingleMixtureFraction<CloudType>::HSolid
|
||||||
|
(
|
||||||
|
const scalarField& YSolid,
|
||||||
|
const scalar T
|
||||||
|
)
|
||||||
|
const
|
||||||
|
{
|
||||||
|
scalar HMixture = 0.0;
|
||||||
|
forAll(YSolid, i)
|
||||||
|
{
|
||||||
|
label id = solidGlobalIds_[i];
|
||||||
|
HMixture +=
|
||||||
|
YSolid[i]
|
||||||
|
*(
|
||||||
|
this->solids().properties()[id].Hf()
|
||||||
|
+ this->solids().properties()[id].cp()*T
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return HMixture;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::SingleMixtureFraction<CloudType>::cpGas
|
Foam::scalar Foam::SingleMixtureFraction<CloudType>::cpGas
|
||||||
(
|
(
|
||||||
|
|||||||
@ -188,9 +188,12 @@ public:
|
|||||||
//- Return the gas constant for the gas mixture
|
//- Return the gas constant for the gas mixture
|
||||||
scalar RGas(const scalarField& YGas) const;
|
scalar RGas(const scalarField& YGas) const;
|
||||||
|
|
||||||
//- Return enthalpy for the gas mixture
|
//- Return enthalpy for the gas mixture [energy per unit mass]
|
||||||
scalar HGas(const scalarField& YGas, const scalar T) const;
|
scalar HGas(const scalarField& YGas, const scalar T) const;
|
||||||
|
|
||||||
|
//- Return enthalpy for the solid mixture [energy per unit mass]
|
||||||
|
scalar HSolid(const scalarField& YSolid, const scalar T) const;
|
||||||
|
|
||||||
//- Return specific heat caparcity for the gas mixture
|
//- Return specific heat caparcity for the gas mixture
|
||||||
scalar cpGas(const scalarField& YGas, const scalar T) const;
|
scalar cpGas(const scalarField& YGas, const scalar T) const;
|
||||||
|
|
||||||
|
|||||||
@ -60,13 +60,6 @@ bool Foam::ConstantRateDevolatilisation<CloudType>::active() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
bool Foam::ConstantRateDevolatilisation<CloudType>::changesVolume() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::ConstantRateDevolatilisation<CloudType>::calculate
|
Foam::scalar Foam::ConstantRateDevolatilisation<CloudType>::calculate
|
||||||
(
|
(
|
||||||
|
|||||||
@ -89,9 +89,6 @@ public:
|
|||||||
//- Flag to indicate whether model activates mass transfer model
|
//- Flag to indicate whether model activates mass transfer model
|
||||||
bool active() const;
|
bool active() const;
|
||||||
|
|
||||||
//- Flag to indicate whether model changes particle volume
|
|
||||||
bool changesVolume() const;
|
|
||||||
|
|
||||||
//- Update model
|
//- Update model
|
||||||
scalar calculate
|
scalar calculate
|
||||||
(
|
(
|
||||||
|
|||||||
@ -130,9 +130,6 @@ public:
|
|||||||
//- Flag to indicate whether model activates mass transfer model
|
//- Flag to indicate whether model activates mass transfer model
|
||||||
virtual bool active() const = 0;
|
virtual bool active() const = 0;
|
||||||
|
|
||||||
//- Flag to indicate whether model changes particle volume
|
|
||||||
virtual bool changesVolume() const = 0;
|
|
||||||
|
|
||||||
//- Update model
|
//- Update model
|
||||||
virtual scalar calculate
|
virtual scalar calculate
|
||||||
(
|
(
|
||||||
|
|||||||
@ -55,13 +55,6 @@ bool Foam::NoMassTransfer<CloudType>::active() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
bool Foam::NoMassTransfer<CloudType>::changesVolume() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::NoMassTransfer<CloudType>::calculate
|
Foam::scalar Foam::NoMassTransfer<CloudType>::calculate
|
||||||
(
|
(
|
||||||
|
|||||||
@ -75,9 +75,6 @@ public:
|
|||||||
//- Flag to indicate whether model activates mass transfer model
|
//- Flag to indicate whether model activates mass transfer model
|
||||||
bool active() const;
|
bool active() const;
|
||||||
|
|
||||||
//- Flag to indicate whether model changes particle volume
|
|
||||||
bool changesVolume() const;
|
|
||||||
|
|
||||||
//- Update model
|
//- Update model
|
||||||
scalar calculate
|
scalar calculate
|
||||||
(
|
(
|
||||||
|
|||||||
@ -62,13 +62,6 @@ bool Foam::SingleKineticRateDevolatilisation<CloudType>::active() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
bool Foam::SingleKineticRateDevolatilisation<CloudType>::changesVolume() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
Foam::scalar Foam::SingleKineticRateDevolatilisation<CloudType>::calculate
|
Foam::scalar Foam::SingleKineticRateDevolatilisation<CloudType>::calculate
|
||||||
(
|
(
|
||||||
|
|||||||
@ -91,9 +91,6 @@ public:
|
|||||||
//- Flag to indicate whether model activates mass transfer model
|
//- Flag to indicate whether model activates mass transfer model
|
||||||
bool active() const;
|
bool active() const;
|
||||||
|
|
||||||
//- Flag to indicate whether model changes particle volume
|
|
||||||
bool changesVolume() const;
|
|
||||||
|
|
||||||
//- Update model
|
//- Update model
|
||||||
scalar calculate
|
scalar calculate
|
||||||
(
|
(
|
||||||
|
|||||||
@ -64,16 +64,20 @@ void Foam::NoSurfaceReaction<CloudType>::calculate
|
|||||||
const scalar T0,
|
const scalar T0,
|
||||||
const scalar T1,
|
const scalar T1,
|
||||||
const scalar Tc,
|
const scalar Tc,
|
||||||
|
const scalar pc,
|
||||||
const scalar rhoc,
|
const scalar rhoc,
|
||||||
const scalar massp,
|
const scalar massp,
|
||||||
|
const scalarList& dMassMT,
|
||||||
scalarField& YGas,
|
scalarField& YGas,
|
||||||
scalarField& YLiquid,
|
scalarField& YLiquid,
|
||||||
scalarField& YSolid,
|
scalarField& YSolid,
|
||||||
scalarField& YMixture,
|
scalarField& YMixture,
|
||||||
scalar& dMassMTSR,
|
scalarList& dMassSR,
|
||||||
scalarList& dMassSR
|
scalar& dhRet
|
||||||
) const
|
) const
|
||||||
{}
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -84,14 +84,16 @@ public:
|
|||||||
const scalar T0,
|
const scalar T0,
|
||||||
const scalar T1,
|
const scalar T1,
|
||||||
const scalar Tc,
|
const scalar Tc,
|
||||||
|
const scalar pc,
|
||||||
const scalar rhoc,
|
const scalar rhoc,
|
||||||
const scalar massp,
|
const scalar massp,
|
||||||
|
const scalarList& dMassMT,
|
||||||
scalarField& YGas,
|
scalarField& YGas,
|
||||||
scalarField& YLiquid,
|
scalarField& YLiquid,
|
||||||
scalarField& YSolid,
|
scalarField& YSolid,
|
||||||
scalarField& YMixture,
|
scalarField& YMixture,
|
||||||
scalar& dMassMTSR,
|
scalarList& dMassSR,
|
||||||
scalarList& dMassSR
|
scalar& dhRet
|
||||||
) const;
|
) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -141,14 +141,16 @@ public:
|
|||||||
const scalar T0,
|
const scalar T0,
|
||||||
const scalar T1,
|
const scalar T1,
|
||||||
const scalar Tc,
|
const scalar Tc,
|
||||||
|
const scalar pc,
|
||||||
const scalar rhoc,
|
const scalar rhoc,
|
||||||
const scalar massp,
|
const scalar massp,
|
||||||
|
const scalarList& dMassMT,
|
||||||
scalarField& YGas,
|
scalarField& YGas,
|
||||||
scalarField& YLiquid,
|
scalarField& YLiquid,
|
||||||
scalarField& YSolid,
|
scalarField& YSolid,
|
||||||
scalarField& YMixture,
|
scalarField& YMixture,
|
||||||
scalar& dMassMTSR,
|
scalarList& dMassSR,
|
||||||
scalarList& dMassSR
|
scalar& dhRet
|
||||||
) const = 0;
|
) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -62,11 +62,6 @@ Foam::scalar Foam::NoHeatTransfer<CloudType>::Nu
|
|||||||
const scalar
|
const scalar
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
notImplemented
|
|
||||||
(
|
|
||||||
"Foam::scalar Foam::NoHeatTransfer<CloudType>::Nu"
|
|
||||||
"(const scalar, const scalar)"
|
|
||||||
);
|
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,8 +69,7 @@ Foam::scalar Foam::NoHeatTransfer<CloudType>::Nu
|
|||||||
template <class CloudType>
|
template <class CloudType>
|
||||||
Foam::scalar Foam::NoHeatTransfer<CloudType>::Pr() const
|
Foam::scalar Foam::NoHeatTransfer<CloudType>::Pr() const
|
||||||
{
|
{
|
||||||
notImplemented("Foam::scalar Foam::NoHeatTransfer<CloudType>::Pr()");
|
return 1.0;
|
||||||
return 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user