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
dc9f4c77
Commit
dc9f4c77
authored
Nov 12, 2013
by
andy
Browse files
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
parents
a242ce72
630a4b0b
Changes
35
Hide whitespace changes
Inline
Side-by-side
applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H
View file @
dc9f4c77
...
...
@@ -2,7 +2,9 @@ scalar DiNum = -GREAT;
forAll
(
solidRegions
,
i
)
{
#include
"setRegionSolidFields.H"
//- Note: do not use setRegionSolidFields.H to avoid double registering Cp
//#include "setRegionSolidFields.H"
const
solidThermo
&
thermo
=
thermos
[
i
];
tmp
<
volScalarField
>
magKappa
;
if
(
thermo
.
isotropic
())
...
...
@@ -14,6 +16,12 @@ forAll(solidRegions, i)
magKappa
=
mag
(
thermo
.
Kappa
());
}
tmp
<
volScalarField
>
tcp
=
thermo
.
Cp
();
const
volScalarField
&
cp
=
tcp
();
tmp
<
volScalarField
>
trho
=
thermo
.
rho
();
const
volScalarField
&
rho
=
trho
();
DiNum
=
max
(
solidRegionDiffNo
...
...
applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C
View file @
dc9f4c77
...
...
@@ -576,25 +576,30 @@ void writeMesh
(
const
string
&
msg
,
const
meshRefinement
&
meshRefiner
,
const
bool
write
Level
,
const
label
debug
const
meshRefinement
::
debugType
debug
Level
,
const
meshRefinement
::
writeType
writeLevel
)
{
const
fvMesh
&
mesh
=
meshRefiner
.
mesh
();
meshRefiner
.
printMeshInfo
(
debug
,
msg
);
meshRefiner
.
printMeshInfo
(
debug
Level
,
msg
);
Info
<<
"Writing mesh to time "
<<
meshRefiner
.
timeName
()
<<
endl
;
label
flag
=
meshRefinement
::
MESH
;
if
(
writeLevel
)
{
flag
|=
meshRefinement
::
SCALARLEVELS
;
}
if
(
debug
&
meshRefinement
::
OBJINTERSECTIONS
)
{
flag
|=
meshRefinement
::
OBJINTERSECTIONS
;
}
meshRefiner
.
write
(
flag
,
mesh
.
time
().
path
()
/
meshRefiner
.
timeName
());
//label flag = meshRefinement::MESH;
//if (writeLevel)
//{
// flag |= meshRefinement::SCALARLEVELS;
//}
//if (debug & meshRefinement::OBJINTERSECTIONS)
//{
// flag |= meshRefinement::OBJINTERSECTIONS;
//}
meshRefiner
.
write
(
debugLevel
,
meshRefinement
::
writeType
(
writeLevel
|
meshRefinement
::
WRITEMESH
),
mesh
.
time
().
path
()
/
meshRefiner
.
timeName
()
);
Info
<<
"Wrote mesh in = "
<<
mesh
.
time
().
cpuTimeIncrement
()
<<
" s."
<<
endl
;
}
...
...
@@ -837,16 +842,74 @@ int main(int argc, char *argv[])
// Debug
// ~~~~~
const
label
debug
=
meshDict
.
lookupOrDefault
<
label
>
(
"debug"
,
0
);
if
(
debug
>
0
)
// Set debug level
meshRefinement
::
debugType
debugLevel
=
meshRefinement
::
debugType
(
meshDict
.
lookupOrDefault
<
label
>
(
"debug"
,
0
)
);
{
meshRefinement
::
debug
=
debug
;
autoRefineDriver
::
debug
=
debug
;
autoSnapDriver
::
debug
=
debug
;
autoLayerDriver
::
debug
=
debug
;
wordList
flags
;
if
(
meshDict
.
readIfPresent
(
"debugFlags"
,
flags
))
{
debugLevel
=
meshRefinement
::
debugType
(
meshRefinement
::
readFlags
(
meshRefinement
::
IOdebugTypeNames
,
flags
)
);
}
}
if
(
debugLevel
>
0
)
{
meshRefinement
::
debug
=
debugLevel
;
autoRefineDriver
::
debug
=
debugLevel
;
autoSnapDriver
::
debug
=
debugLevel
;
autoLayerDriver
::
debug
=
debugLevel
;
}
// Set file writing level
{
wordList
flags
;
if
(
meshDict
.
readIfPresent
(
"writeFlags"
,
flags
))
{
meshRefinement
::
writeLevel
(
meshRefinement
::
writeType
(
meshRefinement
::
readFlags
(
meshRefinement
::
IOwriteTypeNames
,
flags
)
)
);
}
}
const
bool
writeLevel
=
meshDict
.
lookupOrDefault
<
bool
>
(
"writeLevel"
,
false
);
// Set output level
{
wordList
flags
;
if
(
meshDict
.
readIfPresent
(
"outputFlags"
,
flags
))
{
meshRefinement
::
outputLevel
(
meshRefinement
::
outputType
(
meshRefinement
::
readFlags
(
meshRefinement
::
IOoutputTypeNames
,
flags
)
)
);
}
}
// Read geometry
...
...
@@ -1047,11 +1110,12 @@ int main(int argc, char *argv[])
<<
mesh
.
time
().
cpuTimeIncrement
()
<<
" s"
<<
nl
<<
endl
;
// Some stats
meshRefiner
.
printMeshInfo
(
debug
,
"Initial mesh"
);
meshRefiner
.
printMeshInfo
(
debug
Level
,
"Initial mesh"
);
meshRefiner
.
write
(
debug
&
meshRefinement
::
OBJINTERSECTIONS
,
meshRefinement
::
debugType
(
debugLevel
&
meshRefinement
::
OBJINTERSECTIONS
),
meshRefinement
::
writeType
(
0
),
mesh
.
time
().
path
()
/
meshRefiner
.
timeName
()
);
...
...
@@ -1271,7 +1335,7 @@ int main(int argc, char *argv[])
);
if
(
!
overwrite
&&
!
debug
)
if
(
!
overwrite
&&
!
debug
Level
)
{
const_cast
<
Time
&>
(
mesh
.
time
())
++
;
}
...
...
@@ -1289,8 +1353,8 @@ int main(int argc, char *argv[])
(
"Refined mesh"
,
meshRefiner
,
write
Level
,
debug
debug
Level
,
meshRefinement
::
writeLevel
()
);
Info
<<
"Mesh refined in = "
...
...
@@ -1308,7 +1372,7 @@ int main(int argc, char *argv[])
globalToSlavePatch
);
if
(
!
overwrite
&&
!
debug
)
if
(
!
overwrite
&&
!
debug
Level
)
{
const_cast
<
Time
&>
(
mesh
.
time
())
++
;
}
...
...
@@ -1330,8 +1394,8 @@ int main(int argc, char *argv[])
(
"Snapped mesh"
,
meshRefiner
,
write
Level
,
debug
debug
Level
,
meshRefinement
::
writeLevel
()
);
Info
<<
"Mesh snapped in = "
...
...
@@ -1357,7 +1421,7 @@ int main(int argc, char *argv[])
);
if
(
!
overwrite
&&
!
debug
)
if
(
!
overwrite
&&
!
debug
Level
)
{
const_cast
<
Time
&>
(
mesh
.
time
())
++
;
}
...
...
@@ -1376,8 +1440,8 @@ int main(int argc, char *argv[])
(
"Layer mesh"
,
meshRefiner
,
write
Level
,
debug
debug
Level
,
meshRefinement
::
writeLevel
()
);
Info
<<
"Layers added in = "
...
...
applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict
View file @
dc9f4c77
...
...
@@ -475,14 +475,22 @@ meshQualityControls
// Advanced
// Flags for optional output
// 0 : only write final meshes
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current mesh intersections as .obj files
// 8 : write information about explicit feature edge refinement
// 16 : write information about layers
debug 0;
//// Debug flags
//debugFlags
//(
// mesh // write intermediate meshes
// intersections // write current mesh intersections as .obj files
// featureSeeds, // write information about explicit feature edge refinement
// layerInfo // write information about layers
//);
//
//// Write flags
//writeFlags
//(
// scalarLevels // write volScalarField with cellLevel for postprocessing
// layerSets // write cellSets, faceSets of faces in layer
// layerFields // write volScalarField for layer coverage
//);
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
...
...
applications/utilities/mesh/manipulation/orientFaceZone/orientFaceZone.C
View file @
dc9f4c77
...
...
@@ -46,12 +46,13 @@ using namespace Foam;
int
main
(
int
argc
,
char
*
argv
[])
{
# include "addRegionOption.H"
argList
::
validArgs
.
append
(
"faceZone"
);
argList
::
validArgs
.
append
(
"outsidePoint"
);
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
# include "create
Named
PolyMesh.H"
const
word
zoneName
=
args
[
1
];
const
point
outsidePoint
=
args
.
argRead
<
point
>
(
2
);
...
...
applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
View file @
dc9f4c77
...
...
@@ -104,8 +104,8 @@ int main(int argc, char *argv[])
);
argList
::
addBoolOption
(
"
s
ets"
,
"reconstruct cellSets, faceSets, pointSets"
"
noS
ets"
,
"
skip
reconstruct
ing
cellSets, faceSets, pointSets"
);
argList
::
addBoolOption
(
...
...
@@ -122,10 +122,23 @@ int main(int argc, char *argv[])
args
.
optionLookup
(
"fields"
)()
>>
selectedFields
;
}
const
bool
reconstructSets
=
args
.
optionFound
(
"
sets
"
);
const
bool
noLagrangian
=
args
.
optionFound
(
"
noLagrangian
"
);
if
(
noLagrangian
)
{
Info
<<
"Skipping reconstructing lagrangian positions and fields"
<<
nl
<<
endl
;
}
const
bool
noReconstructSets
=
args
.
optionFound
(
"noSets"
);
if
(
noReconstructSets
)
{
Info
<<
"Skipping reconstructing cellSets, faceSets and pointSets"
<<
nl
<<
endl
;
}
const
bool
noLagrangian
=
args
.
optionFound
(
"noLagrangian"
);
HashSet
<
word
>
selectedLagrangianFields
;
if
(
args
.
optionFound
(
"lagrangianFields"
))
...
...
@@ -682,7 +695,7 @@ int main(int argc, char *argv[])
}
if
(
r
econstructSets
)
if
(
!
noR
econstructSets
)
{
// Scan to find all sets
HashTable
<
label
>
cSetNames
;
...
...
applications/utilities/preProcessing/mapFields/mapFieldsDict
View file @
dc9f4c77
...
...
@@ -14,6 +14,12 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Specify how to map patches. There are three different options:
// - patch exists in the source case: specify mapping (patchMap)
// - patch should be interpolated from internal values in source case
// (cuttingPatches)
// - patch should not be mapped. Default if not in patchMap or cuttingPatches
// List of pairs of target/source patches for mapping
patchMap
(
...
...
src/ODE/ODESolvers/SIBS/SIMPR.C
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.C
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/OpenFOAM/fields/pointPatchFields/basic/calculated/calculatedPointPatchField.C
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/OpenFOAM/fields/pointPatchFields/basic/coupled/coupledPointPatchField.C
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/OpenFOAM/fields/pointPatchFields/basic/zeroGradient/zeroGradientPointPatchField.C
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/OpenFOAM/fields/pointPatchFields/constraint/empty/emptyPointPatchField.C
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.C
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.C
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -25,6 +25,7 @@ License
#include
"patchIdentifier.H"
#include
"dictionary.H"
#include
"ListOps.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
...
...
@@ -79,6 +80,12 @@ Foam::patchIdentifier::~patchIdentifier()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool
Foam
::
patchIdentifier
::
inGroup
(
const
word
&
name
)
const
{
return
findIndex
(
inGroups_
,
name
)
!=
-
1
;
}
void
Foam
::
patchIdentifier
::
write
(
Ostream
&
os
)
const
{
if
(
physicalType_
.
size
())
...
...
src/OpenFOAM/meshes/Identifiers/patch/patchIdentifier.H
View file @
dc9f4c77
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -154,6 +154,8 @@ public:
return
inGroups_
;
}
//- Test if in group
bool
inGroup
(
const
word
&
)
const
;
//- Write patchIdentifier as a dictionary
void
write
(
Ostream
&
)
const
;
...
...
src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C
View file @
dc9f4c77
...
...
@@ -486,6 +486,57 @@ Foam::polyBoundaryMesh::groupPatchIDs() const
}
void
Foam
::
polyBoundaryMesh
::
setGroup
(
const
word
&
groupName
,
const
labelList
&
patchIDs
)
{
groupPatchIDsPtr_
.
clear
();
polyPatchList
&
patches
=
*
this
;
boolList
donePatch
(
patches
.
size
(),
false
);
// Add to specified patches
forAll
(
patchIDs
,
i
)
{
label
patchI
=
patchIDs
[
i
];
polyPatch
&
pp
=
patches
[
patchI
];
if
(
!
pp
.
inGroup
(
groupName
))
{
pp
.
inGroups
().
append
(
groupName
);
}
donePatch
[
patchI
]
=
true
;
}
// Remove from other patches
forAll
(
patches
,
patchI
)
{
if
(
!
donePatch
[
patchI
])
{
polyPatch
&
pp
=
patches
[
patchI
];
label
newI
=
0
;
if
(
pp
.
inGroup
(
groupName
))
{
wordList
&
groups
=
pp
.
inGroups
();
forAll
(
groups
,
i
)
{
if
(
groups
[
i
]
!=
groupName
)
{
groups
[
newI
++
]
=
groups
[
i
];
}
}
groups
.
setSize
(
newI
);
}
}
}
}
Foam
::
wordList
Foam
::
polyBoundaryMesh
::
names
()
const
{
const
polyPatchList
&
patches
=
*
this
;
...
...
src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.H
View file @
dc9f4c77
...
...
@@ -186,6 +186,9 @@ public:
//- Per patch group the patch indices
const
HashTable
<
labelList
,
word
>&
groupPatchIDs
()
const
;
//- Set/add group with patches
void
setGroup
(
const
word
&
groupName
,
const
labelList
&
patchIDs
);
//- Return the set of patch IDs corresponding to the given names
// By default warns if given names are not found. Optionally
// matches to patchGroups as well as patchNames
...
...
src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C
View file @
dc9f4c77
...
...
@@ -2472,7 +2472,7 @@ void Foam::autoLayerDriver::getLayerCellsFaces
}
bool
Foam
::
autoLayerDriver
::
w
rit
e
LayerData
void
Foam
::
autoLayerDriver
::
p
ri
n
tLayerData
(
const
fvMesh
&
mesh
,
const
labelList
&
patchIDs
,
...
...
@@ -2481,153 +2481,284 @@ bool Foam::autoLayerDriver::writeLayerData
const
scalarField
&
faceRealThickness
)
const
{
bool
allOk
=
true
;
const
polyBoundaryMesh
&
pbm
=
mesh
.
boundaryMesh
()
;
// Find maximum length of a patch name, for a nicer output
label
maxPatchNameLen
=
0
;
forAll
(
patchIDs
,
i
)
{
label
nAdded
=
0
;
forAll
(
cellNLayers
,
cellI
)
label
patchI
=
patchIDs
[
i
];
word
patchName
=
pbm
[
patchI
].
name
();
maxPatchNameLen
=
max
(
maxPatchNameLen
,
label
(
patchName
.
size
()));
}
Info
<<
nl
<<
setf
(
ios_base
::
left
)
<<
setw
(
maxPatchNameLen
)
<<
"patch"
<<
setw
(
0
)
<<
" faces layers overall thickness"
<<
nl
<<
setf
(
ios_base
::
left
)
<<
setw
(
maxPatchNameLen
)
<<
" "
<<
setw
(
0
)
<<
" [m] [%]"
<<
nl
<<
setf
(
ios_base
::
left
)
<<
setw
(
maxPatchNameLen
)
<<
"-----"
<<
setw
(
0
)
<<
" ----- ------ --- ---"
<<
endl
;
forAll
(
patchIDs
,
i
)
{
label
patchI
=
patchIDs
[
i
];
const
polyPatch
&
pp
=
pbm
[
patchI
];
label
sumSize
=
pp
.
size
();
// Number of layers
const
labelList
&
faceCells
=
pp
.
faceCells
();
label
sumNLayers
=
0
;
forAll
(
faceCells
,
i
)
{
if
(
cellNLayers
[
cellI
]
>
0
)
{
nAdded
++
;
}
sumNLayers
+=
cellNLayers
[
faceCells
[
i
]];
}
cellSet
addedCellSet
(
mesh
,
"addedCells"
,
nAdded
);
forAll
(
cellNLayers
,
cellI
)
// Thickness
scalarField
::
subField
patchWanted
=
pbm
[
patchI
].
patchSlice