Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
59eb1f4d
Commit
59eb1f4d
authored
May 26, 2011
by
Henry
Browse files
Merge branch 'master' of
ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
parents
b6f88972
1025e4dd
Changes
98
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
59eb1f4d
...
...
@@ -60,8 +60,8 @@ doc/[Dd]oxygen/man
# untracked configuration files
/etc/prefs.csh
/etc/prefs.sh
/etc/config/
*
.csh
/etc/config/
*
.sh
/etc/config/
prefs
.csh
/etc/config/
prefs
.sh
# source packages - anywhere
*.tar.bz2
...
...
ReleaseNotes-dev
View file @
59eb1f4d
...
...
@@ -241,9 +241,11 @@
- works in parallel
+ =snappyHexMesh=:
+ extrude across multi-processor boundaries
+ preserve faceZones during layering
+ combining
patch faces
after snapping
+ preserve faceZones
shape
during layering
+ combining
coincident patch faces is now default
after snapping
+ *Warning*:
- snapControls::tolerance setting fixed w.r.t. 17x. Is the
multiplication to calculate the local search distance for nearest.
- minMedianAxisAngle angle fixed w.r.t. 17x. Set to
90 to get same behaviour as 130 in 17x.
- nGrow did not work in 17x. Set to 0
...
...
@@ -308,6 +310,8 @@
+ multipleBoxes, hotBoxes, panel, evaporationTest
+ =interDyMFoam= tutorials:
+ testTubeMixer: showcases =solidBodyMotionFunction=
+ =snappyHexMesh= tutorials:
+ flange: demonstration of feature lines in snappyHexMesh
* Other
+ compilable with =clang=
...
...
applications/solvers/basic/potentialFoam/potentialFoam.C
View file @
59eb1f4d
...
...
@@ -49,6 +49,10 @@ int main(int argc, char *argv[])
Info
<<
nl
<<
"Calculating potential flow"
<<
endl
;
// Since solver contains no time loop it would never execute
// function objects so do it ourselves.
runTime
.
functionObjects
().
start
();
adjustPhi
(
phi
,
U
,
p
);
for
(
int
nonOrth
=
0
;
nonOrth
<=
nNonOrthCorr
;
nonOrth
++
)
...
...
@@ -99,6 +103,9 @@ int main(int argc, char *argv[])
p
.
write
();
}
runTime
.
functionObjects
().
end
();
Info
<<
"ExecutionTime = "
<<
runTime
.
elapsedCpuTime
()
<<
" s"
<<
" ClockTime = "
<<
runTime
.
elapsedClockTime
()
<<
" s"
<<
nl
<<
endl
;
...
...
applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/createShellMesh.C
View file @
59eb1f4d
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-201
0
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-201
1
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -453,6 +453,7 @@ void Foam::createShellMesh::setRefinement
label
region0
=
pointRegions_
[
eFaces
[
0
]][
fp0
];
label
region1
=
pointRegions_
[
eFaces
[
0
]][
fp1
];
// Pick up points with correct normal
if
(
layerI
==
0
)
{
newF
[
0
]
=
f
[
fp0
];
...
...
@@ -468,6 +469,22 @@ void Foam::createShellMesh::setRefinement
newF
[
3
]
=
addedPoints
[
nLayers
*
region0
+
layerI
];
}
// Optionally rotate so e[0] is always 0th vertex. Note that
// this normally is automatically done by coupled face ordering
// but with NOORDERING we have to do it ourselves.
if
(
f
[
fp0
]
!=
e
[
0
])
{
// rotate one back to get newF[1] (originating from e[0])
// into newF[0]
label
v0
=
newF
[
0
];
for
(
label
i
=
0
;
i
<
newF
.
size
()
-
1
;
i
++
)
{
newF
[
i
]
=
newF
[
newF
.
fcIndex
(
i
)];
}
newF
.
last
()
=
v0
;
}
label
minCellI
=
addedCells
[
nLayers
*
eFaces
[
0
]
+
layerI
];
label
maxCellI
;
label
patchI
;
...
...
@@ -569,6 +586,21 @@ void Foam::createShellMesh::setRefinement
newF
[
3
]
=
addedPoints
[
nLayers
*
region0
+
layerI
];
}
// Optionally rotate so e[0] is always 0th vertex. Note that
// this normally is automatically done by coupled face
// ordering but with NOORDERING we have to do it ourselves.
if
(
f
[
fp0
]
!=
e
[
0
])
{
// rotate one back to get newF[1] (originating
// from e[0]) into newF[0].
label
v0
=
newF
[
0
];
for
(
label
i
=
0
;
i
<
newF
.
size
()
-
1
;
i
++
)
{
newF
[
i
]
=
newF
[
newF
.
fcIndex
(
i
)];
}
newF
.
last
()
=
v0
;
}
////if (ePatches.size() == 0)
//{
// Pout<< "Adding from MULTI face:"
...
...
applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict
View file @
59eb1f4d
...
...
@@ -220,7 +220,7 @@ snapControls
//- Maximum relative distance for points to be attracted by surface.
// True distance is this factor times local maximum edge length.
// Note: changed(corrected) w.r.t 17x! (17x used 2* tolerance)
tolerance
2
.0;
tolerance
1
.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 30;
...
...
@@ -228,6 +228,10 @@ snapControls
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
//- Highly experimental and wip: number of feature edge snapping
// iterations. Leave out altogether to disable.
//nFeatureSnapIter 10;
}
...
...
@@ -258,6 +262,9 @@ addLayersControls
//- Wanted thickness of final added cell layer. If multiple layers
// is the
// thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
// is the thickness of the layer furthest away from the wall.
// See relativeSizes parameter.
finalLayerThickness 0.3;
...
...
@@ -410,7 +417,7 @@ debug 0;
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1
E
-6;
mergeTolerance 1
e
-6;
// ************************************************************************* //
applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C
View file @
59eb1f4d
...
...
@@ -144,10 +144,30 @@ bool writeZones(const word& name, const fileName& meshDir, Time& runTime)
int
main
(
int
argc
,
char
*
argv
[])
{
timeSelector
::
addOptions
();
argList
::
addBoolOption
(
"noConstant"
,
"exclude the 'constant/' dir in the times list"
);
# include "addRegionOption.H"
# include "setRootCase.H"
// enable noConstant by switching
if
(
!
args
.
optionFound
(
"noConstant"
))
{
args
.
setOption
(
"constant"
,
""
);
}
else
{
args
.
unsetOption
(
"constant"
);
Info
<<
"Excluding the constant directory."
<<
nl
<<
endl
;
}
# include "createTime.H"
// Make sure we do not use the master-only reading since we read
// fields (different per processor) as dictionaries.
regIOobject
::
fileModificationChecking
=
regIOobject
::
timeStamp
;
...
...
applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C
View file @
59eb1f4d
...
...
@@ -98,6 +98,44 @@ autoPtr<fvMesh> createMesh
xferCopy
(
labelList
()),
false
);
// Add some dummy zones so upon reading it does not read them
// from the undecomposed case. Should be done as extra argument to
// regIOobject::readStream?
List
<
pointZone
*>
pz
(
1
,
new
pointZone
(
"dummyPointZone"
,
labelList
(
0
),
0
,
dummyMesh
.
pointZones
()
)
);
List
<
faceZone
*>
fz
(
1
,
new
faceZone
(
"dummyFaceZone"
,
labelList
(
0
),
boolList
(
0
),
0
,
dummyMesh
.
faceZones
()
)
);
List
<
cellZone
*>
cz
(
1
,
new
cellZone
(
"dummyCellZone"
,
labelList
(
0
),
0
,
dummyMesh
.
cellZones
()
)
);
dummyMesh
.
addZones
(
pz
,
fz
,
cz
);
//Pout<< "Writing dummy mesh to " << dummyMesh.polyMesh::objectPath()
// << endl;
dummyMesh
.
write
();
...
...
@@ -239,7 +277,11 @@ autoPtr<fvMesh> createMesh
if
(
!
haveMesh
)
{
// Add the zones
// Add the zones. Make sure to remove the old dummy ones first
mesh
.
pointZones
().
clear
();
mesh
.
faceZones
().
clear
();
mesh
.
cellZones
().
clear
();
List
<
pointZone
*>
pz
(
pointZoneNames
.
size
());
forAll
(
pointZoneNames
,
i
)
{
...
...
@@ -389,6 +431,12 @@ void printMeshData(const polyMesh& mesh)
globalIndex
globalBoundaryFaces
(
mesh
.
nFaces
()
-
mesh
.
nInternalFaces
());
label
maxProcCells
=
0
;
label
totProcFaces
=
0
;
label
maxProcPatches
=
0
;
label
totProcPatches
=
0
;
label
maxProcFaces
=
0
;
for
(
label
procI
=
0
;
procI
<
Pstream
::
nProcs
();
procI
++
)
{
Info
<<
endl
...
...
@@ -413,7 +461,32 @@ void printMeshData(const polyMesh& mesh)
<<
" Number of processor faces = "
<<
nProcFaces
<<
nl
<<
" Number of boundary faces = "
<<
globalBoundaryFaces
.
localSize
(
procI
)
<<
endl
;
maxProcCells
=
max
(
maxProcCells
,
globalCells
.
localSize
(
procI
));
totProcFaces
+=
nProcFaces
;
totProcPatches
+=
nei
.
size
();
maxProcPatches
=
max
(
maxProcPatches
,
nei
.
size
());
maxProcFaces
=
max
(
maxProcFaces
,
nProcFaces
);
}
// Stats
scalar
avgProcCells
=
scalar
(
globalCells
.
size
())
/
Pstream
::
nProcs
();
scalar
avgProcPatches
=
scalar
(
totProcPatches
)
/
Pstream
::
nProcs
();
scalar
avgProcFaces
=
scalar
(
totProcFaces
)
/
Pstream
::
nProcs
();
Info
<<
nl
<<
"Number of processor faces = "
<<
totProcFaces
/
2
<<
nl
<<
"Max number of cells = "
<<
maxProcCells
<<
" ("
<<
100
.
0
*
(
maxProcCells
-
avgProcCells
)
/
avgProcCells
<<
"% above average "
<<
avgProcCells
<<
")"
<<
nl
<<
"Max number of processor patches = "
<<
maxProcPatches
<<
" ("
<<
100
.
0
*
(
maxProcPatches
-
avgProcPatches
)
/
avgProcPatches
<<
"% above average "
<<
avgProcPatches
<<
")"
<<
nl
<<
"Max number of faces between processors = "
<<
maxProcFaces
<<
" ("
<<
100
.
0
*
(
maxProcFaces
-
avgProcFaces
)
/
avgProcFaces
<<
"% above average "
<<
avgProcFaces
<<
")"
<<
nl
<<
endl
;
}
...
...
@@ -641,6 +714,16 @@ int main(int argc, char *argv[])
);
# include "setRootCase.H"
if
(
env
(
"FOAM_SIGFPE"
))
{
WarningIn
(
args
.
executable
())
<<
"Detected floating point exception trapping (FOAM_SIGFPE)."
<<
" This might give"
<<
nl
<<
" problems when mapping fields. Switch it off in case"
<<
" of problems."
<<
endl
;
}
// Create processor directory if non-existing
if
(
!
Pstream
::
master
()
&&
!
isDir
(
args
.
path
()))
{
...
...
@@ -906,7 +989,7 @@ int main(int argc, char *argv[])
// Debugging: Create additional volField that will be mapped.
// Used to test correctness of mapping
volVectorField
mapCc
(
"mapCc"
,
1
*
mesh
.
C
());
//
volVectorField mapCc("mapCc", 1*mesh.C());
// Global matching tolerance
const
scalar
tolDim
=
getMergeDistance
...
...
@@ -948,7 +1031,7 @@ int main(int argc, char *argv[])
// Debugging: test mapped cellcentre field.
compareFields
(
tolDim
,
mesh
.
C
(),
mapCc
);
//
compareFields(tolDim, mesh.C(), mapCc);
// Print nice message
// ~~~~~~~~~~~~~~~~~~
...
...
bin/paraFoam
View file @
59eb1f4d
...
...
@@ -37,7 +37,7 @@ usage() {
while
[
"$#"
-ge
1
]
;
do
echo
"
$1
"
;
shift
;
done
cat
<<
USAGE
Usage:
${
0
##*/
}
[OPTION]
Usage:
${
0
##*/
}
[OPTION]
[PARAVIEW_OPTION]
options:
-block use blockMesh reader (uses .blockMesh extension)
-builtin use VTK builtin OpenFOAM reader (uses .foam extension)
...
...
@@ -47,6 +47,9 @@ options:
-touchAll create .blockMesh, .OpenFOAM files (and for all regions)
-help print the usage
paraview options start with a double dashes
* start paraview
$ParaView_VERSION
with the OpenFOAM libraries
USAGE
...
...
@@ -57,7 +60,7 @@ USAGE
# to clean up
unset
FOAM_ABORT
unset
regionName
t
ouch
Opt
unset
regionName
optT
ouch
# reader extension
extension
=
OpenFOAM
...
...
@@ -88,12 +91,19 @@ do
shift
2
;;
-touch
)
t
ouch
Opt
=
true
optT
ouch
=
true
shift
;;
-touchAll
)
touchOpt
=
all
optTouch
=
all
shift
;;
--
)
shift
break
# stop here, treat balance as paraview options
;;
--
*
)
break
# stop here, treat this and balance as paraview options
;;
*
)
usage
"unknown option/argument: '
$*
'"
...
...
@@ -101,6 +111,28 @@ do
esac
done
#
# check for --data=... argument
#
hasDataArg
()
{
hasData
=
false
while
[
"$#"
-gt
0
]
do
case
"
$1
"
in
(
--data
=
*
)
hasData
=
true
break
;;
esac
shift
done
}
hasDataArg
$@
# get a sensible caseName from the directory name
caseName
=
${
PWD
##*/
}
caseFile
=
"
$caseName
.
$extension
"
...
...
@@ -112,7 +144,7 @@ then
fvControls
=
"
$fvControls
/
$regionName
"
fi
case
"
${
t
ouch
Opt
:-
false
}
"
in
case
"
${
optT
ouch
:-
false
}
"
in
all
)
extension
=
OpenFOAM
if
[
-f
constant/polyMesh/blockMeshDict
]
...
...
@@ -149,33 +181,56 @@ case "$caseName" in
esac
#
# check existence of essential files
#
case
$extension
in
blockMesh
)
for
check
in
system/controlDict constant/polyMesh/blockMeshDict
do
[
-s
"
$parentDir
/
$check
"
]
||
usage
"file does not exist: '
$parentDir
/
$check
'"
done
;;
if
[
"
${
hasData
:-
false
}
"
=
true
]
then
builtin
|
OpenFOAM
)
for
check
in
system/controlDict
$fvControls
/fvSchemes
$fvControls
/fvSolution
do
[
-s
"
$parentDir
/
$check
"
]
||
usage
"file does not exist: '
$parentDir
/
$check
'"
done
;;
esac
# has --data=.., send directly to paraview
exec
paraview
"
$@
"
else
# check existence of essential files
warn
=
"WARN file does not exist:"
case
$extension
in
blockMesh
)
for
check
in
\
system/controlDict
\
constant/polyMesh/blockMeshDict
\
;
do
[
-s
"
$parentDir
/
$check
"
]
||
{
[
-n
"
$warn
"
]
&&
echo
"
$warn
"
1>&2
echo
"
$parentDir
/
$check
"
1>&2
unset
warn
}
done
;;
builtin
|
OpenFOAM
)
for
check
in
\
system/controlDict
\
$fvControls
/fvSchemes
\
$fvControls
/fvSolution
\
;
do
[
-s
"
$parentDir
/
$check
"
]
||
{
[
-n
"
$warn
"
]
&&
echo
"
$warn
"
1>&2
echo
"
$parentDir
/
$check
"
1>&2
unset
warn
}
done
;;
esac
# only create/remove caseFile if it didn't already exist
[
-e
$caseFile
]
||
{
trap
"rm -f
$caseFile
2>/dev/null; exit 0"
EXIT TERM INT
touch
"
$caseFile
"
echo
"created temporary '
$caseFile
'"
}
# only create/remove caseFile if it didn't already exist
[
-e
$caseFile
]
||
{
trap
"rm -f
$caseFile
2>/dev/null; exit 0"
EXIT TERM INT
touch
"
$caseFile
"
echo
"created temporary '
$caseFile
'"
}
paraview
--data
=
"
$caseFile
"
"
$@
"
fi
paraview
--data
=
"
$caseFile
"
#------------------------------------------------------------------------------
bin/tools/foamConfigurePaths
View file @
59eb1f4d
...
...
@@ -131,7 +131,7 @@ do
paraviewInstall
=
"
$2
"
# replace ParaView_DIR=...
_inlineSed
\
etc/
apps
/paraview
3/bashrc
\
etc/
config
/paraview
.sh
\
'/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='
"
$paraviewInstall
@"
\
"Replacing ParaView_DIR setting by '
$paraviewInstall
'"
shift
2
...
...
etc/bashrc
View file @
59eb1f4d
...
...
@@ -120,7 +120,12 @@ export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
# Location of site-specific templates etc
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# unset is equivalent to $WM_PROJECT_INST_DIR/site
unset
WM_PROJECT_SITE
if
[
-d
"
$WM_PROJECT_SITE
"
]
then
export
WM_PROJECT_SITE
else
unset
WM_PROJECT_SITE
fi
# Location of user files
# ~~~~~~~~~~~~~~~~~~~~~~
...
...
@@ -177,7 +182,7 @@ _foamEval()
_foamSource
`
$WM_PROJECT_DIR
/bin/foamEtcFile prefs.sh
`
# Evaluate command-line parameters and record settings for later
# these can be used to set/unset values, or specify pref
s
files
# these can be used to set/unset values, or specify
alternative
pref files
export
FOAM_SETTINGS
=
"
$@
"
_foamEval
$@
...
...
@@ -200,14 +205,14 @@ export PATH LD_LIBRARY_PATH MANPATH
# Source project setup files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource
$WM_PROJECT_DIR
/etc/settings.sh
_foamSource
$WM_PROJECT_DIR
/etc/aliases.sh
_foamSource
$WM_PROJECT_DIR
/etc/
config/
settings.sh
_foamSource
$WM_PROJECT_DIR
/etc/
config/
aliases.sh
# Source user setup files for optional packages
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource
`
$WM_PROJECT_DIR
/bin/foamEtcFile
apps
/paraview
3/bashrc
`
_foamSource
`
$WM_PROJECT_DIR
/bin/foamEtcFile
apps
/ensight
/bashrc
`
_foamSource
`
$WM_PROJECT_DIR
/bin/foamEtcFile
config
/paraview
.sh
`
_foamSource
`
$WM_PROJECT_DIR
/bin/foamEtcFile
config
/ensight
.sh
`
# Clean environment paths again. Only remove duplicates
...
...
etc/config/README
0 → 100644
View file @
59eb1f4d
The main OpenFOAM settings are located in the parent etc/ directory
* bashrc, cshrc
entry point for sourcing
* prefs.csh, prefs.sh
these files are untracked and can be used for some site-defined
settings
The etc/config/ directory contains various configuration files in
sh/csh variants:
* settings.csh, settings.sh
core settings
* aliases.csh, aliases.sh
aliases for interactive shells
* unset.csh, unset.sh
sourced to clear as many OpenFOAM environment settings as possible
* ensight.csh, ensight.sh
application settings for EnSight
* paraview.csh, paraview.sh
application settings for ParaView
* scotch.sh
application settings for compiling against scotch
---
The config/example directory contains various example configuration files
in sh/csh variants
* compiler.csh, compiler.sh
an example of fine tuning ThirdParty compiler settings for OpenFOAM
* openmpi.csh, openmpi.sh
an example of fine tuning openmpi settings for OpenFOAM
* paraview.csh, paraview.sh
an example of chaining to the standard config/paraview.sh with a
different ParaView_VERSION
* prefs.csh, prefs.sh
an example of supplying alternative site-defined settings
---
etc/aliases.csh
→
etc/
config/
aliases.csh
View file @
59eb1f4d
...
...
@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/aliases.csh
# etc/
config/
aliases.csh
#
# Description
# Aliases for working with OpenFOAM
...
...
@@ -39,7 +39,7 @@ alias wmSP 'wmSET WM_PRECISION_OPTION=SP'
alias
wmDP
'wmSET WM_PRECISION_OPTION=DP'
# clear env
alias
wmUNSET
=
'source $WM_PROJECT_DIR/etc/unset.csh'
alias
wmUNSET
=
'source $WM_PROJECT_DIR/etc/
config/
unset.csh'
# Toggle wmakeScheduler on/off
# - also need to set WM_HOSTS
...
...
@@ -49,7 +49,7 @@ alias wmSchedOFF 'unsetenv WM_SCHEDULER'
# Change ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~
alias
foamPV
'source `$WM_PROJECT_DIR/etc/
apps
/paraview
3/
csh
rc
` ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION'
alias
foamPV
'source `$WM_PROJECT_DIR/etc/
config
/paraview
.
csh` ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION'
# Change directory aliases
...
...
etc/aliases.sh
→
etc/
config/
aliases.sh
View file @
59eb1f4d
...
...
@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.