60 Commits

Author SHA1 Message Date
47517f2ebb zoltanRenumber: include required PstreamGlobals.H 2019-07-08 10:50:27 +01:00
fa12851880 blockMeshMerge: Increased merge tolerance
Resolves bug-report https://bugs.openfoam.org/view.php?id=3233
2019-05-30 16:34:07 +01:00
76a8284120 scotch: Upgraded to latest version
Avoids problems compiling with MPI-3.0
See https://bugs.openfoam.org/view.php?id=3216
2019-04-08 10:52:49 +01:00
eb0ce5d792 blockMeshMerge: Changed the mergeSqrDist slightly to compensate for the change SMALL -> small
Resolves bug-report https://bugs.openfoam.org/view.php?id=3203
2019-03-19 16:36:35 +00:00
fa2ea1098a Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-6 2019-03-15 11:53:09 +00:00
a9f850781a Removed redundant file 2019-03-15 11:52:54 +00:00
fdfb5b1825 data: Reset solver data only when non-sub cycled time index changes
Resolves bug report https://bugs.openfoam.org/view.php?id=3189
2019-03-08 09:11:34 +00:00
f92a7e7854 swirlFlowRateInletVelocityFvPatchVectorField: Added reduction to patch size
Resolves bug-report https://bugs.openfoam.org/view.php?id=3185
2019-03-05 12:08:49 +00:00
e29811f5df convergenceControl: Store solve index per-field not per-entry
Resolves bug report https://bugs.openfoam.org/view.php?id=3173
2019-02-20 14:38:05 +00:00
d93375f714 freestream[Pressure|Velocity]FvPatchScalarField: Updated for clang 2019-02-15 15:46:38 +00:00
6b3f9c0b97 particle: Fixed ACMI transfers
The optimisation work done as commit 81947c80 introduced a failure mode
where an ACMI interaction could repeat indefinitely. This has now been
corrected.

Resolves bug report https://bugs.openfoam.org/view.php?id=3166
2019-02-12 15:53:43 +00:00
0d4d30aa29 freestreamVelocity/Pressure BC: stabilise in the limit of mag(Up) = 0 2019-02-04 20:58:06 +00:00
039d77aae4 tutorial simplifiedSiwek: Updated chemistry stability settings for the new Jacobian
Resolves bug-report https://bugs.openfoam.org/view.php?id=3155
2019-01-29 22:36:44 +00:00
bdc14dcd3d liquidProperties::N2: Corrected mu coefficient
Resolves bug-report https://bugs.openfoam.org/view.php?id=3136
2019-01-28 17:35:39 +00:00
96e04780bf vtkUnstructuredReader: Added support for VTK files with METADATA
Patch contributed by Timo Niemi, VTT.
Resolves patch request https://bugs.openfoam.org/view.php?id=3149
2019-01-16 11:21:59 +00:00
6257b17a4c paraFoam: launches ParaView with Mesa OpenGL if exists
Can be overridden to use System GL by setting "export ParaView_GL=system" in .bashrc
2019-01-08 16:54:17 +00:00
f934eabb0d streamlines: Updated tutorials for new caseDicts 2018-12-21 14:31:18 +00:00
2051acedfb paraFoam: attempts to launch ParaView with Mesa OpenGL if system OpenGL fails
A new "-empty" option launches ParaView without opening any files.  This enables users
to run ParaView using the paraFoam script for all data (OpenFOAM or otherwise), making
use of the automatic launching with Mesa if system OpenGL fails.

To view OpenFOAM case files, run "paraFoam".
To view other data files, run "paraFoam -empty" and open the files within ParaView.
2018-12-20 18:43:40 +00:00
9f9576a0e7 reactingMultiphaseEulerFoam: Fixed potential double usage of rho tmp 2018-12-13 16:37:31 +00:00
4086512c69 reactingMultiphaseEulerFoam: Updated EEqns for stationary phase
Resolves bug report https://bugs.openfoam.org/view.php?id=3132
2018-12-13 16:13:37 +00:00
aa3caf5ada mixerVesselAMI: changed field files to ASCII and updated mesh settings 2018-12-12 21:21:17 +00:00
d389aa1ac1 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-6 2018-12-11 15:48:44 +00:00
2e8f733e4e fieldAverageItem: Updated
Resolves bug-report https://bugs.openfoam.org/view.php?id=3130
2018-12-11 15:47:57 +00:00
d1c655e7b8 streamlines: updated packaged function objects for new seeding methods 2018-12-10 13:06:14 +00:00
072bc78266 functionObjects::fieldAverageItem: Corrected writing of prime2Mean
Resolves bug-report https://bugs.openfoam.org/view.php?id=3122
2018-12-10 10:49:30 +00:00
d8da4bd092 config.sh/aliases: corrected wmRefresh for POSIX compliance 2018-12-04 21:32:25 +00:00
637e93fabd config.sh/aliases: removed "declare" for POSIX compliance 2018-12-04 16:45:22 +00:00
d3fd147e6c foamGet: added directory target for scalar field s 2018-11-26 11:21:03 +00:00
4fb28506e8 foamGet: selecting target directory based on file name 2018-11-23 19:16:33 +00:00
b492054bfd caseDicts: added example All* workflow scripts 2018-11-23 18:50:45 +00:00
0602504866 Allmesh scripts: removed unused variables and legacy syntax 2018-11-23 18:42:07 +00:00
9763346f31 chtMultiRegionFoam: Only do closed volume handling when running steady
This resolves bug report https://bugs.openfoam.org/view.php?id=3105
2018-11-13 09:28:01 +00:00
00e347c45a Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-6 2018-10-15 10:30:34 +01:00
1cc13ef87a etc/config.sh/aliases: use a direct call to $wmProjectDir/etc/config.sh/unset rather than the wmUnset alias
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=3088
2018-10-15 10:28:52 +01:00
166e3a7a1f KinematicParcel: Do not execute face/patch functions when inactive
Resolves bug report https://bugs.openfoam.org/view.php?id=3084
2018-10-12 10:37:19 +01:00
1bc13ff592 doc/Doxygen/Doxyfile: Increased FORMULA_FONTSIZE to 16 2018-10-07 10:26:52 +01:00
2e39b995f6 template cases for rotating geometry: modify fields with AMI creation 2018-10-01 14:33:30 +01:00
35b809176d template cases: updated for change from pimpleDyMFoam to pimpleFoam 2018-10-01 14:25:56 +01:00
dea248aecd Doxyfile: Added amsmath to EXTRA_PACKAGES for complex equation formatting 2018-09-25 08:30:39 +01:00
26e2dcd5c7 Downgraded OpenMPI to 2.1.1 to avoid bug in the new "vader" shared memory module
Resolves bug-report https://bugs.openfoam.org/view.php?id=3071
2018-09-21 09:56:27 +01:00
af7d7f427b Downgraded OpenMPI to 3.0.2 to avoid bug in latest version
Resolves bug-report https://bugs.openfoam.org/view.php?id=3071
2018-09-14 00:02:23 +01:00
9afef77a90 gambitToFoam: Removed \file statement in header 2018-09-07 16:36:28 +01:00
d2c4174c4c Created .C files corresponding to the <application>.L files for Doxygen and -doc option
Resolves bug-report https://bugs.openfoam.org/view.php?id=3070
2018-09-07 15:13:24 +01:00
199f87f327 Doxyfile: include .L files and exclude .C files which clash with application source files
Resolves bug-report https://bugs.openfoam.org/view.php?id=3070
2018-09-06 18:06:49 +01:00
a9be0f471a doc/Doxygen/Doxyfile: Exclude src/mesh/blockMesh/blockMesh/blockMesh.C
to avoid clash with the blockMesh.C application source file
2018-09-06 00:02:48 +01:00
9668a8ca7b etc/controlDict: Updated online documentation link
Resolves bug-report https://bugs.openfoam.org/view.php?id=3067
2018-09-05 18:06:54 +01:00
32081b60f4 pimpleFoam: Corrected application name 2018-09-05 18:06:38 +01:00
37207f3279 greyDiffusiveRadiationMixedFvPatchScalarField, wideBandDiffusiveRadiationMixedFvPatchScalarField: Added mapping functions
Patch contributed by Timo Niemi, VTT.
Resolves patch request https://bugs.openfoam.org/view.php?id=3062
2018-08-31 16:04:43 +01:00
b38715c4b1 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-6 2018-08-13 14:49:52 +01:00
a2c8fc63d9 PDRFoam: Added betav to ddtCorr
Resolves bug-report https://bugs.openfoam.org/view.php?id=3014
2018-08-13 14:49:42 +01:00
1e3889d08a Updated OpenMPI version to 2.1.3
As commit fa095c1f, but csh settings
2018-08-13 08:51:16 +01:00
fa095c1fe8 Updated OpenMPI version to 2.1.3
This has been done in order to avoid "'aclocal-1.15' is missing on your
system" errors on systems which now ship with autoconf version 1.16.
2018-08-13 08:48:52 +01:00
535d1a46d2 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-6 2018-08-12 19:08:56 +01:00
bf2812ed5a water/thermophysicalProperties: Changed equation of state to perfectFluid 2018-08-12 19:05:57 +01:00
abb4358f2b wallHeatTransferCoeff: Avoid holding references to temporary fields 2018-08-09 10:57:50 +01:00
6f23328ef8 wallHeatFlux: Avoid holding references to temporary fields 2018-08-08 18:38:08 +01:00
c170b24e8e foamUpdateCaseFileHeader: Deleted because out of date and unmaintained 2018-08-08 15:36:43 +01:00
8bb011e46a tutorials/incompressible/simpleFoam/turbineSiting: Corrected header 2018-08-07 14:37:58 +01:00
9917d8a761 tutorials/incompressible/pimpleFoam/RAS/wingMotion: Corrected U BCs
Resolves bug-report https://bugs.openfoam.org/view.php?id=3029
2018-08-07 14:37:27 +01:00
0f14683c11 functionObjects: Generating and storing fields on demand rather than on construction
Resolves bug report https://bugs.openfoam.org/view.php?id=3019
2018-08-06 09:36:16 +01:00
91 changed files with 944 additions and 735 deletions

View File

@ -146,7 +146,7 @@ void PDRkEpsilon::correct()
volScalarField GR(drag.Gk());
volScalarField LI
(C4_*(Lobs + dimensionedScalar("minLength", dimLength, vSmall)));
(C4_*(Lobs + dimensionedScalar("minLength", dimLength, rootVSmall)));
// Dissipation equation
tmp<fvScalarMatrix> epsEqn

View File

@ -11,7 +11,7 @@ if (pimple.transonic())
fvc::interpolate(psi)
*(
fvc::flux(HbyA)
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
+ fvc::interpolate(betav*rho*rAU)*fvc::ddtCorr(rho, U, phi)
/fvc::interpolate(rho)
)
);
@ -42,7 +42,7 @@ else
"phiHbyA",
(
fvc::flux(rho*HbyA)
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
+ fvc::interpolate(betav*rho*rAU)*fvc::ddtCorr(rho, U, phi)
)
);

View File

@ -22,7 +22,7 @@ surfaceScalarField phiHbyA
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
const bool closedVolume = adjustPhi(phiHbyA, U, p_rgh);
const bool closedVolume = mesh.steady() && adjustPhi(phiHbyA, U, p_rgh);
const bool adjustMass = closedVolume && !thermo.incompressible();
phiHbyA += phig;

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
pimpleDyMFoam.C
pimpleFoam
Description
Transient solver for incompressible, turbulent flow of Newtonian fluids,

View File

@ -12,8 +12,10 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
phaseModel& phase = fluid.anisothermalPhases()[anisothermalPhasei];
const volScalarField& alpha = phase;
const volScalarField& rho = phase.rho();
const volVectorField& U = phase.U();
tmp<volScalarField> tRho = phase.rho();
const volScalarField& rho = tRho();
tmp<volVectorField> tU = phase.U();
const volVectorField& U = tU();
fvScalarMatrix EEqn
(

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
ansysToFoam
Description
Converts an ANSYS input mesh file, exported from I-DEAS,
to OpenFOAM format.
\*---------------------------------------------------------------------------*/

View File

@ -21,13 +21,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
ansysToFoam
Description
Converts an ANSYS input mesh file, exported from I-DEAS,
to OpenFOAM format.
\*---------------------------------------------------------------------------*/
%{

View File

@ -0,0 +1,30 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
fluent3DMeshToFoam
Description
Converts a Fluent mesh to OpenFOAM format.
\*---------------------------------------------------------------------------*/

View File

@ -21,12 +21,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
fluent3DMeshToFoam
Description
Converts a Fluent mesh to OpenFOAM format.
\*---------------------------------------------------------------------------*/
%{

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
fluentMeshToFoam
Description
Converts a Fluent mesh to OpenFOAM format
including multiple region and region boundary handling.
\*---------------------------------------------------------------------------*/

View File

@ -21,13 +21,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
fluentMeshToFoam
Description
Converts a Fluent mesh to OpenFOAM format
including multiple region and region boundary handling.
\*---------------------------------------------------------------------------*/
%{

View File

@ -0,0 +1,30 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
gambitToFoam
Description
Converts a GAMBIT mesh to OpenFOAM format.
\*---------------------------------------------------------------------------*/

View File

@ -21,12 +21,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
gambitToFoam
Description
Converts a GAMBIT mesh to OpenFOAM format.
\*---------------------------------------------------------------------------*/
%{

View File

@ -146,7 +146,7 @@ searchDirs="\
$FOAM_ETC/caseDicts"
ext="ANY"
tgt="system"
tgt=""
while [ "$#" -gt 0 ]
do
case "$1" in
@ -185,6 +185,22 @@ done
[ $# -eq 1 ] || error "missing argument: no file name/prefix <file> supplied"
prefix="$1"
[ "$tgt" ] || \
case "$prefix" in
All*)
tgt="."
;;
*Properties|*Cloud)
tgt="constant"
;;
s)
tgt="0"
;;
*)
tgt="system"
;;
esac
[ -s "system/controlDict" ] || \
echo "Warning: cannot find OpenFOAM case directory (no system/controlDict file)"
[ -d "$tgt" ] || error "target directory does not exist: '$tgt'"

View File

@ -1,145 +0,0 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# foamUpdateCaseFileHeader
#
# Description
# Updates the header of application files.
# By default, writes current version in the header.
# Alternatively version can be specified with -v option.
# Also removes consecutive blank lines from file.
#
#------------------------------------------------------------------------------
error() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
usage
exit 1
}
usage() {
cat<<USAGE
Usage: ${0##*/} [OPTION] <file1> ... <fileN>
options:
-version <ver> specifies the version to be written in the header
-help print the usage
Updates the header of application files and removes consecutive blank lines.
By default, writes current OpenFOAM version in the header.
An alternative version can be specified with the -version option.
USAGE
}
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage && exit 0
;;
-v | -version)
[ "$#" -ge 2 ] || error "'$1' option requires an argument"
version="$2"
shift 2
;;
-*)
error "unknown option: '$*'"
;;
*)
break
;;
esac
done
echo "$version" | grep -Eq '^([0-9]\.[0-9x]|dev)$' || \
error "The version number is \"${version}\"." \
"The format must be MAJOR.MINOR (e.g. \"$WM_PROJECT_VERSION\" or \"dev\")"
# constant width for version - default to WM_PROJECT_VERSION
version=$(printf %-36s "${version:-$WM_PROJECT_VERSION}")
[ $# -ge 1 ] || error
printHeader()
{
cat<<HEADER
/*--------------------------------*- C++ -*----------------------------------*\\
========= |
| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\\\ / O peration | Version: $version |
| \\\\ / A nd | Website: https://openfoam.org |
| \\\\/ M anipulation | |
\\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format $1;
class $2;
object $3;
}
HEADER
}
#
# extract attribute '$1' from file '$2'
#
FoamFileAttribute()
{
sed -n -e 's/[ ;]*$//' -e "s/^ *$1 *//p" "$2"
}
#
# main
#
tmpFile=FoamFile.tmp$$
for caseFile
do
if grep FoamFile $caseFile >/dev/null 2>&1
then
echo "Updating case file: $caseFile"
sed -n '/FoamFile/,/}/p' $caseFile > $tmpFile
format=$(FoamFileAttribute format $tmpFile)
class=$(FoamFileAttribute class $tmpFile)
object=$(FoamFileAttribute object $tmpFile)
printHeader "$format" "$class" "$object" > $tmpFile
sed '1,/}/d' $caseFile | sed '/./,/^$/!d' >> $tmpFile
# use cat to avoid removing/replace soft-links
[ -s $tmpFile ] && cat $tmpFile >| $caseFile
rm -f $tmpFile 2>/dev/null
else
echo " Invalid case file: $caseFile" 1>&2
fi
done
#------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -40,6 +40,7 @@ options:
-block use blockMesh reader (uses .blockMesh extension)
-builtin use VTK builtin OpenFOAM reader (uses .foam extension)
-case <dir> specify alternative case directory, default is the cwd
-empty launch ParaView without opening any data files
-region <name> specify alternative mesh region
-touch only create the file (eg, .blockMesh, .OpenFOAM, etc)
-touchAll create .blockMesh, .OpenFOAM files (and for all regions)
@ -59,6 +60,29 @@ error() {
exit 1
}
pvExec () {
_opt=""
[ "$ParaView_GL" = mesa ] && _opt="--mesa"
paraview $_opt "$@"
}
noPVReader () {
cat<<EOF
FATAL ERROR: The official reader module for OpenFOAM data does not exist on
your system. This means that the version of ParaView you are using was not
compiled with OpenFOAM, or distributed with a packaged version of OpenFOAM.
For information on packaged versions of OpenFOAM/ParaView and compilation of
OpenFOAM/ParaView, see https://openfoam.org/download
Alternatively, you might be able to view your OpenFOAM data with the reader
module provided with ParaView by running:
paraFoam -builtin
EOF
}
# We want to do nice exit when running paraview to give paraview opportunity
# to clean up
unset FOAM_ABORT
@ -96,6 +120,10 @@ do
cd "$2" 2>/dev/null || error "directory does not exist: '$2'"
shift 2
;;
-empty)
echo "Launching ParaView without opening any files."
pvExec && exit 0
;;
-region)
[ "$#" -ge 2 ] || error "'$1' option requires an argument"
regionName=$2
@ -125,20 +153,9 @@ do
done
# Check that reader module has been built
if [ $requirePV -eq 1 -a ! -f "$PV_PLUGIN_PATH/libPVFoamReader_SM.so" ]
then
cat<< BUILDREADER
FATAL ERROR: ParaView reader module libraries do not exist
Please build the reader module before continuing:
cd \$FOAM_UTILITIES/postProcessing/graphics/PVReaders
./Allwclean
./Allwmake
BUILDREADER
exit 1
fi
[ $requirePV -eq 1 ] && \
! [ -f "$PV_PLUGIN_PATH/libPVFoamReader_SM.so" ] && \
noPVReader && exit 1
# Check for --data=... argument
hasDataArg()
@ -158,7 +175,6 @@ hasDataArg()
hasDataArg "$@"
# Get a sensible caseName from the directory name
caseName=${PWD##*/}
caseFile="$caseName.$extension"
@ -179,7 +195,7 @@ fi
case "${optTouch:-false}" in
all)
extension=OpenFOAM
if [ -f system/blockMeshDict -o -f constant/polyMesh/blockMeshDict ]
if [ -f system/blockMeshDict ] || [ -f constant/polyMesh/blockMeshDict ]
then
touch "$caseName.blockMesh"
echo "Created '$caseName.blockMesh'"
@ -189,12 +205,10 @@ all)
# Discover probable regions
for region in constant/*
do
if [ -d "$region" -a -d "$region"/polyMesh ]
then
regionName=${region##*/}
touch "$caseName{$regionName}.$extension"
[ -d "$region" ] && [ -d "${region}/polyMesh" ] && \
regionName=${region##*/} && \
touch "$caseName{$regionName}.$extension" && \
echo "Created '$caseName{$regionName}.$extension'"
fi
done
exit 0
;;
@ -217,7 +231,7 @@ if [ "${hasData:-false}" = true ]
then
# Has --data=.., send directly to paraview
exec paraview "$@"
pvExec "$@"
else
@ -235,7 +249,8 @@ else
$blockMeshDictDir \
;
do
[ -s "$parentDir/$check" ] || {
[ -s "$parentDir/$check" ] || [ -s "$parentDir/$check.orig" ] ||
{
[ -n "$warn" ] && echo "$warn" 1>&2
echo " $parentDir/$check" 1>&2
unset warn
@ -250,7 +265,8 @@ else
$fvControls/fvSolution \
;
do
[ -s "$parentDir/$check" ] || {
[ -s "$parentDir/$check" ] || [ -s "$parentDir/$check.orig" ] ||
{
[ -n "$warn" ] && echo "$warn" 1>&2
echo " $parentDir/$check" 1>&2
unset warn
@ -263,7 +279,7 @@ else
echo "Cannot locate OpenFOAM-format case files"
printf "Would you like to open ParaView anyway <Y|n>:"
read open
[ "$open" = "" ] || echo "$open" | grep -iqE "^y" && paraview
[ "$open" = "" ] || echo "$open" | grep -iqE "^y" && pvExec
exit
}
@ -275,8 +291,8 @@ else
}
# For now filter out any ld.so errors. Caused by non-system compiler?
paraview --data="$caseFile" "$@" 2>&1 \
| fgrep -v 'Inconsistency detected by ld.so'
pvExec --data="$caseFile" "$@" 2>&1 \
| grep -v -F 'Inconsistency detected by ld.so'
fi

View File

@ -793,9 +793,7 @@ INPUT_ENCODING = UTF-8
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd,
# *.vhdl, *.ucf, *.qsf, *.as and *.js.
FILE_PATTERNS = *.H \
*.C \
*.dox
FILE_PATTERNS = *.H *.C
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
@ -810,7 +808,11 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE =
EXCLUDE = \
$(WM_PROJECT_DIR)/src/mesh/blockMesh/blockMesh/blockMesh.C \
$(WM_PROJECT_DIR)/src/dynamicMesh/polyTopoChange/polyTopoChange/removeFaces.C \
$(WM_PROJECT_DIR)/src/meshTools/sets/topoSets/topoSet.C \
$(WM_PROJECT_DIR)/src/conversion/polyDualMesh/polyDualMesh.C
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
@ -1422,7 +1424,7 @@ EXT_LINKS_IN_WINDOW = NO
# Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
FORMULA_FONTSIZE = 16
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
@ -1632,7 +1634,8 @@ PAPER_TYPE = a4wide
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES = $(WM_PROJECT_DIR)/doc/Doxygen/Macros/tensorOperator
EXTRA_PACKAGES = $(WM_PROJECT_DIR)/doc/Doxygen/Macros/tensorOperator \
amsmath
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first

View File

@ -0,0 +1,17 @@
#!/bin/sh
# Run from this directory
cd "${0%/*}" || exit 1
# Source tutorial clean functions
. "$WM_PROJECT_DIR/bin/tools/CleanFunctions"
# Delete the following:
# - time directories
# - constant/polyMesh directory
# - postProcessing and VTK directories
# - log files
# - field files with a ".orig" backup
cleanCase
#------------------------------------------------------------------------------

View File

@ -0,0 +1,15 @@
#!/bin/sh
# Run from this directory
cd "${0%/*}" || exit 1
# Source tutorial run functions
. "$WM_PROJECT_DIR/bin/tools/RunFunctions"
# Example workflow with meshing applications
runApplication blockMesh
runApplication topoSet
runApplication refineMesh -overwrite
runApplication transformPoints -scale "(0.01 0.01 0.01)"
#------------------------------------------------------------------------------

View File

@ -0,0 +1,33 @@
#!/bin/sh
# Run from this directory
cd "${0%/*}" || exit 1
# Source tutorial run functions
. "$WM_PROJECT_DIR/bin/tools/RunFunctions"
# Example with runApplication:
# - runs blockMesh in background
# - redirecting standard output to log.blockMesh
# - does *not* run in log file already exists
runApplication blockMesh
# Example running topoSet and refineMesh 3 times with multiple dictionaries
# -a|-append option appends to log file
i=0
while [ "$i" -lt 3 ]
do
runApplication -a topoSet -dict "topoSetDict.${i}"
runApplication -a refineMesh -dict "refineMeshDict.${i}"
i=$(( i + 1))
done
runApplication decomposePar
# Example with runParallel to run in parallel
# getApplication finds solver name from "application" entry in controlDict
runParallel "$(getApplication)"
runApplication reconstructPar
#------------------------------------------------------------------------------

View File

@ -10,12 +10,111 @@ Description
\*---------------------------------------------------------------------------*/
nLines 20;
start (0 -4 1e-06); // Ensure that points do not coincide with
end (0 4 1e-06); // mesh faces, but instead lie inside cells
fields (U p);
// Must be last entry
#includeEtc "caseDicts/postProcessing/visualization/streamlines.cfg"
fields (U p);
// Streamline direction: forward, backward, both
direction both;
// Select from methods with sub-dictionary settings below
seedMethod lineCell;
// Seeding along a line
lineCell
{
type lineCell; // lineCellFace, lineFace
start (0 -1 1);
end (0 1 1);
}
lineUniform
{
type lineUniform;
start (0 -1 1);
end (0 1 1);
nPoints 50;
}
circleRandom
{
type circleRandom;
centre (0 0 0);
radius 1;
normal (1 0 0);
nPoints 50;
}
arcUniform
{
type arcUniform;
centre (0 0 0);
normal (1 0 0);
radial (0 1 0);
startAngle 0; // rad
endAngle 3.14; // rad
nPoints 50;
}
// Seeding within a volume region
boxUniform
{
type boxUniform;
box (-1 -1 -1) (1 1 1);
nPoints (3 3 3);
}
sphereRandom
{
type sphereRandom;
centre (0 0 0);
radius 1;
nPoints 50;
}
// Seeding at points on a surface
triSurfaceMesh
{
type triSurfaceMesh;
surface <surfaceMeshFile>; // in constant/triSurface directory
}
// Seeding at a boundary
boundaryRandom
{
type boundaryRandom;
patches (<patch1> <patch2>);
nPoints 50;
}
// Seeding a set of points
points
{
type points;
points (
(0 -1 1)
(0 0 1)
(0 1 1)
);
ordered on;
}
boundaryPoints
{
type boundaryPoints;
points (
(0 -1 1)
(0 0 1)
(0 1 1)
);
maxDistance 1;
}
// DO NOT REMOVE from END of file; sets the seedSampleSet
seedSampleSet
{
${$seedMethod};
axis x;
}
// ************************************************************************* //

View File

@ -13,20 +13,10 @@ executeControl writeTime;
writeControl writeTime;
setFormat vtk;
direction forward;
lifeTime 10000;
nSubCycle 5;
cloudName particleTracks;
seedSampleSet
{
type lineUniform;
axis x;
start $start;
end $end;
nPoints $nLines;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -63,6 +63,8 @@ setenv ParaView_VERSION 5.4.0
#setenv ParaView_VERSION 5.5.0
setenv ParaView_MAJOR detect
#setenv ParaView_GL=system
setenv ParaView_GL=mesa
# Evaluate command-line parameters for ParaView
while ( $#argv > 0 )
@ -127,6 +129,7 @@ if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
setenv PYTHONPATH ${paraviewPython}:$ParaView_LIB_DIR
endif
endif
if ("$ParaView_GL" == mesa) alias paraview 'paraview --mesa'
else
unsetenv PV_PLUGIN_PATH
endif

View File

@ -71,7 +71,7 @@ alias run='cd $FOAM_RUN'
# Refresh the environment
# ~~~~~~~~~~~~~~~~~~~~~~~
# For backward-compatibility unalias wmRefresh if it is defined as an alias
if declare -f wmRefresh > /dev/null
if command -V wmRefresh 2> /dev/null | head -1 | grep -q "function"
then
unset wmRefresh
else
@ -82,7 +82,7 @@ wmRefresh()
{
wmProjectDir=$WM_PROJECT_DIR
foamSettings=$FOAM_SETTINGS
wmUnset
. $wmProjectDir/etc/config.sh/unset
. $wmProjectDir/etc/bashrc $foamSettings
}

View File

@ -57,6 +57,12 @@ OpenFOAM | ThirdParty)
Gcc61)
gcc_version=gcc-6.1.0
;;
Gcc72)
gcc_version=gcc-7.2.0
;;
Gcc73)
gcc_version=gcc-7.3.0
;;
Gcc81)
gcc_version=gcc-8.1.0
;;

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -69,6 +69,8 @@ export ParaView_VERSION=5.4.0
#export ParaView_VERSION=5.5.0
export ParaView_MAJOR=detect
#export ParaView_GL=system
export ParaView_GL=mesa
# Evaluate command-line parameters for ParaView
_foamParaviewEval()
@ -144,6 +146,8 @@ then
export PYTHONPATH=$paraviewPython:$ParaView_LIB_DIR
fi
fi
[ "$ParaView_GL" = mesa ] && alias paraview="paraview --mesa"
else
unset PV_PLUGIN_PATH
fi

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -37,7 +37,7 @@
#
#------------------------------------------------------------------------------
export SCOTCH_VERSION=scotch_6.0.3
export SCOTCH_VERSION=scotch_6.0.6
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION
#------------------------------------------------------------------------------

View File

@ -24,7 +24,7 @@ Documentation
"$WM_PROJECT_USER_DIR/html"
"~OpenFOAM/html"
"$WM_PROJECT_DIR/doc/Doxygen/html"
"http://cpp.openfoam.org/dev"
"http://cpp.openfoam.org/v6"
);
doxySourceFileExt "_8C.html";
}

View File

@ -16,6 +16,8 @@ FoamFile
internalFacesOnly true;
fields true;
baffles
{
baffleFaces

View File

@ -16,7 +16,7 @@ FoamFile
solvers
{
p
"(p|pcorr)"
{
solver GAMG;
smoother GaussSeidel;
@ -32,7 +32,7 @@ solvers
relTol 0.1;
}
pFinal
"(p|pcorr)Final"
{
$p;
relTol 0;

View File

@ -16,6 +16,8 @@ FoamFile
internalFacesOnly true;
fields true;
baffles
{
baffleFaces

View File

@ -16,7 +16,7 @@ FoamFile
solvers
{
p
"(p|pcorr)"
{
solver GAMG;
smoother GaussSeidel;
@ -32,7 +32,7 @@ solvers
relTol 0.1;
}
pFinal
"(p|pcorr)Final"
{
$p;
relTol 0;

View File

@ -20,7 +20,7 @@ thermoType
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
equationOfState perfectFluid;
specie specie;
energy sensibleEnthalpy;
}
@ -32,6 +32,11 @@ mixture
nMoles 1;
molWeight 18.0; // [g/mol]
}
equationOfState
{
R 3000; // [J/(kg K)]
rho0 1027; // [kg/m^3]
}
thermodynamics
{
Cp 4181; // [J/(kg K)] at T = 293 K

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,7 +45,7 @@ Foam::data::data(const objectRegistry& obr)
IOobject::NO_WRITE
)
),
prevTimeIndex_(0)
prevTimeIndex_(-1)
{
set("solverPerformance", dictionary());
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,10 +40,15 @@ void Foam::data::setSolverPerformance
List<SolverPerformance<Type>> perfs;
if (prevTimeIndex_ != this->time().timeIndex())
const label timeIndex =
this->time().subCycling()
? this->time().prevTimeState().timeIndex()
: this->time().timeIndex();
if (prevTimeIndex_ != timeIndex)
{
// Reset solver performance between iterations
prevTimeIndex_ = this->time().timeIndex();
prevTimeIndex_ = timeIndex;
dict.clear();
}
else

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,6 +29,7 @@ License
#include "stringIOList.H"
#include "cellModeller.H"
#include "vectorIOField.H"
#include "stringOps.H"
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
@ -907,6 +908,19 @@ void Foam::vtkUnstructuredReader::read(ISstream& inFile)
}
}
}
else if (tag == "METADATA")
{
// Read rest of the line
string line;
inFile.getLine(line);
// Skip until an empty line is found
inFile.getLine(line);
while (!stringOps::trim(line).empty())
{
inFile.getLine(line);
}
}
else
{
FatalIOErrorInFunction(inFile)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,7 +60,6 @@ public:
wordRe name;
scalar absTol;
scalar relTol;
label solveIndex;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -96,7 +96,6 @@ bool Foam::singleRegionCorrectorConvergenceControl::readCorrResidualControls()
rd.name = fName.c_str();
rd.absTol = readScalar(fieldDict.lookup("tolerance"));
rd.relTol = readScalar(fieldDict.lookup("relTol"));
rd.solveIndex = 0;
data.append(rd);
}
else
@ -177,11 +176,11 @@ corrCriteriaSatisfied() const
const dictionary& solverDict = mesh_.solverPerformanceDict();
forAllConstIter(dictionary, solverDict, iter)
{
const word& variableName = iter().keyword();
const word& fieldName = iter().keyword();
const label fieldi =
convergenceControl::residualControlIndex
(
variableName,
fieldName,
corrResidualControl_
);
if (fieldi != -1)
@ -190,8 +189,8 @@ corrCriteriaSatisfied() const
convergenceControl::getInitialResiduals
(
mesh_,
variableName,
corrResidualControl_[fieldi].solveIndex,
fieldName,
solveIndex_.found(fieldName) ? solveIndex_[fieldName] : 0,
iter().stream(),
firstResidual,
residual
@ -209,7 +208,7 @@ corrCriteriaSatisfied() const
if (control_.debug)
{
Info<< control_.algorithmSpace() << " " << variableName
Info<< control_.algorithmSpace() << " " << fieldName
<< ": tolerance " << residual << " ("
<< corrResidualControl_[fieldi].absTol << ")"
<< ", relTol " << relativeResidual << " ("
@ -225,10 +224,7 @@ corrCriteriaSatisfied() const
void Foam::singleRegionCorrectorConvergenceControl::resetCorrSolveIndex()
{
forAll(corrResidualControl_, i)
{
corrResidualControl_[i].solveIndex = 0;
}
solveIndex_.clear();
}
@ -237,23 +233,14 @@ void Foam::singleRegionCorrectorConvergenceControl::updateCorrSolveIndex()
const dictionary& solverDict = mesh_.solverPerformanceDict();
forAllConstIter(dictionary, solverDict, iter)
{
const word& variableName = iter().keyword();
const label fieldi =
convergenceControl::residualControlIndex
(
variableName,
corrResidualControl_
);
if (fieldi != -1)
{
getNSolves
(
mesh_,
variableName,
iter().stream(),
corrResidualControl_[fieldi].solveIndex
);
}
const word& fieldName = iter().keyword();
getNSolves
(
mesh_,
fieldName,
iter().stream(),
solveIndex_(fieldName)
);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -62,6 +62,11 @@ protected:
//- List of residual data per field
List<corrResidualData> corrResidualControl_;
//- The index of the solution at the start of the corrector loop, for
// each field. If the field name is not in the table then the index is
// assumed to be zero; i.e, the first solution.
HashTable<label> solveIndex_;
public:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -131,13 +131,39 @@ void Foam::freestreamPressureFvPatchScalarField::updateCoeffs()
UName_
);
const Field<scalar> magUp(mag(Up));
const Field<vector>& nf = patch().nf();
Field<scalar>& vf = valueFraction();
if (supersonic_)
{
valueFraction() = 0.5 - 0.5*(Up & patch().nf())/mag(Up);
forAll(vf, i)
{
if (magUp[i] > vSmall)
{
vf[i] = 0.5 - 0.5*(Up[i] & nf[i])/magUp[i];
}
else
{
vf[i] = 0.5;
}
}
}
else
{
valueFraction() = 0.5 + 0.5*(Up & patch().nf())/mag(Up);
forAll(vf, i)
{
if (magUp[i] > vSmall)
{
vf[i] = 0.5 + 0.5*(Up[i] & nf[i])/magUp[i];
}
else
{
vf[i] = 0.5;
}
}
}
mixedFvPatchField<scalar>::updateCoeffs();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2018-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -107,8 +107,23 @@ void Foam::freestreamVelocityFvPatchVectorField::updateCoeffs()
}
const Field<vector>& Up = *this;
const Field<scalar> magUp(mag(Up));
valueFraction() = 0.5 - 0.5*(Up & patch().nf())/mag(Up);
const Field<vector>& nf = patch().nf();
Field<scalar>& vf = valueFraction();
forAll(vf, i)
{
if (magUp[i] > vSmall)
{
vf[i] = 0.5 - 0.5*(Up[i] & nf[i])/magUp[i];
}
else
{
vf[i] = 0.5;
}
}
mixedFvPatchField<vector>::updateCoeffs();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -65,7 +65,7 @@ swirlFlowRateInletVelocityFvPatchVectorField
dict.lookupOrDefault
(
"origin",
patch().size()
returnReduce(patch().size(), sumOp<label>())
? gSum(patch().Cf()*patch().magSf())/gSum(patch().magSf())
: Zero
)
@ -75,7 +75,7 @@ swirlFlowRateInletVelocityFvPatchVectorField
dict.lookupOrDefault
(
"axis",
patch().size()
returnReduce(patch().size(), sumOp<label>())
? -gSum(patch().Sf())/gSum(patch().magSf())
: Zero
)

View File

@ -1,97 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
\page pageBoundaryConditions Boundary Conditions
\ref grpBoundaryConditions are required to 'close' the simulation problem.
Careful attention should be applied to their selection so as to create a
well-posed system of equations, which can be solved numerically.
\section secBoundaryConditionsOverview Overview
The set of available \ref grpBoundaryConditions comprise of basic, turbulent and
thermophysical types.
\subsection secBC1 Basic boundary conditions
- \ref grpConstraintBoundaryConditions
- \ref grpInletBoundaryConditions
- \ref grpOutletBoundaryConditions
- \ref grpGenericBoundaryConditions
- \ref grpCoupledBoundaryConditions
- \ref grpWallBoundaryConditions
\subsection secBC2 Turbulent flow boundary conditions
- \ref grpRASBoundaryConditions
\subsection secBC3 Thermophysical boundary conditions
- \ref grpThermoBoundaryConditions
\section secWallFunctions Wall-functions
Wall-functions in OpenFOAM are modelled as boundary conditions, applied to
the viscosity for momentum, and thermal diffusivity for energy.
Wall-functions
- \ref grpWallFunctions
Thermal wall-functions for incompressible flow
- \ref grpIcoWallFunctions
Thermal wall-functions for compressible flow
- \ref grpCmpWallFunctions
\section secBoundaryConditions Typical usage for pressure-velocity systems
The choice as to the most appropriate set of boundary conditions is dictated by
the type of flow problem. In many cases, multiple possible selections exist;
the following tables offer suggestions for subsonic flow.
subsonic inlet (flow specified):
\table
Variable | Symbol | Type
pressure | p | \link Foam::zeroGradientFvPatchField zeroGradient\endlink
velocity | U | \link Foam::fixedValueFvPatchField fixedValue\endlink
transported property | - | \link Foam::fixedValueFvPatchField fixedValue\endlink
derived property | - | \link Foam::calculatedFvPatchField calculated\endlink or \link Foam::zeroGradientFvPatchField zeroGradient\endlink
\endtable
subsonic outlet:
\table
Variable | Symbol | Type
pressure | p | \link Foam::fixedValueFvPatchField fixedValue\endlink
velocity | U | \link Foam::inletOutletFvPatchField inletOutlet\endlink or \link Foam::pressureInletOutletVelocityFvPatchVectorField pressureInletOutletVelocity\endlink
transported property | - | \link Foam::inletOutletFvPatchField inletOutlet\endlink
derived property | - | \link Foam::calculatedFvPatchField calculated\endlink or \link Foam::zeroGradientFvPatchField zeroGradient\endlink
\endtable
wall (impermeable, non-slip):
\table
Variable | Symbol | Type
pressure | p | \link Foam::zeroGradientFvPatchField zeroGradient\endlink
velocity | U | \link Foam::fixedValueFvPatchField fixedValue\endlink
transported property | - | \link Foam::fixedValueFvPatchField fixedValue\endlink
derived property | - | \link Foam::calculatedFvPatchField calculated\endlink or \link Foam::zeroGradientFvPatchField zeroGradient\endlink
\endtable
\*---------------------------------------------------------------------------*/

View File

@ -73,48 +73,33 @@ bool Foam::functionObjects::CourantNo::calc()
const surfaceScalarField& phi =
lookupObject<surfaceScalarField>(fieldName_);
tmp<volScalarField::Internal> Coi
tmp<volScalarField> tCo
(
new volScalarField
(
IOobject
(
resultName_,
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedScalar("0", dimless, 0.0),
zeroGradientFvPatchScalarField::typeName
)
);
tCo->ref() =
byRho
(
(0.5*mesh_.time().deltaT())
*fvc::surfaceSum(mag(phi))()()
/mesh_.V()
)
);
if (foundObject<volScalarField>(resultName_))
{
volScalarField& Co = lookupObjectRef<volScalarField>(resultName_);
Co.ref() = Coi();
Co.correctBoundaryConditions();
}
else
{
tmp<volScalarField> tCo
(
new volScalarField
(
IOobject
(
resultName_,
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("0", dimless, 0.0),
zeroGradientFvPatchScalarField::typeName
)
);
tCo.ref().ref() = Coi();
tCo.ref().correctBoundaryConditions();
mesh_.objectRegistry::store(tCo.ptr());
}
return true;
tCo->correctBoundaryConditions();
return store(resultName_, tCo);
}
else
{

View File

@ -60,7 +60,7 @@ Foam::functionObjects::fieldAverageItem::fieldAverageItem()
meanFieldName_("unknown"),
prime2Mean_(0),
prime2MeanFieldName_("unknown"),
base_(ITER),
base_(baseType::iter),
window_(-1.0),
windowName_("")
{}

View File

@ -89,10 +89,10 @@ public:
static const word EXT_PRIME2MEAN;
//- Enumeration defining the averaging base type
enum baseType
enum class baseType
{
ITER,
TIME
iter,
time
};
@ -198,16 +198,16 @@ public:
return baseTypeNames_[base_];
}
//- Return true if base is ITER
//- Return true if base is iter
Switch iterBase() const
{
return base_ == ITER;
return base_ == baseType::iter;
}
//- Return true if base is time
Switch timeBase() const
{
return base_ == TIME;
return base_ == baseType::time;
}
scalar window() const

View File

@ -36,7 +36,7 @@ Foam::functionObjects::fieldAverageItem::fieldAverageItem(Istream& is)
meanFieldName_("unknown"),
prime2Mean_(0),
prime2MeanFieldName_("unknown"),
base_(ITER),
base_(baseType::iter),
window_(-1.0)
{
is.check
@ -116,21 +116,25 @@ Foam::Ostream& Foam::functionObjects::operator<<
);
os << faItem.fieldName_ << nl << token::BEGIN_BLOCK << nl;
os.writeKeyword("mean") << faItem.mean_ << token::END_STATEMENT << nl;
os.writeKeyword("prime2Mean") << faItem.mean_
<< token::END_STATEMENT << nl;
os.writeKeyword("base") << faItem.baseTypeNames_[faItem.base_]
<< token::END_STATEMENT << nl;
os.writeKeyword("mean")
<< faItem.mean_ << token::END_STATEMENT << nl;
os.writeKeyword("prime2Mean")
<< faItem.prime2Mean_ << token::END_STATEMENT << nl;
os.writeKeyword("base")
<< faItem.baseTypeNames_[faItem.base_] << token::END_STATEMENT << nl;
if (faItem.window_ > 0)
{
os.writeKeyword("window") << faItem.window_
<< token::END_STATEMENT << nl;
os.writeKeyword("window")
<< faItem.window_ << token::END_STATEMENT << nl;
if (faItem.windowName_ != "")
{
os.writeKeyword("windowName") << faItem.windowName_
<< token::END_STATEMENT << nl;
os.writeKeyword("windowName")
<< faItem.windowName_ << token::END_STATEMENT << nl;
}
}

View File

@ -51,25 +51,6 @@ Foam::functionObjects::processorField::processorField
fvMeshFunctionObject(name, runTime, dict)
{
read(dict);
volScalarField* procFieldPtr
(
new volScalarField
(
IOobject
(
"processorID",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("0", dimless, 0.0)
)
);
mesh_.objectRegistry::store(procFieldPtr);
}
@ -91,10 +72,24 @@ bool Foam::functionObjects::processorField::read(const dictionary& dict)
bool Foam::functionObjects::processorField::execute()
{
mesh_.lookupObjectRef<volScalarField>("processorID") ==
dimensionedScalar("proci", dimless, Pstream::myProcNo());
word name("processorID");
return true;
tmp<volScalarField> tprocField
(
new volScalarField
(
IOobject
(
name,
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedScalar(name, dimless, Pstream::myProcNo())
)
);
return store(name, tprocField);
}

View File

@ -71,25 +71,6 @@ Foam::functionObjects::turbulenceIntensity::turbulenceIntensity
logFiles(obr_, name),
writeLocalObjects(obr_, log)
{
volScalarField* turbulenceIntensityPtr
(
new volScalarField
(
IOobject
(
"I",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("0", dimless, 0.0)
)
);
mesh_.objectRegistry::store(turbulenceIntensityPtr);
read(dict);
resetName(typeName);
resetLocalObjectName("I");
@ -115,9 +96,6 @@ bool Foam::functionObjects::turbulenceIntensity::read(const dictionary& dict)
bool Foam::functionObjects::turbulenceIntensity::execute()
{
volScalarField& turbulenceIntensity =
mesh_.lookupObjectRef<volScalarField>("I");
if (mesh_.foundObject<turbulenceModel>(turbulenceModel::propertiesName))
{
const turbulenceModel& turbModel = mesh_.lookupObject<turbulenceModel>
@ -126,12 +104,19 @@ bool Foam::functionObjects::turbulenceIntensity::execute()
);
volScalarField uPrime(sqrt((2.0/3.0)*turbModel.k()));
turbulenceIntensity =
uPrime
/max
word name("I");
return
store
(
max(uPrime, mag(turbModel.U())),
dimensionedScalar("small", dimVelocity, small)
name,
uPrime
/max
(
max(uPrime, mag(turbModel.U())),
dimensionedScalar("small", dimVelocity, small)
)
);
}
else
@ -139,9 +124,9 @@ bool Foam::functionObjects::turbulenceIntensity::execute()
FatalErrorInFunction
<< "Unable to find turbulence model in the "
<< "database" << exit(FatalError);
}
return true;
return false;
}
}

View File

@ -58,15 +58,30 @@ void Foam::functionObjects::wallHeatFlux::writeFileHeader(const label i)
}
void Foam::functionObjects::wallHeatFlux::calcHeatFlux
Foam::tmp<Foam::volScalarField>
Foam::functionObjects::wallHeatFlux::calcWallHeatFlux
(
const volScalarField& alpha,
const volScalarField& he,
volScalarField& wallHeatFlux
const volScalarField& he
)
{
tmp<volScalarField> twallHeatFlux
(
new volScalarField
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedScalar("0", dimMass/pow3(dimTime), 0)
)
);
volScalarField::Boundary& wallHeatFluxBf =
wallHeatFlux.boundaryFieldRef();
twallHeatFlux.ref().boundaryFieldRef();
const volScalarField::Boundary& heBf =
he.boundaryField();
@ -97,6 +112,8 @@ void Foam::functionObjects::wallHeatFlux::calcHeatFlux
}
}
}
return twallHeatFlux;
}
@ -114,25 +131,6 @@ Foam::functionObjects::wallHeatFlux::wallHeatFlux
writeLocalObjects(obr_, log),
patchSet_()
{
volScalarField* wallHeatFluxPtr
(
new volScalarField
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("0", dimMass/pow3(dimTime), 0)
)
);
mesh_.objectRegistry::store(wallHeatFluxPtr);
read(dict);
resetName(typeName);
resetLocalObjectName(typeName);
@ -205,7 +203,7 @@ bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict)
bool Foam::functionObjects::wallHeatFlux::execute()
{
volScalarField& wallHeatFlux = lookupObjectRef<volScalarField>(type());
word name(type());
if
(
@ -221,11 +219,10 @@ bool Foam::functionObjects::wallHeatFlux::execute()
turbulenceModel::propertiesName
);
calcHeatFlux
return store
(
turbModel.alphaEff(),
turbModel.transport().he(),
wallHeatFlux
name,
calcWallHeatFlux(turbModel.alphaEff(), turbModel.transport().he())
);
}
else if (foundObject<solidThermo>(solidThermo::dictName))
@ -233,7 +230,7 @@ bool Foam::functionObjects::wallHeatFlux::execute()
const solidThermo& thermo =
lookupObject<solidThermo>(solidThermo::dictName);
calcHeatFlux(thermo.alpha(), thermo.he(), wallHeatFlux);
return store(name, calcWallHeatFlux(thermo.alpha(), thermo.he()));
}
else
{

View File

@ -108,11 +108,10 @@ protected:
virtual void writeFileHeader(const label i);
//- Calculate the heat-flux
void calcHeatFlux
tmp<volScalarField> calcWallHeatFlux
(
const volScalarField& alpha,
const volScalarField& he,
volScalarField& wallHeatFlux
const volScalarField& he
);

View File

@ -63,15 +63,35 @@ void Foam::functionObjects::wallHeatTransferCoeff::writeFileHeader
}
void Foam::functionObjects::wallHeatTransferCoeff::calcHeatTransferCoeff
Foam::tmp<Foam::volScalarField>
Foam::functionObjects::wallHeatTransferCoeff::calcHeatTransferCoeff
(
const volScalarField& nu,
const volScalarField& nut,
volScalarField& wallHeatTransferCoeff
const volScalarField& nut
)
{
tmp<volScalarField> twallHeatTransferCoeff
(
new volScalarField
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedScalar
(
"0",
dimMass/pow3(dimTime)/(dimTemperature/dimLength),
0
)
)
);
volScalarField::Boundary& wallHeatTransferCoeffBf =
wallHeatTransferCoeff.boundaryFieldRef();
twallHeatTransferCoeff.ref().boundaryFieldRef();
const volScalarField::Boundary& nuBf = nu.boundaryField();
const volScalarField::Boundary& nutBf = nut.boundaryField();
@ -84,6 +104,8 @@ void Foam::functionObjects::wallHeatTransferCoeff::calcHeatTransferCoeff
rho_*Cp_*(nuBf[patchi]/Prl_ + nutBf[patchi]/Prt_);
}
}
return twallHeatTransferCoeff;
}
@ -101,30 +123,6 @@ Foam::functionObjects::wallHeatTransferCoeff::wallHeatTransferCoeff
writeLocalObjects(obr_, log),
patchSet_()
{
volScalarField* wallHeatTransferCoeffPtr
(
new volScalarField
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar
(
"0",
dimMass/pow3(dimTime)/(dimTemperature/dimLength),
0
)
)
);
mesh_.objectRegistry::store(wallHeatTransferCoeffPtr);
read(dict);
resetName(typeName);
resetLocalObjectName(typeName);
@ -202,8 +200,7 @@ bool Foam::functionObjects::wallHeatTransferCoeff::read(const dictionary& dict)
bool Foam::functionObjects::wallHeatTransferCoeff::execute()
{
volScalarField& wallHeatTransferCoeff =
lookupObjectRef<volScalarField>(type());
word name(type());
if
(
@ -219,11 +216,10 @@ bool Foam::functionObjects::wallHeatTransferCoeff::execute()
turbulenceModel::propertiesName
);
calcHeatTransferCoeff
return store
(
turbModel.nu(),
turbModel.nut(),
wallHeatTransferCoeff
name,
calcHeatTransferCoeff(turbModel.nu(), turbModel.nut())
);
}
else
@ -231,9 +227,9 @@ bool Foam::functionObjects::wallHeatTransferCoeff::execute()
FatalErrorInFunction
<< "Unable to find incompressible turbulence model in the "
<< "database" << exit(FatalError);
}
return true;
return false;
}
}

View File

@ -130,11 +130,10 @@ protected:
virtual void writeFileHeader(const label i);
//- Calculate the heat transfer coefficient
void calcHeatTransferCoeff
tmp<volScalarField> calcHeatTransferCoeff
(
const volScalarField& nu,
const volScalarField& nut,
volScalarField& wallHeatTransferCoeff
const volScalarField& nut
);

View File

@ -57,25 +57,42 @@ void Foam::functionObjects::wallShearStress::writeFileHeader(const label i)
}
void Foam::functionObjects::wallShearStress::calcShearStress
Foam::tmp<Foam::volVectorField>
Foam::functionObjects::wallShearStress::calcShearStress
(
const volSymmTensorField& Reff,
volVectorField& shearStress
const volSymmTensorField& Reff
)
{
shearStress.dimensions().reset(Reff.dimensions());
tmp<volVectorField> twallShearStress
(
new volVectorField
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedVector("0", Reff.dimensions(), Zero)
)
);
volVectorField::Boundary& wallShearStressBf =
twallShearStress.ref().boundaryFieldRef();
forAllConstIter(labelHashSet, patchSet_, iter)
{
label patchi = iter.key();
vectorField& ssp = shearStress.boundaryFieldRef()[patchi];
const vectorField& Sfp = mesh_.Sf().boundaryField()[patchi];
const scalarField& magSfp = mesh_.magSf().boundaryField()[patchi];
const symmTensorField& Reffp = Reff.boundaryField()[patchi];
ssp = (-Sfp/magSfp) & Reffp;
wallShearStressBf[patchi] = (-Sfp/magSfp) & Reffp;
}
return twallShearStress;
}
@ -93,30 +110,6 @@ Foam::functionObjects::wallShearStress::wallShearStress
writeLocalObjects(obr_, log),
patchSet_()
{
volVectorField* wallShearStressPtr
(
new volVectorField
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedVector
(
"0",
sqr(dimLength)/sqr(dimTime),
Zero
)
)
);
mesh_.objectRegistry::store(wallShearStressPtr);
read(dict);
resetName(typeName);
resetLocalObjectName(typeName);
@ -192,9 +185,6 @@ bool Foam::functionObjects::wallShearStress::execute()
typedef compressible::turbulenceModel cmpModel;
typedef incompressible::turbulenceModel icoModel;
volVectorField& wallShearStress =
mesh_.lookupObjectRef<volVectorField>(type());
tmp<volSymmTensorField> Reff;
if (mesh_.foundObject<cmpModel>(turbulenceModel::propertiesName))
{
@ -217,9 +207,9 @@ bool Foam::functionObjects::wallShearStress::execute()
<< "database" << exit(FatalError);
}
calcShearStress(Reff(), wallShearStress);
word name(type());
return true;
return store(name, calcShearStress(Reff));
}

View File

@ -117,10 +117,9 @@ protected:
virtual void writeFileHeader(const label i);
//- Calculate the shear-stress
void calcShearStress
tmp<volVectorField> calcShearStress
(
const volSymmTensorField& Reff,
volVectorField& shearStress
const volSymmTensorField& Reff
);

View File

@ -62,12 +62,28 @@ void Foam::functionObjects::yPlus::writeFileHeader(const label i)
}
void Foam::functionObjects::yPlus::calcYPlus
Foam::tmp<Foam::volScalarField> Foam::functionObjects::yPlus::calcYPlus
(
const turbulenceModel& turbModel,
volScalarField& yPlus
const turbulenceModel& turbModel
)
{
tmp<volScalarField> tyPlus
(
new volScalarField
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedScalar("0", dimless, 0.0)
)
);
volScalarField::Boundary& yPlusBf = tyPlus.ref().boundaryFieldRef();
volScalarField::Boundary d = nearWallDist(mesh_).y();
const volScalarField::Boundary nutBf =
@ -81,8 +97,6 @@ void Foam::functionObjects::yPlus::calcYPlus
const fvPatchList& patches = mesh_.boundary();
volScalarField::Boundary& yPlusBf = yPlus.boundaryFieldRef();
forAll(patches, patchi)
{
const fvPatch& patch = patches[patchi];
@ -108,6 +122,8 @@ void Foam::functionObjects::yPlus::calcYPlus
)/nuBf[patchi];
}
}
return tyPlus;
}
@ -124,25 +140,6 @@ Foam::functionObjects::yPlus::yPlus
logFiles(obr_, name),
writeLocalObjects(obr_, log)
{
volScalarField* yPlusPtr
(
new volScalarField
(
IOobject
(
type(),
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("0", dimless, 0.0)
)
);
mesh_.objectRegistry::store(yPlusPtr);
read(dict);
resetName(typeName);
resetLocalObjectName(typeName);
@ -168,9 +165,6 @@ bool Foam::functionObjects::yPlus::read(const dictionary& dict)
bool Foam::functionObjects::yPlus::execute()
{
volScalarField& yPlus =
mesh_.lookupObjectRef<volScalarField>(type());
if (mesh_.foundObject<turbulenceModel>(turbulenceModel::propertiesName))
{
const turbulenceModel& model = mesh_.lookupObject<turbulenceModel>
@ -178,7 +172,9 @@ bool Foam::functionObjects::yPlus::execute()
turbulenceModel::propertiesName
);
calcYPlus(model, yPlus);
word name(type());
return store(name, calcYPlus(model));
}
else
{

View File

@ -95,10 +95,9 @@ class yPlus
virtual void writeFileHeader(const label i);
//- Calculate y+
void calcYPlus
tmp<volScalarField> calcYPlus
(
const turbulenceModel& turbModel,
volScalarField& yPlus
const turbulenceModel& turbModel
);
//- Disallow default bitwise copy construct

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -564,6 +564,16 @@ public:
trackingData& td
);
//- As above, but does not change the master patch. Needed in order for
// ACMI to be able to delegate a hit to the non-overlap patch.
template<class TrackCloudType>
void hitFaceNoChangeToMasterPatch
(
const vector& displacement,
TrackCloudType& cloud,
trackingData& td
);
//- Convenience function. Cobines trackToFace and hitFace
template<class TrackCloudType>
void trackToAndHitFace

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -108,6 +108,33 @@ void Foam::particle::hitFace
trackingData& td
)
{
if (debug)
{
Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl;
}
if (onBoundaryFace())
{
changeToMasterPatch();
}
hitFaceNoChangeToMasterPatch(direction, cloud, td);
}
template<class TrackCloudType>
void Foam::particle::hitFaceNoChangeToMasterPatch
(
const vector& direction,
TrackCloudType& cloud,
trackingData& td
)
{
if (debug)
{
Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl;
}
typename TrackCloudType::particleType& p =
static_cast<typename TrackCloudType::particleType&>(*this);
typename TrackCloudType::particleType::trackingData& ttd =
@ -123,8 +150,6 @@ void Foam::particle::hitFace
}
else if (onBoundaryFace())
{
changeToMasterPatch();
if (!p.hitPatch(cloud, ttd))
{
const polyPatch& patch = mesh_.boundaryMesh()[p.patch()];
@ -392,7 +417,7 @@ void Foam::particle::hitCyclicACMIPatch
// Move to the face associated with the non-overlap patch and redo the
// face interaction.
tetFacei_ = facei_ = cpp.nonOverlapPatch().start() + localFacei;
hitFace(direction, cloud, td);
hitFaceNoChangeToMasterPatch(direction, cloud, td);
}
}

View File

@ -349,14 +349,14 @@ bool Foam::KinematicParcel<ParcelType>::move
p.age() += dt;
if (p.onFace())
if (p.active() && p.onFace())
{
cloud.functions().postFace(p, ttd.keepParticle);
}
cloud.functions().postMove(p, dt, start, ttd.keepParticle);
if (p.onFace() && ttd.keepParticle)
if (p.active() && p.onFace() && ttd.keepParticle)
{
p.hitFace(s, cloud, ttd);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,9 +56,7 @@ void Foam::blockMesh::calcMergeInfo()
}
// set unused to -1
mergeList_.setSize(nPoints_);
mergeList_ = -1;
mergeList_.setSize(nPoints_, -1);
const pointField& blockPoints = topology().points();
const cellList& blockCells = topology().cells();
@ -113,8 +111,11 @@ void Foam::blockMesh::calcMergeInfo()
// Collated points detected by initially taking a constant factor of
// the size of the block.
boundBox bb(blockCells[blockPlabel].points(blockFaces, blockPoints));
const scalar mergeSqrDist = magSqr(10*small*bb.span());
const boundBox bb
(
blockCells[blockPlabel].points(blockFaces, blockPoints)
);
const scalar mergeSqrDist = magSqr(50*small*bb.span());
// This is an N^2 algorithm
@ -548,35 +549,29 @@ void Foam::blockMesh::calcMergeInfo()
}
// Sort merge list to return new point label (in new shorter list)
// given old point label
label newPointLabel = 0;
// Sort merge list and count number of unique points
label nUniqPoints = 0;
forAll(mergeList_, pointLabel)
forAll(mergeList_, pointi)
{
if (mergeList_[pointLabel] > pointLabel)
if (mergeList_[pointi] > pointi)
{
FatalErrorInFunction
<< "Merge list contains point index out of range"
<< exit(FatalError);
}
if
(
mergeList_[pointLabel] == -1
|| mergeList_[pointLabel] == pointLabel
)
if (mergeList_[pointi] == -1 || mergeList_[pointi] == pointi)
{
mergeList_[pointLabel] = newPointLabel;
newPointLabel++;
mergeList_[pointi] = nUniqPoints++;
}
else
{
mergeList_[pointLabel] = mergeList_[mergeList_[pointLabel]];
mergeList_[pointi] = mergeList_[mergeList_[pointi]];
}
}
nPoints_ = newPointLabel;
nPoints_ = nUniqPoints;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,6 +56,7 @@ SourceFiles
#include "globalMeshData.H"
#include "globalIndex.H"
#include "uint.H"
#include "PstreamGlobals.H"
#include "zoltan.h"
#include <mpi.h>

View File

@ -67,7 +67,8 @@ greyDiffusiveRadiationMixedFvPatchScalarField
(
p,
ptf.emissivityMethod(),
ptf.emissivity_
ptf.emissivity_,
mapper
),
TName_(ptf.TName_)
{}
@ -143,6 +144,27 @@ greyDiffusiveRadiationMixedFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
mixedFvPatchScalarField::autoMap(m);
radiationCoupledBase::autoMap(m);
}
void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
mixedFvPatchScalarField::rmap(ptf, addr);
radiationCoupledBase::rmap(ptf, addr);
}
void Foam::radiation::greyDiffusiveRadiationMixedFvPatchScalarField::
updateCoeffs()
{

View File

@ -171,6 +171,21 @@ public:
return TName_;
}
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// Evaluation functions

View File

@ -58,9 +58,10 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField
(
patch(),
ptf.emissivityMethod(),
ptf.emissivity_
ptf.emissivity_,
mapper
),
qro_(ptf.qro_)
qro_(ptf.qro_, mapper)
{}
@ -128,6 +129,32 @@ greyDiffusiveViewFactorFixedValueFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::radiation::greyDiffusiveViewFactorFixedValueFvPatchScalarField::
autoMap
(
const fvPatchFieldMapper& m
)
{
fixedValueFvPatchScalarField::autoMap(m);
radiationCoupledBase::autoMap(m);
qro_.autoMap(m);
}
void Foam::radiation::greyDiffusiveViewFactorFixedValueFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
fixedValueFvPatchScalarField::rmap(ptf, addr);
radiationCoupledBase::rmap(ptf, addr);
const greyDiffusiveViewFactorFixedValueFvPatchScalarField& mrptf =
refCast<const greyDiffusiveViewFactorFixedValueFvPatchScalarField>(ptf);
qro_.rmap(mrptf.qro_, addr);
}
void Foam::radiation::greyDiffusiveViewFactorFixedValueFvPatchScalarField::
updateCoeffs()
{

View File

@ -168,6 +168,20 @@ public:
}
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// Evaluation functions
//- Update the coefficients associated with the patch field

View File

@ -68,7 +68,8 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField
(
p,
ptf.emissivityMethod(),
ptf.emissivity_
ptf.emissivity_,
mapper
),
TName_(ptf.TName_)
{}
@ -147,6 +148,27 @@ wideBandDiffusiveRadiationMixedFvPatchScalarField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField::
autoMap
(
const fvPatchFieldMapper& m
)
{
mixedFvPatchScalarField::autoMap(m);
radiationCoupledBase::autoMap(m);
}
void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
mixedFvPatchScalarField::rmap(ptf, addr);
radiationCoupledBase::rmap(ptf, addr);
}
void Foam::radiation::wideBandDiffusiveRadiationMixedFvPatchScalarField::
updateCoeffs()
{

View File

@ -165,6 +165,20 @@ public:
}
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// Evaluation functions
//- Update the coefficients associated with the patch field

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -83,7 +83,7 @@ Foam::N2::N2()
2873563218390.8,
-165274505604341.0
),
mu_(32.165, 496.9, 3.9069, -1.08e-21, 10.0),
mu_(-32.165, 496.9, 3.9069, -1.08e-21, 10.0),
mug_(7.632e-07, 0.58823, 67.75, 0.0),
kappa_(0.7259, -0.016728, 0.00016215, -5.7605e-07, 0.0, 0.0),
kappag_(0.000351, 0.7652, 25.767, 0.0),

View File

@ -10,10 +10,18 @@ Description
\*---------------------------------------------------------------------------*/
nLines 24;
start (0 0.5 0);
end (9 0.5 0);
fields (U);
direction both;
seedSampleSet
{
type lineUniform;
start (0 0.5 0);
end (9 0.5 0);
nPoints 24;
axis x;
}
fields (U);
#includeEtc "caseDicts/postProcessing/visualization/streamlines.cfg"

View File

@ -20,7 +20,7 @@ thermoType
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
equationOfState perfectFluid;
specie specie;
energy sensibleEnthalpy;
}
@ -32,6 +32,11 @@ mixture
nMoles 1;
molWeight 18.0; // [g/mol]
}
equationOfState
{
R 3000; // [J/(kg K)]
rho0 1027; // [kg/m^3]
}
thermodynamics
{
Cp 4181; // [J/(kg K)] at T = 293 K

View File

@ -33,7 +33,7 @@ writeInterval 1e-2;
purgeWrite 0;
writeFormat ascii;
writeFormat binary;
writePrecision 10;

View File

@ -34,7 +34,8 @@ boundaryField
wing
{
type noSlip;
type movingWallVelocity;
value uniform (0 0 0);
}
#include "include/frontBackTopBottomPatches"

View File

@ -33,7 +33,7 @@ writeInterval 100;
purgeWrite 0;
writeFormat ascii;
writeFormat binary;
writePrecision 6;

View File

@ -18,7 +18,7 @@ runApplication -s collapseFaces \
runApplication checkMesh -allTopology -allGeometry -latestTime
latestTime=`foamListTimes -latestTime`
latestTime="$(foamListTimes -latestTime)"
# Move the mesh into polyMesh
rm -rf constant/polyMesh

View File

@ -10,12 +10,19 @@ Description
\*---------------------------------------------------------------------------*/
nLines 10;
start (-0.0205 0.001 0.00001);
end (-0.0205 0.0251 0.00001);
fields (p k U);
direction both;
seedSampleSet
{
type lineUniform;
start (-0.0205 0.001 0.00001);
end (-0.0205 0.0251 0.00001);
nPoints 10;
axis x;
}
fields (p k U);
// Must be last entry
#includeEtc "caseDicts/postProcessing/visualization/streamlines.cfg"
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/

View File

@ -33,7 +33,8 @@ EulerImplicitCoeffs
odeCoeffs
{
solver seulex;
eps 0.05;
absTol 1e-8;
relTol 1e-1;
}

View File

@ -17,6 +17,8 @@ reactions
A 7e+06;
beta 0;
Ta 10063.8;
Thigh 2500;
Tlow 300;
}
hydrogenReaction
{
@ -25,6 +27,7 @@ reactions
A 4.74342e+12;
beta 0;
Ta 10063.8;
Thigh 2500;
Tlow 300;
}
}

View File

@ -16,9 +16,6 @@ intersectSurfaces()
surfaceBooleanFeatures "$@" intersection
}
# Set application name
application=$(getApplication)
# Run the surface preparation script
./constant/triSurface/surfaceProcess.sh > log.surfaceProcess 2>&1

View File

@ -8,9 +8,8 @@
FoamFile
{
version 2.0;
format binary;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -8,9 +8,8 @@
FoamFile
{
version 2.0;
format binary;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -8,9 +8,8 @@
FoamFile
{
version 2.0;
format binary;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -8,9 +8,8 @@
FoamFile
{
version 2.0;
format binary;
format ascii;
class volScalarField;
location "0";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -4,9 +4,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application=$(getApplication)
# Meshing
runApplication blockMesh
runApplication surfaceFeatures

View File

@ -1,40 +0,0 @@
36
(
1069
1071
1074
1253
1256
1259
1262
1264
1266
1269
1271
1273
1276
1463
1466
1468
1471
1474
1477
1480
1482
1485
1487
1490
1492
1494
1497
1500
1503
1506
1508
1512
1514
1517
1519
1522
)

View File

@ -25,7 +25,7 @@ stopAt endTime;
endTime 5.0;
deltaT 1e-4;
deltaT 0.001;
writeControl adjustableRunTime;

View File

@ -191,6 +191,30 @@ castellatedMeshControls
features
(
{
file "shaftRotating.eMesh";
levels ((1 1));
}
{
file "shaft.eMesh";
levels ((1 1));
}
{
file "sparger.eMesh";
levels ((1 1));
}
{
file "stirrer.eMesh";
levels ((1 1));
}
{
file "baffles.eMesh";
levels ((1 1));
}
{
file "rotating.eMesh";
levels ((1 1));
}
{
file "gasInlet.eMesh";
levels ((1 1));
@ -520,7 +544,7 @@ meshQualityControls
// <0 = inside out tet,
// 0 = flat tet
// 1 = regular tet
minTetQuality 1e-9;
minTetQuality -1e-30;
// Minimum face area. Set to <0 to disable.
minArea -1;

View File

@ -20,6 +20,11 @@ surfaces
"gasInlet.stl"
"stirrer.stl"
"outlet.stl"
"shaft.stl"
"shaftRotating.stl"
"rotating.stl"
"baffles.stl"
"sparger.stl"
);
// Identify a feature when angle between faces < includedAngle

View File

@ -4,8 +4,6 @@ cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
application=$(getApplication)
runApplication blockMesh
echo "Creating channel"
@ -14,7 +12,7 @@ while [ "$i" -lt 3 ] ; do
cp system/extrudeMeshDict.${i} system/extrudeMeshDict
echo "Running extrudeMesh, instance" ${i}
extrudeMesh > log.extrudeMesh.${i}
i=`expr $i + 1`
i=$((i + 1))
done
#------------------------------------------------------------------------------