Compare commits

..

46 Commits

Author SHA1 Message Date
aa02bf904e BUG: incorrect startLineNumber for primitiveEntry (fixes #1706) 2020-05-14 17:21:33 +02:00
cd79ac6fd5 BUG: Pair sort on construct did the opposite (fixes #1701) 2020-05-11 20:28:52 +02:00
5619d509c5 COMP: adjust for CGAL-4.14 changes 2020-05-11 20:28:51 +02:00
a52aa33069 CONFIG: provide separate default settings for clang/gcc (fixes #1566)
- the foamConfigurePaths script is quite simplistic and aggressive in
  what it changes. This was particularly evident when using it to
  change gcc/clang versions.

  Restructured the corresponding compiler settings to define default
  versions (eg, "default_gcc_version") that limits the scope of
  changes performed by foamConfigurePaths and makes it easier to
  understand if changing manually.
2020-02-03 11:32:52 +01:00
dd8598ecde CONFIG: bump patch level 2020-01-31 12:10:51 +01:00
964dcb5b53 COMP: avoid -Wstringop-truncation warning 2020-01-31 12:08:31 +01:00
3166fc0b73 COMP: backport of updates for gcc-92 compilation
ENH: add typedefs for interpolation tables
2020-01-28 12:46:27 +01:00
89e7775f90 BUG: incorrect Nastran surface output and segmentation faults #1571
- indexing error in the output of values resulted in uniform output in
  most cases.

- allocation error for on-the-fly triangulation

ENH: changed decomposed storage from DynamicList to plain faceList for
clearer allocation control and better overhead
2020-01-27 11:04:25 +01:00
40c713c48c COMP: silence gcc 8.2 memcpy warnings
- we know they have already protected by an is_contiguous check,
  so the class-memaccess warning/error can be suppressed.
2019-10-28 16:57:47 +01:00
9cfdb2cc40 CONFIG: adjust known gcc/clang compiler versions 2019-10-28 12:55:15 +01:00
b9eedb35d1 STYLE: use const reference for caught exceptions 2019-01-23 09:03:06 +01:00
9c076da13a BUG: incorrect binary read of injectedParticle (fixes #1393)
- the read offset missed the tag_ member entirely and thus the entire
  particle information would be corrupt (incorrectly interpreted) as
  well as potential violation of adjacent (trailing) memory locations.
2019-08-06 10:30:07 +02:00
7782a66e88 BUG: incorrect blocked face synchronisation crashes regionSplit (#1370)
- now catch these and emit a warning.
  Still need to investigate the root cause in the caller(s) or regionSplit.
2019-07-12 13:29:20 +02:00
4b2a4ed9ec CONFIG: backport of META-INFO information (#1367) 2019-07-10 20:19:01 +02:00
a031c194b8 BUG: Sf field ignored for sumDirection operation (fixes #1287) 2019-04-16 18:32:07 +02:00
e5d2c89f9a COMP: fix conditional for VTK legacy rendering.
- was deprecated for removal with VTK 8.1.0
  definitely removed in VTK 8.2.0
2018-11-08 21:28:26 +01:00
641cb490b4 ENH: export FOAM_API in dictionary (issue #1158)
- uses the value of the OPENFOAM compiler define
2019-01-07 19:04:50 +01:00
f51edbf79e BUG: First occurence of alpha1.prevIter() causes crash (closes #911)
- in interIsoFoam/alphaEqn.H changed to alpha1.prevIter() to
  alpha1.storePrevIter().
2018-07-19 23:36:42 +02:00
3357b86ab5 DOC: Updated header - see #875 2018-10-16 15:26:55 +01:00
e9d156ce54 DOC: Added reference to header files. Fixes #1038 2018-10-16 15:24:28 +01:00
dba1bc24ca ENH: Added warning if using an isotropic assumption with an anisotropic thermal conductivity 2018-10-16 15:04:38 +01:00
3c13e7eebf TUT: Cleaned some forceCoeffs usages 2018-10-16 08:40:23 +01:00
91dd591ff6 BUG: wmkdepend sometimes throws (closes #1036)
- local token shifting was missing when getting the next file chunk
  (while in the middle of parsing that text).

  As well as adding the correct shifting, also tag the local buffer
  with nullptr when it is done. Be extra paranoid and check the
  raw buffer range before passing off to std::string.
2018-10-10 15:33:35 +02:00
ecef4c1473 BUG: foamNewSource - corrected Make/options for app mode. Closes #1006 2018-10-09 09:47:54 +01:00
15e7967fb7 TUT: Removed unused/misleading entries - see #1020 2018-09-27 16:34:44 +01:00
5db18df6bc ENH: Particle interaction lists - do not include partially open wall faces. See #957 2018-09-27 12:51:13 +01:00
cab600d567 ENH: polyPatch - added areaFraction method
Helper function to calculate the current face area vs the area returned
from the current point locations.  Useful for ACMI-type baffles where we
scale the face areas without moving points.
2018-09-27 12:46:48 +01:00
868045b2e1 BUG: Correct initialization for psi and mu for solidThermo 2018-10-08 15:40:12 -07:00
ef652062ec BUG: Corrected viscosity field names. Fixes #1017 2018-09-21 16:00:28 +01:00
5782af39f5 BUG: kEpsilonLopesdaCosta model - loop was using the incorrect index 2018-09-21 13:44:17 +01:00
fd49e4dd24 BUG: foamLog - corrected for Ubuntu. See #860 2018-09-12 08:42:04 +01:00
8831dfc58b BUG: incorrect kahip resolution with absolute paths (closes #1003)
- for installations with central (non-ThirdParty) location for KAHIP
  (eg, spack, EasyBuild)
2018-09-12 08:37:53 +02:00
3e29b9c3aa BUG: Doxygen corrections 2018-09-11 12:13:19 +01:00
cf2630dd1a BUG: multiSolidBodyMotionSolver: parallel consistent message. Fixes #990. 2018-09-05 13:17:37 +01:00
86e593b58e BUG: Fix ticket 792. pRefCelli is set to -1 for
chtMultiRegionSimpleFoam
2018-09-25 12:48:04 -07:00
c332b2cbc8 BUG: bitSet: extraneous exit. Fixes #984. 2018-08-29 12:50:50 +01:00
bd48ca4920 BUG: externalWallHeatFluxTemperature - set size of qrPrevious_ before
mapping.  Fixes #983
2018-08-28 15:39:06 +01:00
be740dcb06 BUG: cubicEqn, quadraticEqn: Correction to repeated roots
Also extended the cubic equation test routine and modified the error
methods so that they more accurately generate the round of error of
evaluation.

This resolves bug report https://bugs.openfoam.org/view.php?id=3015
2018-07-24 15:54:32 +01:00
186ab01b31 COMP: Allwmake: pass through targetType 2018-08-02 10:18:59 +01:00
ef1324a1b0 BUG: double read when updating ensight fieldsDict 2018-07-30 16:07:49 +02:00
108d14967a BUG: incorrect lookup name for lumpedMotion scaling parameter (fixes #949) 2018-07-23 20:19:07 +02:00
41e93f735f BUG: incorrect swirlFan tangential velocity calculation (closes #945)
- missing indexing caused the real radius to be largely ignored
  when useRealRadius = true
2018-07-20 08:14:58 +02:00
7670bd0e13 TUT: samplingDebug was left enabled in tutorial (and missing a file) 2018-07-18 19:41:32 +02:00
5ff5b0afc4 BUG: particle: locate can get stuck on cell centre. Fixes #935. 2018-07-12 11:31:27 +01:00
68e7c21d2f COMP: resolve compilation issues for single-precision (closes #932) 2018-07-11 19:24:16 +02:00
fa026a13a1 BUG: cyclicAMI: stabilise projection in case of 90 degree angles. Fixes #930. 2018-07-11 12:05:05 +01:00
9530 changed files with 118914 additions and 1054575 deletions

View File

@ -1,73 +0,0 @@
<!--
*** Please read this first! ***
Before opening a new issue, make sure to search for keywords in the issues
filtered by the "bug" label and check to see if it has already been reported
You can see how your report will be rendered on the platform by using the
"preview" tab above
-->
<!--
All text between these markers are comments and will not be present in the
report
-->
### Summary
<!-- Summarize the bug encountered concisely -->
### Steps to reproduce
<!-- How one can reproduce the issue - this is very important -->
### Example case
<!--
If possible, please create a SMALL example and attach it to your report
If you are using an older version of OpenFOAM this will also determine
whether the bug has been fixed in a more recent version
-->
### What is the current *bug* behaviour?
<!-- What actually happens -->
### What is the expected *correct* behavior?
<!-- What you should see instead -->
### Relevant logs and/or images
<!--
Paste any relevant logs - please use code blocks (```) to format console
output, logs, and code as it's very hard to read otherwise.
-->
### Environment information
<!--
Providing details of your set-up can help us identify any issues, e.g.
OpenFOAM version : v1806|v1812|v1906 etc
Operating system : ubuntu|openSUSE|centos etc
Hardware info : any info that may help?
Compiler : gcc|intel|clang etc
-->
- OpenFOAM version :
- Operating system :
- Hardware info :
- Compiler :
### Possible fixes
<!--
If you can, link to the line of code that might be responsible for the
problem
The "/label ~bug" text is a gitlab flag that will add the "bug" label to this
issue
-->
/label ~bug

View File

@ -1,31 +0,0 @@
### Functionality to add/problem to solve
(Brief scope)
### Target audience
(Who will benefit from the changes?)
(What type of cases?)
### Proposal
(How are we going to solve the problem?)
### What does success look like, and how can we measure that?
(What are the success factors and acceptance criteria? e.g. test cases, error margins)
### Links / references
(Links to literature, supporting information)
### Funding
(Does the functionality already exist/is sponsorship available?)
/label ~feature

View File

@ -1,20 +0,0 @@
### Summary
(Summarize the changes concisely)
### Resolved bugs (If applicable)
(Links to issues)
### Details of new models (If applicable)
(New options, user inputs etc)
(Images are nice :))
### Risks
(Possible regressions?)
(Changes to user inputs?)

View File

@ -14,24 +14,15 @@ cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR" 2>/dev/null || {
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
# Preamble. Report compiler version
case "$WM_COMPILER" in
Gcc*) gcc --version 2>/dev/null | sed -ne '1p' ;;
Clang*) clang --version 2>/dev/null | sed -ne '1p' ;;
esac
# Preamble. Report mpirun location
command -v mpirun 2>/dev/null || true
echo "========================================"
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
echo "Starting compile ${WM_PROJECT_DIR##*/} ${0##*}"
echo "Starting ${WM_PROJECT_DIR##*/} ${0##*}"
echo " $WM_COMPILER $WM_COMPILER_TYPE compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo "========================================"
echo
# Compile tools for wmake
"${WM_DIR:-wmake}"/src/Allmake
# Compile wmake tools
(cd "${WM_DIR:-wmake}/src" && make)
# Compile ThirdParty libraries and applications
if [ -d "$WM_THIRD_PARTY_DIR" ]
@ -60,13 +51,6 @@ then
(cd $WM_PROJECT_DIR/modules 2>/dev/null && wmake -all)
fi
# Count files in given directory. Ignore "Test-*" binaries.
_foamCountDirEntries()
{
(cd "$1" 2>/dev/null && find -mindepth 1 -maxdepth 1 -type f 2>/dev/null) |\
sed -e '\@/Test-@d' | wc -l
}
# Some summary information
echo
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
@ -75,11 +59,4 @@ echo " ${WM_PROJECT_DIR##*/}"
echo " $WM_COMPILER $WM_COMPILER_TYPE compiler"
echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo
echo " api = $(wmakeBuildInfo -show-api 2>/dev/null)"
echo " patch = $(wmakeBuildInfo -show-patch 2>/dev/null)"
echo " bin = $(_foamCountDirEntries $FOAM_APPBIN) entries"
echo " lib = $(_foamCountDirEntries $FOAM_LIBBIN) entries"
echo
echo "========================================"
#------------------------------------------------------------------------------

View File

@ -1,6 +1,7 @@
GNU GENERAL PUBLIC LICENSE
OpenFOAM(R) is released by OpenCFD Ltd. via www.openfoam.com
OpenFOAM(R) is Copyright (C) 2011 OpenFOAM Foundation
Contact: OpenFOAM Foundation (OpenFOAM.Foundation@gmail.com)
You may use, distribute and copy the OpenFOAM CFD Toolbox under the terms
of GNU General Public License version 3, which is displayed below, or

View File

@ -3,3 +3,7 @@ build-info
# Do not track time-stamp
time-stamp
# Do not track any manifest files
Manifest.txt
manifest.txt

View File

@ -2,83 +2,4 @@
Meta-information is for OpenFOAM internal use only.
Do not rely on any files or any file contents in this directory,
or even the existence of this directory.
The format, content and meaning may be changed at anytime without
notice.
The information is provided here for internal documentation purposes.
## api-info
This file and its contents are to be tracked by git.
- File content (api) generated by wmakeBuildInfo from OPENFOAM define
in `wmake/rules/General/general`
- File content (patch) is manually generated content.
## build-info
This file is *never* to be tracked by git, but may be present in shipped
source archives.
- File content (branch, build) generated by wmakeBuildInfo from git
information and cached from previous wmake (api)
## Content types
### api
- 4-digit year-month (YYMM) integer corresponding to the major
release or in unusual cases an intermediate release.
- Format is year-month, as per `date +%y%m`.
Eg, `1712` for the Dec-2017 release.
### patch
- 6-digit year-month-day (YYMMDD) integer corresponding to a patch-level
for the given **released** API.
Development branches have a patch value of `0`.
- Format is year-month-day, as per `date +%y%m%d`.
- The first release is by definition unpatched, and thus carries
a patch value of `0`. If this release were to be patched the following
day, the patch level would jump accordingly.
The patch value is only meaningful together with the api value.
## Flow of information
Changes in the build information must be reflected in information
available in the final binaries. Conversely, it is necessary for later
distributions to have a record of the same information.
| property | source | saved |
|-----------|---------------------------|------------|
| api | wmake/rules | api-info |
| patch | manual (api-info) | build-info |
| branch | git | build-info |
| build | git | build-info |
The command `wmakeBuildInfo -check` is used to determine if
the saved information needs synchronization. The command
`wmakeBuildInfo -update` preforms the synchronitzation.
## Notes
The saved information is split into two separate files. The `api-info`
contains more permanent information, whereas the `build-info` is more
transient in nature.
----
2018-11-29
(Backport from 1812)

View File

@ -1,2 +1,2 @@
api=1812
patch=200312
api=1806
patch=200131

163
README.md
View File

@ -2,12 +2,7 @@
OpenFOAM is a free, open source CFD software [released and developed primarily by OpenCFD Ltd](http://www.openfoam.com) since 2004. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics. [More...](http://www.openfoam.com/documentation)
OpenFOAM is professionally released every six months to include
customer sponsored developments and contributions from the community -
individual and group contributors, re-integrations (including from
FOAM-extend and OpenFOAM Foundation Ltd) - in this Official Release
sanctioned by the OpenFOAM Worldwide Trademark Owner aiming towards
one OpenFOAM.
OpenFOAM is professionally released every six months to include customer sponsored developments and contributions from the community - individual and group contributors, fork re-integrations including from FOAM-extend and OpenFOAM Foundation Ltd - in this Official Release sanctioned by the OpenFOAM Worldwide Trademark Owner aiming towards one OpenFOAM.
# Copyright
@ -22,162 +17,6 @@ Please [contact OpenCFD](http://www.openfoam.com/contact) if you have any questi
Violations of the Trademark are continuously monitored, and will be duly prosecuted.
# Using OpenFOAM
If OpenFOAM has already been compiled on your system, simply source
the appropriate `etc/bashrc` or `etc/cshrc` file and get started.
For example, for the OpenFOAM-v1906 version:
```
source /installation/path/OpenFOAM-v1906/etc/bashrc
```
# Compiling OpenFOAM
If you are compiling OpenFOAM from source, please see the relevant
guides:
| Location | Readme | Requirements | Build |
|-------------|-----------|--------------|-------|
| [OpenFOAM][repo openfoam] | [readme][link openfoam-readme] | [system requirements][link openfoam-require] | [build][link openfoam-build] |
| [ThirdParty][repo third] | [readme][link third-readme] | [system requirements][link third-require] | [build][link third-build] |
# How do I know which version I am currently using?
The value of the `$WM_PROJECT_DIR` or even `$WM_PROJECT_VERSION` are
not guaranteed to have any correspondence to the OpenFOAM release
(API) value. If OpenFOAM has already been compiled, the build-time
information is embedded into each application. For example, as
displayed from `blockMesh -help`:
```
Using: OpenFOAM-v1812.local (1812) (see www.OpenFOAM.com)
Build: 65d6551ff7-20190530 (patch=190531)
Arch: LSB;label=32;scalar=64
```
This output contains all of the more interesting information that we need:
| item | value |
|-----------------------|---------------|
| version | v1812.local |
| api | 1812 |
| commit | 65d6551ff7 |
| author date | 20190530 |
| patch-level | (20)190531 |
| label/scalar size | 32/64 bits |
As can be seen in this example, the git build information is
supplemented by the date when the last change was authored, which can
be helpful when the repository contains local changes. If you simply
wish to know the current API and patch levels directly, the
`wmakeBuildInfo` script provides the relevant information even
when OpenFOAM has not yet been compiled:
```
$ wmakeBuildInfo
make
api = 1812
patch = 190531
branch = master
build = 65d6551ff7-20190530
```
Similar information is available with `foamEtcFile`, using the
`-show-api` or `-show-patch` options. For example,
```
$ foamEtcFile -show-api
1812
$ foamEtcFile -show-patch
190531
```
This output will generally be the easiest to parse for scripts.
The `$FOAM_API` convenience environment variable may not reflect the
patching changes made within the currently active environment and
should be used with caution.
# ThirdParty directory
OpenFOAM normally ships with a directory of 3rd-party software and
build scripts for some 3rd-party software that is either necessary or
at least highly useful for OpenFOAM, but which are not necessarily
readily available on every operating system or cluster installation.
These 3rd-party sources are normally located in a directory parallel
to the OpenFOAM directory. For example,
```
/path/parent
|-- OpenFOAM-v1906
\-- ThirdParty-v1906
```
There are, however, many cases where this simple convention is inadequate:
* When no additional 3rd party software is actually required (ie, the
operating system or cluster installation provides it)
* When we have changed the OpenFOAM directory name to some arbitrary
directory name, e.g. openfoam-sandbox1906, etc..
* When we would like any additional 3rd party software to be located
inside of the OpenFOAM directory to ensure that the installation is
encapsulated within a single directory structure. This can be
necessary for cluster installations, or may simply be a convenient
means of performing a software rollout for individual workstations.
* When we have many different OpenFOAM directories for testing or
developing various different features but wish to use or reuse the
same 3rd party software for them all.
The solution for these problems is a newer, more intelligent discovery when locating the ThirdParty directory with the following precedence:
1. PROJECT/ThirdParty
* for single-directory installations
2. PREFIX/ThirdParty-VERSION
* this corresponds to the traditional approach
3. PREFIX/ThirdParty-vAPI
* allows for an updated value of VERSION, *eg*, `v1906-myCustom`,
without requiring a renamed ThirdParty. The API value would still
be `1906` and the original `ThirdParty-v1906/` would be found.
4. PREFIX/ThirdParty-API
* this is the same as the previous example, but using an unadorned
API value. This also makes sense if the chosen version name also
uses the unadorned API value in its naming, *eg*,
`1906-patch190131`, `1906.19W03`
5. PREFIX/ThirdParty-common
* permits maximum reuse for various versions, but only for
experienced user who are aware of potential version
incompatibilities
If none of these directories are found to be suitable, it reverts to using PROJECT/ThirdParty as a dummy location (even if the directory does not exist). This is a safe fallback value since it is within the OpenFOAM directory structure and can be trusted to have no negative side-effects.
In the above, the following notation has been used:
| name | value | meaning |
|---------------|---------------|---------------|
| PROJECT | `$WM_PROJECT_DIR` | The OpenFOAM directory |
| PREFIX | `dirname $WM_PROJECT_DIR` | The OpenFOAM parent directory |
| API | `foamEtcFiles -show-api` | The api or release version |
| VERSION | `$WM_PROJECT_VERSION` | The version we've chosen |
To reduce the potential of false positive matches (perhaps some other
software also uses ThirdParty-xxx for its naming), the directory test
is accompanied by a OpenFOAM-specific sanity test. The OpenFOAM
ThirdParty directory will contain either an `Allwmake` file or a
`platforms/` directory.
<!-- OpenFOAM -->
[repo openfoam]: https://develop.openfoam.com/Development/OpenFOAM-plus/
[repo third]: https://develop.openfoam.com/Development/ThirdParty-plus/
[link openfoam-readme]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/README.md
[link openfoam-issues]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/BuildIssues.md
[link openfoam-config]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Config.md
[link openfoam-build]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Build.md
[link openfoam-require]: https://develop.openfoam.com/Development/OpenFOAM-plus/blob/develop/doc/Requirements.md
[link third-readme]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/README.md
[link third-build]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/BUILD.md
[link third-require]: https://develop.openfoam.com/Development/ThirdParty-plus/blob/develop/Requirements.md
# Useful Links
- [Download and installation instructions](http://www.openfoam.com/download/)
- [Documentation](http://www.openfoam.com/documentation)

View File

@ -1,13 +1,12 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
#------------------------------------------------------------------------------
if have_fftw
then
wmake $targetType
wmake
else
echo "==> skip dnsFoam solver (no FFTW)"
fi

View File

@ -44,14 +44,9 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Direct numerical simulation for boxes of isotropic turbulence."
);
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMeshNoClear.H"
#include "createControl.H"

View File

@ -31,6 +31,11 @@ IOdictionary transportProperties
Info<< "Reading diffusivity DT\n" << endl;
dimensionedScalar DT("DT", dimViscosity, transportProperties);
dimensionedScalar DT
(
"DT",
dimArea/dimTime,
transportProperties
);
#include "createFvOptions.H"

View File

@ -59,13 +59,9 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Laplace equation solver for a scalar quantity."
);
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"

View File

@ -47,4 +47,7 @@
Info<< "Reading diffusivity DT\n" << endl;
dimensionedScalar DT("DT", dimViscosity, transportProperties);
dimensionedScalar DT
(
transportProperties.lookup("DT")
);

View File

@ -60,12 +60,8 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Overset Laplace equation solver for a scalar quantity."
);
#include "setRootCase.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createNamedDynamicFvMesh.H"

View File

@ -1,4 +1,4 @@
if (runTime.writeTime())
if (runTime.outputTime())
{
volVectorField gradT(fvc::grad(T));

View File

@ -38,9 +38,10 @@ if (args.found("initialiseUBCs"))
// Construct a pressure field
// If it is available read it otherwise construct from the velocity BCs
// converting fixed-value BCs to zero-gradient and vice versa.
word pName("p");
// Allow override from command-line -pName option
const word pName = args.opt<word>("pName", "p");
// Update name of the pressure field from the command-line option
args.readIfPresent("pName", pName);
// Infer the pressure BCs from the velocity
wordList pBCTypes

View File

@ -38,9 +38,10 @@ if (args.found("initialiseUBCs"))
// Construct a pressure field
// If it is available read it otherwise construct from the velocity BCs
// converting fixed-value BCs to zero-gradient and vice versa.
word pName("p");
// Allow override from command-line -pName option
const word pName = args.opt<word>("pName", "p");
// Update name of the pressure field from the command-line option
args.readIfPresent("pName", pName);
// Infer the pressure BCs from the velocity
wordList pBCTypes

View File

@ -97,11 +97,6 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Overset potential flow solver which solves for the velocity potential"
);
argList::addOption
(
"pName",
@ -130,10 +125,10 @@ int main(int argc, char *argv[])
argList::addBoolOption
(
"withFunctionObjects",
"Execute functionObjects"
"execute functionObjects"
);
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createNamedDynamicFvMesh.H"

View File

@ -94,11 +94,6 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Potential flow solver which solves for the velocity potential"
);
argList::addOption
(
"pName",
@ -127,11 +122,11 @@ int main(int argc, char *argv[])
argList::addBoolOption
(
"withFunctionObjects",
"Execute functionObjects"
"execute functionObjects"
);
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"

View File

@ -47,7 +47,12 @@ IOdictionary transportProperties
Info<< "Reading diffusivity DT\n" << endl;
dimensionedScalar DT("DT", dimViscosity, transportProperties);
dimensionedScalar DT
(
"DT",
dimArea/dimTime,
transportProperties
);
#include "createPhi.H"

View File

@ -61,13 +61,8 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Passive scalar transport equation solver."
);
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"

View File

@ -86,16 +86,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for compressible premixed/partially-premixed combustion with"
" turbulence modelling."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
@ -121,7 +115,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "\n\nTime = " << runTime.timeName() << endl;
#include "rhoEqn.H"

View File

@ -71,13 +71,8 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for compressible premixed/partially-premixed combustion with"
" turbulence modelling."
);
#include "setRootCase.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
@ -106,8 +101,8 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
// Indicators for refinement.
// Note: before ++runTime only for post-processing reasons.
// Indicators for refinement. Note: before runTime++
// only for post-processing reasons.
tmp<volScalarField> tmagGradP = mag(fvc::grad(p));
volScalarField normalisedGradP
(
@ -117,7 +112,7 @@ int main(int argc, char *argv[])
normalisedGradP.writeOpt() = IOobject::AUTO_WRITE;
tmagGradP.clear();
++runTime;
runTime++;
Info<< "\n\nTime = " << runTime.timeName() << endl;

View File

@ -49,7 +49,7 @@ Foam::XiGModels::basicSubGrid::basicSubGrid
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
k1(XiGModelCoeffs_.get<scalar>("k1")),
k1(readScalar(XiGModelCoeffs_.lookup("k1"))),
XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
{}
@ -104,7 +104,7 @@ bool Foam::XiGModels::basicSubGrid::read(const dictionary& XiGProperties)
{
XiGModel::read(XiGProperties);
XiGModelCoeffs_.readEntry("k1", k1);
XiGModelCoeffs_.lookup("k1") >> k1;
return true;
}

View File

@ -81,7 +81,7 @@ bool Foam::PDRDragModel::read(const dictionary& PDRProperties)
{
PDRDragModelCoeffs_ = PDRProperties.optionalSubDict(type() + "Coeffs");
PDRDragModelCoeffs_.readEntry("drag", on_);
PDRDragModelCoeffs_.read("drag", on_);
return true;
}

View File

@ -165,8 +165,8 @@ bool Foam::PDRDragModels::basic::read(const dictionary& PDRProperties)
{
PDRDragModel::read(PDRProperties);
PDRDragModelCoeffs_.readEntry("Csu", Csu.value());
PDRDragModelCoeffs_.readEntry("Csk", Csk.value());
PDRDragModelCoeffs_.read("Csu", Csu.value());
PDRDragModelCoeffs_.read("Csk", Csk.value());
return true;
}

View File

@ -49,10 +49,13 @@ Foam::XiEqModels::Gulder::Gulder
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqCoef_(XiEqModelCoeffs_.get<scalar>("XiEqCoef")),
XiEqCoef_(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
SuMin_(0.01*Su.average()),
uPrimeCoef_(XiEqModelCoeffs_.get<scalar>("uPrimeCoef")),
subGridSchelkin_(XiEqModelCoeffs_.get<bool>("subGridSchelkin"))
uPrimeCoef_(readScalar(XiEqModelCoeffs_.lookup("uPrimeCoef"))),
subGridSchelkin_
(
readBool(XiEqModelCoeffs_.lookup("subGridSchelkin"))
)
{}
@ -93,9 +96,9 @@ bool Foam::XiEqModels::Gulder::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.readEntry("XiEqCoef", XiEqCoef_);
XiEqModelCoeffs_.readEntry("uPrimeCoef", uPrimeCoef_);
XiEqModelCoeffs_.readEntry("subGridSchelkin", subGridSchelkin_);
XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_;
XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_;
XiEqModelCoeffs_.lookup("subGridSchelkin") >> subGridSchelkin_;
return true;
}

View File

@ -49,12 +49,15 @@ Foam::XiEqModels::SCOPEXiEq::SCOPEXiEq
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqCoef_(XiEqModelCoeffs_.get<scalar>("XiEqCoef")),
XiEqExp_(XiEqModelCoeffs_.get<scalar>("XiEqExp")),
lCoef_(XiEqModelCoeffs_.get<scalar>("lCoef")),
XiEqCoef_(readScalar(XiEqModelCoeffs_.lookup("XiEqCoef"))),
XiEqExp_(readScalar(XiEqModelCoeffs_.lookup("XiEqExp"))),
lCoef_(readScalar(XiEqModelCoeffs_.lookup("lCoef"))),
SuMin_(0.01*Su.average()),
uPrimeCoef_(XiEqModelCoeffs_.get<scalar>("uPrimeCoef")),
subGridSchelkin_(XiEqModelCoeffs_.get<bool>("subGridSchelkin")),
uPrimeCoef_(readScalar(XiEqModelCoeffs_.lookup("uPrimeCoef"))),
subGridSchelkin_
(
readBool(XiEqModelCoeffs_.lookup("subGridSchelkin"))
),
MaModel
(
Su.mesh().lookupObject<IOdictionary>("combustionProperties"),
@ -144,11 +147,11 @@ bool Foam::XiEqModels::SCOPEXiEq::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.readEntry("XiEqCoef", XiEqCoef_);
XiEqModelCoeffs_.readEntry("XiEqExp", XiEqExp_);
XiEqModelCoeffs_.readEntry("lCoef", lCoef_);
XiEqModelCoeffs_.readEntry("uPrimeCoef", uPrimeCoef_);
XiEqModelCoeffs_.readEntry("subGridSchelkin", subGridSchelkin_);
XiEqModelCoeffs_.lookup("XiEqCoef") >> XiEqCoef_;
XiEqModelCoeffs_.lookup("XiEqExp") >> XiEqExp_;
XiEqModelCoeffs_.lookup("lCoef") >> lCoef_;
XiEqModelCoeffs_.lookup("uPrimeCoef") >> uPrimeCoef_;
XiEqModelCoeffs_.lookup("subGridSchelkin") >> subGridSchelkin_;
return true;
}

View File

@ -48,7 +48,7 @@ Foam::XiEqModel::XiEqModel
(
XiEqProperties.subDict
(
XiEqProperties.get<word>("XiEqModel") + "Coeffs"
word(XiEqProperties.lookup("XiEqModel")) + "Coeffs"
)
),
thermo_(thermo),
@ -142,10 +142,10 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
const scalarField upLocal(uPrimeCoef*sqrt((U & CT & U)*cellWidth));
const scalarField deltaUp(upLocal*(max(scalar(1), pow(nr, 0.5)) - 1.0));
const scalarField deltaUp(upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0));
// Re use tN
N.primitiveFieldRef() = upLocal*(max(scalar(1), pow(nr, 0.5)) - 1.0);
N.primitiveFieldRef() = upLocal*(max(scalar(1.0), pow(nr, 0.5)) - 1.0);
return tN;
}

View File

@ -35,7 +35,7 @@ Foam::autoPtr<Foam::XiEqModel> Foam::XiEqModel::New
const volScalarField& Su
)
{
const word modelType(propDict.get<word>("XiEqModel"));
const word modelType(propDict.lookup("XiEqModel"));
Info<< "Selecting flame-wrinkling model " << modelType << endl;

View File

@ -49,7 +49,7 @@ Foam::XiEqModels::instability::instability
)
:
XiEqModel(XiEqProperties, thermo, turbulence, Su),
XiEqIn(XiEqModelCoeffs_.get<scalar>("XiEqIn")),
XiEqIn(readScalar(XiEqModelCoeffs_.lookup("XiEqIn"))),
XiEqModel_(XiEqModel::New(XiEqModelCoeffs_, thermo, turbulence, Su))
{}
@ -73,7 +73,7 @@ bool Foam::XiEqModels::instability::read(const dictionary& XiEqProperties)
{
XiEqModel::read(XiEqProperties);
XiEqModelCoeffs_.readEntry("XiEqIn", XiEqIn);
XiEqModelCoeffs_.lookup("XiEqIn") >> XiEqIn;
return XiEqModel_->read(XiEqModelCoeffs_);
}

View File

@ -49,7 +49,7 @@ Foam::XiGModels::KTS::KTS
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
GEtaCoef_(XiGModelCoeffs_.get<scalar>("GEtaCoef"))
GEtaCoef_(readScalar(XiGModelCoeffs_.lookup("GEtaCoef")))
{}
@ -76,7 +76,7 @@ bool Foam::XiGModels::KTS::read(const dictionary& XiGProperties)
{
XiGModel::read(XiGProperties);
XiGModelCoeffs_.readEntry("GEtaCoef", GEtaCoef_);
XiGModelCoeffs_.lookup("GEtaCoef") >> GEtaCoef_;
return true;
}

View File

@ -48,7 +48,7 @@ Foam::XiGModel::XiGModel
(
XiGProperties.subDict
(
XiGProperties.get<word>("XiGModel") + "Coeffs"
word(XiGProperties.lookup("XiGModel")) + "Coeffs"
)
),
thermo_(thermo),

View File

@ -35,7 +35,7 @@ Foam::autoPtr<Foam::XiGModel> Foam::XiGModel::New
const volScalarField& Su
)
{
const word modelType(propDict.get<word>("XiGModel"));
const word modelType(propDict.lookup("XiGModel"));
Info<< "Selecting flame-wrinkling model " << modelType << endl;

View File

@ -49,8 +49,8 @@ Foam::XiGModels::instabilityG::instabilityG
)
:
XiGModel(XiGProperties, thermo, turbulence, Su),
GIn_("GIn", dimless/dimTime, XiGModelCoeffs_),
lambdaIn_("lambdaIn", dimLength, XiGModelCoeffs_),
GIn_(XiGModelCoeffs_.lookup("GIn")),
lambdaIn_(XiGModelCoeffs_.lookup("lambdaIn")),
XiGModel_(XiGModel::New(XiGModelCoeffs_, thermo, turbulence, Su))
{}
@ -86,8 +86,8 @@ bool Foam::XiGModels::instabilityG::read(const dictionary& XiGProperties)
{
XiGModel::read(XiGProperties);
XiGModelCoeffs_.readEntry("GIn", GIn_);
XiGModelCoeffs_.readEntry("lambdaIn", lambdaIn_);
XiGModelCoeffs_.lookup("GIn") >> GIn_;
XiGModelCoeffs_.lookup("lambdaIn") >> lambdaIn_;
return true;
}

View File

@ -51,7 +51,7 @@ Foam::XiModel::XiModel
(
XiProperties.subDict
(
XiProperties.get<word>("XiModel") + "Coeffs"
word(XiProperties.lookup("XiModel")) + "Coeffs"
)
),
thermo_(thermo),

View File

@ -38,7 +38,7 @@ Foam::autoPtr<Foam::XiModel> Foam::XiModel::New
const surfaceScalarField& phi
)
{
const word modelType(propDict.get<word>("XiModel"));
const word modelType(propDict.lookup("XiModel"));
Info<< "Selecting flame-wrinkling model " << modelType << endl;

View File

@ -52,7 +52,7 @@ Foam::XiModels::algebraic::algebraic
)
:
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
XiShapeCoef(XiModelCoeffs_.get<scalar>("XiShapeCoef")),
XiShapeCoef(readScalar(XiModelCoeffs_.lookup("XiShapeCoef"))),
XiEqModel_(XiEqModel::New(XiProperties, thermo, turbulence, Su)),
XiGModel_(XiGModel::New(XiProperties, thermo, turbulence, Su))
{}
@ -89,7 +89,7 @@ bool Foam::XiModels::algebraic::read(const dictionary& XiProperties)
{
XiModel::read(XiProperties);
XiModelCoeffs_.readEntry("XiShapeCoef", XiShapeCoef);
XiModelCoeffs_.lookup("XiShapeCoef") >> XiShapeCoef;
return true;
}

View File

@ -57,7 +57,7 @@ Foam::XiModels::transport::transport
)
:
XiModel(XiProperties, thermo, turbulence, Su, rho, b, phi),
XiShapeCoef(XiModelCoeffs_.get<scalar>("XiShapeCoef")),
XiShapeCoef(readScalar(XiModelCoeffs_.lookup("XiShapeCoef"))),
XiEqModel_(XiEqModel::New(XiProperties, thermo, turbulence, Su)),
XiGModel_(XiGModel::New(XiProperties, thermo, turbulence, Su))
{}
@ -136,7 +136,7 @@ bool Foam::XiModels::transport::read(const dictionary& XiProperties)
{
XiModel::read(XiProperties);
XiModelCoeffs_.readEntry("XiShapeCoef", XiShapeCoef);
XiModelCoeffs_.lookup("XiShapeCoef") >> XiShapeCoef;
return true;
}

View File

@ -53,8 +53,8 @@ Foam::laminarFlameSpeedModels::SCOPE::polynomial::polynomial
)
:
FixedList<scalar, 7>(polyDict.lookup("coefficients")),
ll(polyDict.get<scalar>("lowerLimit")),
ul(polyDict.get<scalar>("upperLimit")),
ll(readScalar(polyDict.lookup("lowerLimit"))),
ul(readScalar(polyDict.lookup("upperLimit"))),
llv(polyPhi(ll, *this)),
ulv(polyPhi(ul, *this)),
lu(0)
@ -75,30 +75,39 @@ Foam::laminarFlameSpeedModels::SCOPE::SCOPE
(
IFstream
(
dict.get<fileName>("fuelFile")
fileName
(
dict.lookup("fuelFile")
)
)()
).optionalSubDict(typeName + "Coeffs")
),
LFL_
(
coeffsDict_.getCompat<scalar>
readScalar
(
"lowerFlammabilityLimit",
{{"lowerFlamabilityLimit", 1712}}
coeffsDict_.lookupCompat
(
"lowerFlammabilityLimit",
{{"lowerFlamabilityLimit", 1712}}
)
)
),
UFL_
(
coeffsDict_.getCompat<scalar>
readScalar
(
"upperFlammabilityLimit",
{{"upperFlamabilityLimit", 1712}}
coeffsDict_.lookupCompat
(
"upperFlammabilityLimit",
{{"upperFlamabilityLimit", 1712}}
)
)
),
SuPolyL_(coeffsDict_.subDict("lowerSuPolynomial")),
SuPolyU_(coeffsDict_.subDict("upperSuPolynomial")),
Texp_(coeffsDict_.get<scalar>("Texp")),
pexp_(coeffsDict_.get<scalar>("pexp")),
Texp_(readScalar(coeffsDict_.lookup("Texp"))),
pexp_(readScalar(coeffsDict_.lookup("pexp"))),
MaPolyL_(coeffsDict_.subDict("lowerMaPolynomial")),
MaPolyU_(coeffsDict_.subDict("upperMaPolynomial"))
{
@ -408,7 +417,7 @@ Foam::laminarFlameSpeedModels::SCOPE::Ma() const
(
dimensionedScalar
(
"stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_
psiuReactionThermo_.lookup("stoichiometricAirFuelMassRatio")
)*ft/(scalar(1) - ft)
);
}
@ -449,7 +458,7 @@ Foam::laminarFlameSpeedModels::SCOPE::operator()() const
psiuReactionThermo_.Tu(),
dimensionedScalar
(
"stoichiometricAirFuelMassRatio", dimless, psiuReactionThermo_
psiuReactionThermo_.lookup("stoichiometricAirFuelMassRatio")
)*ft/(scalar(1) - ft)
);
}

View File

@ -67,15 +67,9 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for compressible premixed/partially-premixed combustion with"
" turbulence modelling."
);
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createControl.H"
@ -113,7 +107,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -65,17 +65,11 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for compressible premixed/partially-premixed combustion with"
" turbulence modelling in internal combustion engines."
);
#define CREATE_TIME createEngineTime.H
#define CREATE_MESH createEngineMesh.H
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createEngineTime.H"
#include "createEngineMesh.H"
#include "createControl.H"
@ -101,7 +95,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;

View File

@ -1,22 +1,15 @@
{
const scalar meanP = p.weightedAverage(mesh.V()).value();
const scalar meanT = thermo.T().weightedAverage(mesh.V()).value();
const scalar meanUp =
(sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value();
const scalar meanB = b.weightedAverage(mesh.V()).value();
Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl;
Info<< "Mean temperature:" << thermo.T().weightedAverage(mesh.V()).value()
<< endl;
Info<< "Mean u':"
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
<< endl;
Info<< "Mean pressure:" << meanP << nl
<< "Mean temperature:" << meanT << nl
<< "Mean u':" << meanUp << endl;
if (Pstream::master())
{
logSummaryFile()
<< runTime.theta() << tab
<< meanP << tab
<< meanT << tab
<< meanUp << tab
<< 1 - meanB
<< endl;
}
}
logSummaryFile()
<< runTime.theta() << tab
<< p.weightedAverage(mesh.V()).value() << tab
<< thermo.T().weightedAverage(mesh.V()).value() << tab
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
<< tab
<< 1 - b.weightedAverage(mesh.V()).value()
<< endl;

View File

@ -8,7 +8,7 @@ if (Pstream::master())
(
new OFstream
(
runTime.globalPath()
runTime.rootPath()/runTime.globalCaseName()
/("logSummary." + runTime.timeName() + ".dat")
)
);

View File

@ -65,16 +65,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for compressible premixed/partially-premixed combustion with"
" turbulence modelling."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
@ -98,7 +92,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"

View File

@ -12,34 +12,34 @@
)
);
const word SuModel
word SuModel
(
combustionProperties.get<word>("SuModel")
combustionProperties.lookup("SuModel")
);
dimensionedScalar sigmaExt
(
"sigmaExt", dimless/dimTime, combustionProperties
combustionProperties.lookup("sigmaExt")
);
const word XiModel
word XiModel
(
combustionProperties.get<word>("XiModel")
combustionProperties.lookup("XiModel")
);
dimensionedScalar XiCoef
(
"XiCoef", dimless, combustionProperties
combustionProperties.lookup("XiCoef")
);
dimensionedScalar XiShapeCoef
(
"XiShapeCoef", dimless, combustionProperties
combustionProperties.lookup("XiShapeCoef")
);
dimensionedScalar uPrimeCoef
(
"uPrimeCoef", dimless, combustionProperties
combustionProperties.lookup("uPrimeCoef")
);
ignition ign(combustionProperties, runTime, mesh);

View File

@ -32,6 +32,7 @@ Description
provide comparison against other chemistry solvers, that uses a single cell
mesh, and fields created from the initial conditions.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
@ -48,19 +49,13 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for chemistry problems, designed for use on single cell cases"
" to provide comparison against other chemistry solvers"
);
argList::noParallel();
#define CREATE_MESH createSingleCellMesh.H
#define NO_CONTROL
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createSingleCellMesh.H"
#include "createFields.H"
@ -78,7 +73,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "solveChemistry.H"

View File

@ -18,8 +18,8 @@
)
);
scalar p0 = initialConditions.get<scalar>("p");
scalar T0 = initialConditions.get<scalar>("T");
scalar p0 = readScalar(initialConditions.lookup("p"));
scalar T0 = readScalar(initialConditions.lookup("T"));
#include "createBaseFields.H"

View File

@ -1,3 +1,3 @@
runTime.controlDict().readEntry("adjustTimeStep", adjustTimeStep);
runTime.controlDict().read("adjustTimeStep", adjustTimeStep);
runTime.controlDict().readEntry("maxDeltaT", maxDeltaT);
runTime.controlDict().read("maxDeltaT", maxDeltaT);

View File

@ -1,13 +1,13 @@
word constProp(initialConditions.get<word>("constantProperty"));
if (constProp != "pressure" && constProp != "volume")
word constProp(initialConditions.lookup("constantProperty"));
if ((constProp != "pressure") && (constProp != "volume"))
{
FatalError << "in initialConditions, unknown constantProperty type "
<< constProp << nl << " Valid types are: pressure volume."
<< abort(FatalError);
}
word fractionBasis(initialConditions.get<word>("fractionBasis"));
if (fractionBasis != "mass" && fractionBasis != "mole")
word fractionBasis(initialConditions.lookup("fractionBasis"));
if ((fractionBasis != "mass") && (fractionBasis != "mole"))
{
FatalError << "in initialConditions, unknown fractionBasis type " << nl
<< "Valid types are: mass or mole."
@ -40,7 +40,7 @@
const word& name = Y[i].name();
if (fractions.found(name))
{
X0[i] = fractions.get<scalar>(name);
X0[i] = readScalar(fractions.lookup(name));
}
}
@ -64,7 +64,7 @@
const word& name = Y[i].name();
if (fractions.found(name))
{
Y0[i] = fractions.get<scalar>(name);
Y0[i] = readScalar(fractions.lookup(name));
}
}

View File

@ -45,16 +45,11 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for cold-flow in internal combustion engines."
);
#define CREATE_TIME createEngineTime.H
#define CREATE_MESH createEngineMesh.H
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createEngineTime.H"
#include "createEngineMesh.H"
#include "createControl.H"
@ -79,7 +74,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "Engine time = " << runTime.theta() << runTime.unit()
<< endl;

View File

@ -8,7 +8,7 @@ if (Pstream::master())
(
new OFstream
(
runTime.globalPath()
runTime.rootPath()/runTime.globalCaseName()
/("logSummary." + runTime.timeName() + ".dat")
)
);

View File

@ -8,7 +8,7 @@ SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.get<word>("inertSpecie"));
const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.species().found(inertSpecie))
{
FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -50,16 +50,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for fires and turbulent diffusion flames"
" with reacting particle clouds, surface film and pyrolysis modelling."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
@ -85,7 +79,7 @@ int main(int argc, char *argv[])
#include "setMultiRegionDeltaT.H"
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -8,7 +8,7 @@ thermo.validate(args.executable(), "h", "e");
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.get<word>("inertSpecie"));
const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.species().found(inertSpecie))
{
FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -47,15 +47,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for combustion with chemical reactions"
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
@ -90,7 +85,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -8,7 +8,7 @@ thermo.validate(args.executable(), "h", "e");
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.get<word>("inertSpecie"));
const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.species().found(inertSpecie))
{
FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -28,7 +28,7 @@ Group
grpCombustionSolvers
Description
Solver for combustion with chemical reactions using a density-based
Solver for combustion with chemical reactions using a density based
thermodynamics package with enhanced buoyancy treatment.
\*---------------------------------------------------------------------------*/
@ -47,17 +47,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for combustion with chemical reactions using density-based"
" thermodynamics package,"
" with enhanced buoyancy treatment."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
@ -92,7 +85,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -8,7 +8,7 @@ thermo.validate(args.executable(), "h", "e");
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.get<word>("inertSpecie"));
const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.species().found(inertSpecie))
{
FatalIOErrorIn(args.executable().c_str(), thermo)

View File

@ -28,7 +28,7 @@ Group
grpCombustionSolvers
Description
Solver for combustion with chemical reactions using density-based
Solver for combustion with chemical reactions using density based
thermodynamics package.
\*---------------------------------------------------------------------------*/
@ -48,16 +48,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for combustion with chemical reactions using density-based"
" thermodynamics package."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
@ -93,7 +87,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -29,7 +29,7 @@ License
const dictionary& pimpleDict = pimple.dict();
// Maximum flow Courant number
scalar maxCo(pimpleDict.get<scalar>("maxCo"));
scalar maxCo(readScalar(pimpleDict.lookup("maxCo")));
// Maximum time scale
scalar maxDeltaT(pimpleDict.lookupOrDefault<scalar>("maxDeltaT", GREAT));
@ -118,7 +118,7 @@ License
if (Yref.found(Yi.name()))
{
foundY = true;
const scalar Yrefi = Yref.get<scalar>(Yi.name());
scalar Yrefi = readScalar(Yref.lookup(Yi.name()));
rDeltaTY.field() = max
(
@ -170,7 +170,7 @@ License
rDeltaT = max
(
rDeltaT,
(scalar(1) - rDeltaTDampingCoeff)*rDeltaT0
(scalar(1.0) - rDeltaTDampingCoeff)*rDeltaT0
);
}

View File

@ -84,7 +84,7 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")),
accommodationCoeff_(dict.get<scalar>("accommodationCoeff")),
accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))),
Twall_("Twall", dict, p.size()),
gamma_(dict.lookupOrDefault<scalar>("gamma", 1.4))
{
@ -94,8 +94,10 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
|| mag(accommodationCoeff_) > 2.0
)
{
FatalIOErrorInFunction(dict)
<< "unphysical accommodationCoeff specified"
FatalIOErrorInFunction
(
dict
) << "unphysical accommodationCoeff specified"
<< "(0 < accommodationCoeff <= 1)" << endl
<< exit(FatalIOError);
}

View File

@ -85,7 +85,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")),
tauMCName_(dict.lookupOrDefault<word>("tauMC", "tauMC")),
accommodationCoeff_(dict.get<scalar>("accommodationCoeff")),
accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))),
Uwall_("Uwall", dict, p.size()),
thermalCreep_(dict.lookupOrDefault("thermalCreep", true)),
curvature_(dict.lookupOrDefault("curvature", true))
@ -96,8 +96,10 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|| mag(accommodationCoeff_) > 2.0
)
{
FatalIOErrorInFunction(dict)
<< "unphysical accommodationCoeff_ specified"
FatalIOErrorInFunction
(
dict
) << "unphysical accommodationCoeff_ specified"
<< "(0 < accommodationCoeff_ <= 1)" << endl
<< exit(FatalIOError);
}
@ -118,7 +120,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
else
{
this->refValue() = *this;
this->valueFraction() = scalar(1);
this->valueFraction() = scalar(1.0);
}
}
}

View File

@ -28,9 +28,8 @@ Group
grpCompressibleSolvers grpMovingMeshSolvers
Description
Density-based compressible flow solver based on central-upwind
schemes of Kurganov and Tadmor
with support for mesh-motion and topology changes.
Density-based compressible flow solver based on central-upwind schemes of
Kurganov and Tadmor with support for mesh-motion and topology changes.
\*---------------------------------------------------------------------------*/
@ -48,17 +47,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Density-based compressible flow solver based on central-upwind"
" schemes of Kurganov and Tadmor.\n"
"With support for mesh-motion and topology changes."
);
#define NO_CONTROL
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createFields.H"
@ -84,7 +76,7 @@ int main(int argc, char *argv[])
#include "readTimeControls.H"
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -28,8 +28,8 @@ Group
grpCompressibleSolvers
Description
Density-based compressible flow solver based on central-upwind
schemes of Kurganov and Tadmor.
Density-based compressible flow solver based on central-upwind schemes of
Kurganov and Tadmor.
\*---------------------------------------------------------------------------*/
@ -45,17 +45,11 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Density-based compressible flow solver based on central-upwind"
" schemes of Kurganov and Tadmor."
);
#define NO_CONTROL
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
@ -166,7 +160,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -25,8 +25,8 @@
if (!local)
{
const scalar T0 = eosDict.get<scalar>("T0");
const scalar p0 = eosDict.get<scalar>("p0");
const scalar T0 = readScalar(eosDict.lookup("T0"));
const scalar p0 = readScalar(eosDict.lookup("p0"));
he = thermo.he(p, pow(p/p0, (gamma - scalar(1))/gamma)*T0);
}

View File

@ -58,17 +58,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for laminar or turbulent flow"
" of weakly compressible fluids for low Mach number"
" aeroacoustic applications."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
@ -88,7 +81,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -1,53 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Global
continuityErrs
Description
Calculates and prints the continuity errors.
\*---------------------------------------------------------------------------*/
{
dimensionedScalar totalMass = fvc::domainIntegrate(cellMask*rho);
scalar sumLocalContErr =
(
fvc::domainIntegrate(mag(cellMask*(rho - thermo.rho())))/totalMass
).value();
scalar globalContErr =
(
fvc::domainIntegrate(cellMask*(rho - thermo.rho()))/totalMass
).value();
cumulativeContErr += globalContErr;
Info<< "time step continuity errors : sum local = " << sumLocalContErr
<< ", global = " << globalContErr
<< ", cumulative = " << cumulativeContErr
<< endl;
}
// ************************************************************************* //

View File

@ -1,84 +1,11 @@
if (mesh.changing())
{
volVectorField::Boundary& bfld = U.boundaryFieldRef();
forAll(bfld, patchi)
{
if (bfld[patchi].fixesValue())
{
bfld[patchi].initEvaluate();
}
}
surfaceScalarField::Boundary& phiBfld = phi.boundaryFieldRef();
forAll(bfld, patchi)
{
if (bfld[patchi].fixesValue())
{
bfld[patchi].evaluate();
phiBfld[patchi] =
rho.boundaryField()[patchi]
* (
bfld[patchi]
& mesh.Sf().boundaryField()[patchi]
);
}
}
}
// Initialize BCs list for pcorr to zero-gradient
wordList pcorrTypes
(
p.boundaryField().size(),
zeroGradientFvPatchScalarField::typeName
);
// Set BCs of pcorr to fixed-value for patches at which p is fixed
forAll(p.boundaryField(), patchi)
{
if (p.boundaryField()[patchi].fixesValue())
{
pcorrTypes[patchi] = fixedValueFvPatchScalarField::typeName;
}
}
volScalarField pcorr
(
IOobject
(
"pcorr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar(p.dimensions(), Zero),
pcorrTypes
);
mesh.setFluxRequired(pcorr.name());
{
dimensionedScalar rAUf("rAUf", dimTime, 1.0);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pcorrEqn
(
fvm::ddt(psi, pcorr)
+ fvc::div(phi)
- fvm::laplacian(rAUf, pcorr)
==
divrhoU()
);
pcorrEqn.solve(mesh.solver(pcorr.select(pimple.finalInnerIter())));
//Bypass virtual layer
//mesh.fvMesh::solve(pcorrEqn, d);
if (pimple.finalNonOrthogonalIter())
{
phi += pcorrEqn.flux();
}
}
}
CorrectPhi
(
U,
phi,
p,
rho,
psi,
dimensionedScalar("rAUf", dimTime, 1),
divrhoU,
pimple
);

View File

@ -1,4 +1,11 @@
bool ddtCorr
#include "createTimeControls.H"
bool correctPhi
(
pimple.dict().lookupOrDefault("ddtCorr", true)
pimple.dict().lookupOrDefault("correctPhi", true)
);
bool checkMeshCourantNo
(
pimple.dict().lookupOrDefault("checkMeshCourantNo", false)
);

View File

@ -1,10 +1,10 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<fluidThermo> pThermo
autoPtr<psiThermo> pThermo
(
fluidThermo::New(mesh)
psiThermo::New(mesh)
);
fluidThermo& thermo = pThermo();
psiThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e");
volScalarField& p = thermo.p();
@ -39,8 +39,6 @@ volVectorField U
#include "compressibleCreatePhi.H"
pressureControl pressureControl(p, rho, pimple.dict(), false);
dimensionedScalar rhoMax
(
dimensionedScalar::lookupOrDefault
@ -65,25 +63,42 @@ dimensionedScalar rhoMin
mesh.setFluxRequired(p.name());
#include "createDpdt.H"
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt
(
IOobject
(
"dpdt",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar(p.dimensions()/dimTime, Zero)
);
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
#include "createK.H"
//- Overset specific
// Add solver-specific interpolations
{
wordHashSet& nonInt =
const_cast<wordHashSet&>(Stencil::New(mesh).nonInterpolatedFields());
dictionary oversetDict;
oversetDict.add("U", true);
oversetDict.add("p", true);
oversetDict.add("HbyA", true);
oversetDict.add("grad(p)", true);
nonInt.insert("HbyA");
nonInt.insert("grad(p)");
nonInt.insert("surfaceIntegrate(phi)");
nonInt.insert("surfaceIntegrate(phiHbyA)");
nonInt.insert("cellMask");
nonInt.insert("cellDisplacement");
nonInt.insert("interpolatedCells");
nonInt.insert("cellInterpolationWeight");
const_cast<dictionary&>
(
mesh.schemesDict()
).add
(
"oversetInterpolationRequired",
oversetDict,
true
);
}
// Mask field for zeroing out contributions on hole cells

View File

@ -38,11 +38,10 @@ Description
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "fluidThermo.H"
#include "psiThermo.H"
#include "turbulentFluidThermoModel.H"
#include "bound.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "CorrectPhi.H"
#include "fvOptions.H"
#include "localEulerDdtScheme.H"
@ -54,22 +53,16 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for compressible turbulent flow.\n"
"With optional mesh motion and mesh topology changes."
);
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
#include "createControl.H"
#include "createRDeltaT.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H"
#include "createRhoUfIfPresent.H"
#include "createRhoUf.H"
#include "createControls.H"
turbulence->validate();
@ -87,107 +80,66 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readControls.H"
#include "readDyMControls.H"
// Store divrhoU from the previous mesh so that it can be mapped
// and used in correctPhi to ensure the corrected phi has the
// same divergence
autoPtr<volScalarField> divrhoU;
if (correctPhi)
{
divrhoU.reset
// Store divrhoU from the previous mesh so that it can be mapped
// and used in correctPhi to ensure the corrected phi has the
// same divergence
volScalarField divrhoU
(
new volScalarField
(
"divrhoU",
fvc::div(fvc::absolute(phi, rho, U))
)
"divrhoU",
fvc::div(fvc::absolute(phi, rho, U))
);
if (LTS)
{
#include "setRDeltaT.H"
}
else
{
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
}
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
// Store momentum to set rhoUf for introduced faces.
volVectorField rhoU("rhoU", rho*U);
// Do any mesh changes
mesh.update();
if (mesh.changing())
{
#include "setCellMask.H"
}
if (mesh.changing() && correctPhi)
{
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf;
#include "correctPhi.H"
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
}
}
if (LTS)
if (mesh.changing() && checkMeshCourantNo)
{
#include "setRDeltaT.H"
}
else
{
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
#include "meshCourantNo.H"
}
++runTime;
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "rhoEqn.H"
Info<< "rhoEqn max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
if (pimple.firstIter() || moveMeshOuterCorrectors)
{
// Do any mesh changes
mesh.update();
if (mesh.changing())
{
MRF.update();
#include "setCellMask.H"
const surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
// Zero Uf on old faceMask (H-I)
rhoUf() *= faceMaskOld;
surfaceVectorField rhoUfint(fvc::interpolate(rho*U));
// Update Uf and phi on new C-I faces
rhoUf() += (1-faceMaskOld)*rhoUfint;
// Update Uf boundary
forAll(rhoUf().boundaryField(), patchI)
{
rhoUf().boundaryFieldRef()[patchI] =
rhoUfint.boundaryField()[patchI];
}
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf();
if (correctPhi)
{
#include "correctPhi.H"
}
// Zero phi on current H-I
const surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;
U *= cellMask;
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
}
if (checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
if (pimple.firstIter() && !pimple.SIMPLErho())
{
#include "rhoEqn.H"
}
#include "UEqn.H"
#include "EEqn.H"
@ -203,8 +155,6 @@ int main(int argc, char *argv[])
}
}
rho = thermo.rho();
runTime.write();
runTime.printExecutionTime(Info);

View File

@ -1,93 +1,80 @@
if (!pimple.SIMPLErho())
{
rho = thermo.rho();
}
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution
const volScalarField psip0(psi*p);
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
volScalarField rAU("rAU", 1.0/UEqn.A());
mesh.interpolate(rAU);
surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", faceMask*fvc::interpolate(rho*rAU));
volVectorField HbyA("HbyA", U);
HbyA = constrainHbyA(rAU*UEqn.H(), U, p);
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);
if (pimple.nCorrPISO() <= 1)
{
tUEqn.clear();
}
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)*fvc::flux(HbyA)
);
if (ddtCorr)
{
surfaceScalarField faceMaskOld
(
localMin<scalar>(mesh).interpolate(cellMask.oldTime())
);
phiHbyA +=
faceMaskOld*MRF.zeroFilter(rhorAUf*fvc::ddtCorr(rho, U, phi, rhoUf));
}
fvc::makeRelative(phiHbyA, rho, U);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
if (pimple.transonic())
{
surfaceScalarField phid
(
"phid",
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
fvc::interpolate(psi)
*(
fvc::flux(HbyA)
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho)
)
);
phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
fvScalarMatrix pDDtEqn
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvc::div(phiHbyA) + fvm::div(phid, p)
==
fvOptions(psi, p, rho.name())
);
fvc::makeRelative(phid, psi, U);
MRF.makeRelative(fvc::interpolate(psi), phid);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rhorAUf, p)
==
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
if (pimple.finalNonOrthogonalIter())
{
phi = phiHbyA + pEqn.flux();
phi == pEqn.flux();
}
}
}
else
{
fvScalarMatrix pDDtEqn
surfaceScalarField phiHbyA
(
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvc::div(phiHbyA)
==
fvOptions(psi, p, rho.name())
"phiHbyA",
fvc::flux(rho*HbyA)
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)
);
fvc::makeRelative(phiHbyA, rho, U);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
// Pressure corrector
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvc::div(phiHbyA)
- fvm::laplacian(rhorAUf, p)
==
fvOptions(psi, p, rho.name())
);
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
@ -104,24 +91,25 @@ else
// Explicitly relax pressure for momentum corrector
p.relax();
// Recalculate density from the relaxed pressure
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
Info<< "rho max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;
volVectorField gradP(fvc::grad(p));
//mesh.interpolate(gradP);
U = cellMask*(HbyA - rAU*gradP);
U = HbyA - rAU*cellMask*gradP;
U.correctBoundaryConditions();
fvOptions.correct(U);
K = 0.5*magSqr(U);
if (pressureControl.limit(p))
{
p.correctBoundaryConditions();
}
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ;
rho = thermo.rho();
{
// Correct rhoUf if the mesh is moving
fvc::correctRhoUf(rhoUf, rho, U, phi);
rhoUf = fvc::interpolate(rho*U);
surfaceVectorField n(mesh.Sf()/mesh.magSf());
rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
}
if (thermo.dpdt())
@ -133,9 +121,3 @@ if (thermo.dpdt())
dpdt -= fvc::div(fvc::meshPhi(rho, U), p);
}
}
surfaceScalarField faceMask
(
localMin<scalar>(mesh).interpolate(cellMask)
);
phi *= faceMask;

View File

@ -1,9 +1,6 @@
#include "readTimeControls.H"
correctPhi = pimple.dict().lookupOrDefault("correctPhi", false);
correctPhi = pimple.dict().lookupOrDefault("correctPhi", true);
checkMeshCourantNo =
pimple.dict().lookupOrDefault("checkMeshCourantNo", false);
ddtCorr = pimple.dict().lookupOrDefault("ddtCorr", true);

View File

@ -52,16 +52,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for compressible turbulent flow.\n"
"With optional mesh motion and mesh topology changes."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
@ -112,7 +106,7 @@ int main(int argc, char *argv[])
#include "setDeltaT.H"
}
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -28,7 +28,7 @@ Group
grpCompressibleSolvers
Description
Overset steady-state solver for compressible turbulent flow.
Overset steady-state solver for turbulent flow of compressible fluids.
\*---------------------------------------------------------------------------*/
@ -47,15 +47,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Overset steady-state solver for compressible turbulent flow"
);
#define CREATE_MESH createUpdatedDynamicFvMesh.H
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createUpdatedDynamicFvMesh.H"
#include "createControl.H"

View File

@ -28,8 +28,8 @@ Group
grpCompressibleSolvers
Description
Steady-state solver for compressible turbulent flow,
with implicit or explicit porosity treatment and optional sources.
Steady-state solver for turbulent flow of compressible fluids, with
implicit or explicit porosity treatment and optional sources.
\*---------------------------------------------------------------------------*/
@ -45,16 +45,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Steady-state solver for compressible turbulent flow,"
"with implicit or explicit porosity treatment and optional sources."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"

View File

@ -28,7 +28,7 @@ Group
grpCompressibleSolvers
Description
Steady-state solver for compressible turbulent flow.
Steady-state solver for turbulent flow of compressible fluids.
\*---------------------------------------------------------------------------*/
@ -43,15 +43,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Steady-state solver for compressible turbulent flow."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"

View File

@ -45,16 +45,9 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for trans-sonic/supersonic, turbulent flow"
" of a compressible gas.\n"
"With optional mesh motion and mesh topology changes."
);
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createDyMControls.H"
@ -88,7 +81,7 @@ int main(int argc, char *argv[])
#include "compressibleCourantNo.H"
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -43,16 +43,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for trans-sonic/supersonic, turbulent flow"
" of a compressible gas."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"

View File

@ -40,16 +40,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for trans-sonic/supersonic, laminar flow"
" of a compressible liquid."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"

View File

@ -28,8 +28,8 @@ Group
grpDiscreteMethodsSolvers
Description
Direct simulation Monte Carlo (DSMC) solver
for transient, multi-species flows.
Direct simulation Monte Carlo (DSMC) solver for, transient, multi-species
flows.
\*---------------------------------------------------------------------------*/
@ -40,17 +40,11 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Direct simulation Monte Carlo (DSMC) solver"
" for transient, multi-species flows."
);
#define NO_CONTROL
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"

View File

@ -37,13 +37,8 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Equilibrate and/or precondition molecular dynamics systems."
);
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"

View File

@ -12,7 +12,7 @@ IOdictionary mdEquilibrationDict
)
);
scalar targetTemperature
scalar targetTemperature = readScalar
(
mdEquilibrationDict.get<scalar>("targetTemperature")
mdEquilibrationDict.lookup("targetTemperature")
);

View File

@ -39,15 +39,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Molecular dynamics solver for fluid dynamics."
);
#define NO_CONTROL
#include "postProcess.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"

View File

@ -14,16 +14,12 @@
dimensionedScalar epsilon0
(
"epsilon0",
dimensionSet(-1, -3, 4, 0, 0, 2, 0),
physicalProperties
physicalProperties.lookup("epsilon0")
);
dimensionedScalar k
(
"k",
dimensionSet(-1, 0, 2, 0, 0, 1, 0),
physicalProperties
physicalProperties.lookup("k")
);

View File

@ -38,13 +38,9 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for electrostatics."
);
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"

View File

@ -47,31 +47,26 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for the magnetic field generated by permanent magnets."
);
argList::addBoolOption
(
"noH",
"Do not write the magnetic field intensity field"
"do not write the magnetic field intensity field"
);
argList::addBoolOption
(
"noB",
"Do not write the magnetic flux density field"
"do not write the magnetic flux density field"
);
argList::addBoolOption
(
"HdotGradH",
"Write the paramagnetic particle force field"
"write the paramagnetic particle force field"
);
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
@ -83,7 +78,7 @@ int main(int argc, char *argv[])
Info<< "Calculating the magnetic field potential" << endl;
++runTime;
runTime++;
while (simple.correctNonOrthogonal())
{

View File

@ -58,17 +58,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solver for magnetohydrodynamics (MHD):"
" incompressible, laminar flow of a conducting fluid"
" under the influence of a magnetic field."
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"

View File

@ -16,21 +16,21 @@ dimensionedScalar strike
(
"strike",
dimLength,
financialProperties
financialProperties.lookup("strike")
);
dimensionedScalar r
(
"r",
dimless/dimTime,
financialProperties
financialProperties.lookup("r")
);
dimensionedScalar sigma
(
"sigma",
dimensionSet(0, 0, -0.5, 0, 0),
financialProperties
financialProperties.lookup("sigma")
);
dimensionedScalar sigmaSqr = sqr(sigma);

View File

@ -40,16 +40,11 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Solves the Black-Scholes equation to price commodities."
);
#define NO_CONTROL
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"

View File

View File

View File

@ -47,13 +47,7 @@ Author
int main(int argc, char *argv[])
{
argList::addNote
(
"Transient solver for incompressible, laminar flow"
" of Newtonian fluids in liquid film formulation."
);
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFaMesh.H"
@ -73,7 +67,7 @@ int main(int argc, char *argv[])
#include "capillaryCourantNo.H"
#include "setDeltaT.H"
++runTime;
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
@ -144,7 +138,7 @@ int main(int argc, char *argv[])
Us.correctBoundaryConditions();
}
if (runTime.writeTime())
if (runTime.outputTime())
{
vsm.mapToVolume(h, H.boundaryFieldRef());
vsm.mapToVolume(Us, U.boundaryFieldRef());

View File

@ -10,12 +10,32 @@ IOdictionary transportProperties
)
);
dimensionedScalar mug("mug", dimViscosity, transportProperties);
dimensionedScalar mul("mul", dimViscosity, transportProperties);
dimensionedScalar mug
(
transportProperties.lookup("mug")
);
dimensionedScalar rhog("rhog", dimDensity, transportProperties);
dimensionedScalar rhol("rhol", dimDensity, transportProperties);
dimensionedScalar mul
(
transportProperties.lookup("mul")
);
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties);
dimensionedScalar sigma
(
transportProperties.lookup("sigma")
);
dimensionedScalar h0("h0", dimLength, transportProperties);
dimensionedScalar rhol
(
transportProperties.lookup("rhol")
);
dimensionedScalar rhog
(
transportProperties.lookup("rhog")
);
dimensionedScalar h0
(
transportProperties.lookup("h0")
);

View File

@ -1,3 +1,3 @@
sphereSurfactantFoam.C
surfactantFoam.C
EXE = $(FOAM_APPBIN)/sphereSurfactantFoam

View File

@ -12,13 +12,25 @@ areaScalarField Cs
aMesh
);
dimensionedScalar Cs0("Cs0", dimMass/dimArea, 1.0);
dimensioned<scalar> Cs0
(
"Cs0",
dimensionSet(1, -2, 0, 0, 0, 0, 0),
1.0
);
const areaVectorField& R = aMesh.areaCentres();
Cs = Cs0*(1.0 + R.component(vector::X)/mag(R));
dimensionedScalar Ds("Ds", dimViscosity, 1.0);
dimensioned<scalar> Ds
(
"Ds",
dimensionSet(0, 2, -1, 0, 0, 0, 0),
1.0
);
areaVectorField Us
(
@ -36,7 +48,7 @@ areaVectorField Us
dimensioned<scalar> Uinf("Uinf", dimVelocity, 1.0);
forAll(Us, faceI)
forAll (Us, faceI)
{
Us[faceI].x() =
Uinf.value()*(0.25*(3.0 + sqr(R[faceI].x()/mag(R[faceI]))) - 1.0);

View File

@ -41,14 +41,10 @@ Description
int main(int argc, char *argv[])
{
argList::addNote
(
"Passive finiteArea scalar transport on a sphere"
);
#include "setRootCaseLists.H"
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFaMesh.H"
#include "createFaFields.H"
#include "createVolFields.H"

Some files were not shown because too many files have changed in this diff Show More