Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Allwmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------

foamv=${WM_PROJECT_VERSION}
curr_branch=$(git branch --show-current)
if [[ $curr_branch == "master" || $curr_branch == "v2212" ]]; then
# Switch branches if necessary
if [[ $foamv =~ ^v([0-9]{4})$ ]]; then
ver=${BASH_REMATCH[1]}
if [ "${ver}" -eq "2106" ]; then
Expand All @@ -22,6 +25,7 @@ else
echo "${WM_PROJECT}-${foamv} is not supported, this toolkit only works with OpenCFD's releases of OpenFOAM."
exit 1
fi
fi

#------------------------------------------------------------------------------

Expand Down
1 change: 0 additions & 1 deletion src/errorEstimators/gradientRange/gradientRange.C
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,3 @@ void gradientEstimator::update(const bool scale)
} // End namespace Foam

// ************************************************************************* //

3 changes: 2 additions & 1 deletion tutorials/damBreak2D/Allrun
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------

set -e
restore0Dir
runApplication blockMesh

Expand All @@ -21,6 +22,6 @@ for i in $(seq 1 $maxRef); do
done
cp -rT 0/polyMesh constant/polyMesh
runApplication decomposePar -constant
#mpirun -np 8 --output-filename log interFoam -parallel
mpirun -np 4 --output-filename log interFoam -parallel

#------------------------------------------------------------------------------
5 changes: 4 additions & 1 deletion tutorials/damBreak2D/system/controlDict
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ maxAlphaCo 1;

maxDeltaT 1;

//#sinclude "sampling"
functions
{
#include "sampling"
}

// ************************************************************************* //
94 changes: 61 additions & 33 deletions tutorials/damBreak2D/system/sampling
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2012 |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Expand All @@ -14,41 +14,69 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

functions
__surfaceFieldValue
{
sampleSets
type surfaceFieldValue;
libs (fieldFunctionObjects);
log on;
enabled true;
writeControl timeStep;
writeInterval 1;
writeFields false;
surfaceFormat vtk;
}


// * * * * * * * * * * * * * * * * Sampling * * * * * * * * * * * * * * * * //

// Sample volume fields to surfaces and hold on registry.
sampled
{
type surfaces;
libs (sampling);
log true;

executeControl timeStep;
executeInterval 1;
writeControl none;
sampleOnExecute true;
surfaceFormat none;
fields ( p U );
surfaces
{
walls
{
type patch;
patches ( ".*Wall" );
// triangulate false;
}
}
}


// * * * * * * * * * * * * * * * Calculations * * * * * * * * * * * * * * * //

nonWeightedAreaAverage
{
${__surfaceFieldValue}
enabled true;

regionType sampledSurface;
name sampledTriSurf;
sampledSurfaceDict
{
type sets;
libs (sampling);

writeControl timeStep;
writeInterval 1;

setFormat vtk;
interpolationScheme cellPointFace;
fields ( alpha.water );

sets
(
gauge_1
{
type face;
axis y;
start (0.02 0.20 0.005);
end (0.02 0.25 0.005);
nPoints 100;
}

gauge_2
{
type face;
axis y;
start (0.2 0.03 0.005);
end (0.2 0.55 0.005);
nPoints 100;
}
);
type patch;
patches ( ".*Wall" );
interpolate true;
}

operation areaAverage;
fields ( p U );
}

// * * * * * * * * * * * * * * * * * Cleanup * * * * * * * * * * * * * * * * //

#remove "__.*"


// ************************************************************************* //