TUT: Alltest: minor corrections (#1956)
This commit is contained in:
parent
e646218af9
commit
bcae4b7a4f
@ -23,8 +23,8 @@ boundaryField
|
|||||||
{
|
{
|
||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type uniformFixedValue;
|
type fixedValue;
|
||||||
uniformValue 0.000141;
|
value uniform 0.000141;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
|
@ -54,55 +54,50 @@ functions
|
|||||||
AMI1
|
AMI1
|
||||||
{
|
{
|
||||||
type surfaceFieldValue;
|
type surfaceFieldValue;
|
||||||
functionObjectLibs ("libfieldFunctionObjects.so");
|
libs (fieldFunctionObjects);
|
||||||
log true;
|
log true;
|
||||||
executeControl timeStep;
|
executeControl timeStep;
|
||||||
executeInterval 1;
|
executeInterval 1;
|
||||||
writeFields true;
|
writeFields true;
|
||||||
regionType patch;
|
regionType patch;
|
||||||
name AMI1;
|
name AMI1;
|
||||||
operation sum;
|
operation sum;
|
||||||
surfaceFormat none;
|
surfaceFormat none;
|
||||||
fields (phi);
|
fields (phi);
|
||||||
}
|
}
|
||||||
|
|
||||||
AMI2
|
AMI2
|
||||||
{
|
{
|
||||||
type surfaceFieldValue;
|
type surfaceFieldValue;
|
||||||
functionObjectLibs ("libfieldFunctionObjects.so");
|
libs (fieldFunctionObjects);
|
||||||
log true;
|
log true;
|
||||||
executeControl timeStep;
|
executeControl timeStep;
|
||||||
executeInterval 1;
|
executeInterval 1;
|
||||||
writeFields true;
|
writeFields true;
|
||||||
regionType patch;
|
regionType patch;
|
||||||
name AMI2;
|
name AMI2;
|
||||||
operation sum;
|
operation sum;
|
||||||
surfaceFormat none;
|
surfaceFormat none;
|
||||||
fields (phi);
|
fields (phi);
|
||||||
}
|
}
|
||||||
|
|
||||||
forces
|
forces
|
||||||
{
|
{
|
||||||
type forces;
|
type forces;
|
||||||
|
libs (forces);
|
||||||
functionObjectLibs ( "libforces.so" );
|
writeControl timeStep;
|
||||||
|
timeInterval 1;
|
||||||
outputControl timeStep;
|
log yes;
|
||||||
timeInterval 1;
|
patches ( "rotor" );
|
||||||
|
pName p;
|
||||||
log yes;
|
UName U;
|
||||||
|
rho rhoInf; // Indicates incompressible
|
||||||
patches ( "rotor" );
|
log true;
|
||||||
pName p;
|
rhoInf 997; // Redundant for incompressible
|
||||||
UName U;
|
CofR (0 0 0); // Rotation around centre line of propeller
|
||||||
rho rhoInf; // Indicates incompressible
|
pitchAxis (0 0 1);
|
||||||
log true;
|
}
|
||||||
rhoInf 997; // Redundant for incompressible
|
|
||||||
|
|
||||||
CofR (0 0 0); // Rotation around centre line of propeller
|
|
||||||
pitchAxis (0 0 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
@ -25,11 +25,9 @@ actions
|
|||||||
type faceSet;
|
type faceSet;
|
||||||
action new;
|
action new;
|
||||||
source patchToFace;
|
source patchToFace;
|
||||||
sourceInfo
|
patch "AMI.*";
|
||||||
{
|
|
||||||
name "AMI.*";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
@ -60,44 +60,8 @@ serialRun() {
|
|||||||
runApplication WatersKing
|
runApplication WatersKing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Plot streamwise flow speed at y=1.0 [m] as a function of time
|
|
||||||
#
|
|
||||||
# $* = models
|
|
||||||
# ----
|
|
||||||
plot() {
|
|
||||||
# Require gnuplot
|
|
||||||
command -v gnuplot >/dev/null || {
|
|
||||||
echo "gnuplot not found - skipping graph creation" 1>&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
models=$*
|
|
||||||
endTime=$(foamDictionary -entry endTime -value system/controlDict)
|
|
||||||
|
|
||||||
gnuplot<<PLT
|
|
||||||
set terminal pngcairo font "helvetica,16" size 800,600
|
|
||||||
set output "planarPoiseuille.png"
|
|
||||||
set grid
|
|
||||||
set key right top
|
|
||||||
set xrange [0:"$endTime"]
|
|
||||||
set yrange [0:8]
|
|
||||||
set xlabel "t [s]"
|
|
||||||
set ylabel "U_x [m/s]" rotate by 0 offset 3,0,0
|
|
||||||
|
|
||||||
results=system("ls *.txt")
|
|
||||||
names="${models[*]}"
|
|
||||||
plot \
|
|
||||||
"WatersKing.dat" w lines t "Analytical" lt -1, \
|
|
||||||
for [i=1:words(results)] word(results, i) t word(names, i) \
|
|
||||||
w linespoints pointinterval 100 lt i pt 6 ps 1.5
|
|
||||||
|
|
||||||
PLT
|
|
||||||
}
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
serialRun $endTime $models
|
serialRun $endTime $models
|
||||||
plot $models
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
50
tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/plot
Executable file
50
tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/plot
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
models="
|
||||||
|
Maxwell
|
||||||
|
Stokes
|
||||||
|
"
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Plot streamwise flow speed at y=1.0 [m] as a function of time
|
||||||
|
#
|
||||||
|
# $* = models
|
||||||
|
# ----
|
||||||
|
plot() {
|
||||||
|
# Require gnuplot
|
||||||
|
command -v gnuplot >/dev/null || {
|
||||||
|
echo "gnuplot not found - skipping graph creation" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
models=$*
|
||||||
|
endTime=$(foamDictionary -entry endTime -value system/controlDict)
|
||||||
|
|
||||||
|
gnuplot<<PLT
|
||||||
|
set terminal pngcairo font "helvetica,16" size 800,600
|
||||||
|
set output "planarPoiseuille.png"
|
||||||
|
set grid
|
||||||
|
set key right top
|
||||||
|
set xrange [0:"$endTime"]
|
||||||
|
set yrange [0:8]
|
||||||
|
set xlabel "t [s]"
|
||||||
|
set ylabel "U_x [m/s]" rotate by 0 offset 3,0,0
|
||||||
|
|
||||||
|
results=system("ls *.txt")
|
||||||
|
names="${models[*]}"
|
||||||
|
plot \
|
||||||
|
"WatersKing.dat" w lines t "Analytical" lt -1, \
|
||||||
|
for [i=1:words(results)] word(results, i) t word(names, i) \
|
||||||
|
w linespoints pointinterval 100 lt i pt 6 ps 1.5
|
||||||
|
PLT
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
plot $models
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -21,4 +21,10 @@ solution
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
constantProperties
|
||||||
|
{
|
||||||
|
volumeUpdateMethod constantRho;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
@ -62,6 +62,11 @@ solvers
|
|||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Phi
|
||||||
|
{
|
||||||
|
$p_rgh;
|
||||||
|
}
|
||||||
|
|
||||||
"(Yi|O2|N2|H2O)"
|
"(Yi|O2|N2|H2O)"
|
||||||
{
|
{
|
||||||
solver PBiCGStab;
|
solver PBiCGStab;
|
||||||
|
@ -21,6 +21,6 @@ runParallel renumberMesh -overwrite
|
|||||||
|
|
||||||
runParallel $(getApplication)
|
runParallel $(getApplication)
|
||||||
|
|
||||||
runParallel redistributePar -reconstruct -latestTime
|
runApplication reconstructPar -latestTime
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
@ -65,8 +65,6 @@ functions
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#includeFunc "samples"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,158 +0,0 @@
|
|||||||
// -*- C++ -*-
|
|
||||||
|
|
||||||
type sets;
|
|
||||||
libs (sampling);
|
|
||||||
interpolationScheme cellPoint;
|
|
||||||
setFormat raw;
|
|
||||||
|
|
||||||
writeControl writeTime;
|
|
||||||
|
|
||||||
fields
|
|
||||||
(
|
|
||||||
T
|
|
||||||
p_rgh
|
|
||||||
U
|
|
||||||
k
|
|
||||||
nut
|
|
||||||
);
|
|
||||||
|
|
||||||
sets
|
|
||||||
(
|
|
||||||
lineZM_C20
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (0.0 0.0 21.0);
|
|
||||||
end (0.0 0.0 500.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_C20
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 40.0);
|
|
||||||
end (9000 0.0 40.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_C100
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 120.0);
|
|
||||||
end (9000 0.0 120.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_C200
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 220.0);
|
|
||||||
end (9000 0.0 220.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_C1000
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 1020.0);
|
|
||||||
end (9000 0.0 1020.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineZM_I20
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000.0 0.0 21.0);
|
|
||||||
end (-9000.0 0.0 500.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_I20
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 40.0);
|
|
||||||
end (9000 0.0 40.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_I100
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 120.0);
|
|
||||||
end (9000 0.0 120.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_I200
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 220.0);
|
|
||||||
end (9000 0.0 220.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_I1000
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 1020.0);
|
|
||||||
end (9000 0.0 1020.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineZM_O20
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (9000.0 0.0 21.0);
|
|
||||||
end (9000.0 0.0 500.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_O20
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 40.0);
|
|
||||||
end (9000.0 0.0 40.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_O100
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 120.0);
|
|
||||||
end (9000.0 0.0 120.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_O200
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 220.0);
|
|
||||||
end (9000.0 0.0 220.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
lineFlowDirM_O1000
|
|
||||||
{
|
|
||||||
type uniform;
|
|
||||||
axis distance;
|
|
||||||
start (-9000 0.0 1020.0);
|
|
||||||
end (9000.0 0.0 1020.0);
|
|
||||||
nPoints 500;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
Loading…
Reference in New Issue
Block a user