11 Commits

Author SHA1 Message Date
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
19 changed files with 248 additions and 82 deletions

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

@ -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,38 @@ error() {
exit 1
}
pvExec () {
paraview "$@" 2> /dev/null && return 0
pvFallback
paraview --mesa "$@"
}
pvFallback () {
cat <<EOF
**********************************************************
ParaView failed to open using available graphics hardware.
Trying fallback to software rendering using MESA.
**********************************************************
EOF
}
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 +129,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 +162,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 +184,6 @@ hasDataArg()
hasDataArg "$@"
# Get a sensible caseName from the directory name
caseName=${PWD##*/}
caseFile="$caseName.$extension"
@ -179,7 +204,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 +214,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 +240,7 @@ if [ "${hasData:-false}" = true ]
then
# Has --data=.., send directly to paraview
exec paraview "$@"
pvExec "$@"
else
@ -235,7 +258,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 +274,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 +288,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 +300,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

@ -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

@ -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

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

@ -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

@ -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

@ -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

@ -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

@ -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