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-plus
Commits
90c0be38
Commit
90c0be38
authored
Oct 13, 2017
by
Andrew Heather
Browse files
Merge remote-tracking branch 'origin/master' into develop
parents
f68ed978
6355554d
Changes
13
Hide whitespace changes
Inline
Side-by-side
applications/solvers/heatTransfer/thermoFoam/EEqn.H
View file @
90c0be38
...
...
@@ -15,12 +15,16 @@
)
:
-
dpdt
)
-
fvm
::
laplacian
(
alphaEff
,
he
)
==
radiation
->
Sh
(
thermo
,
he
)
+
fvOptions
(
rho
,
he
)
);
if
(
turbulence
.
valid
())
{
EEqn
-=
fvm
::
laplacian
(
turbulence
->
alphaEff
(),
he
);
}
EEqn
.
relax
();
fvOptions
.
constrain
(
EEqn
);
...
...
applications/solvers/heatTransfer/thermoFoam/createFields.H
View file @
90c0be38
...
...
@@ -35,7 +35,31 @@ volVectorField U
#include
"compressibleCreatePhi.H"
#include
"setAlphaEff.H"
autoPtr
<
compressible
::
turbulenceModel
>
turbulence
;
IOobject
turbulencePropertiesHeader
(
"turbulenceProperties"
,
runTime
.
constant
(),
mesh
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
,
false
);
if
(
turbulencePropertiesHeader
.
typeHeaderOk
<
IOdictionary
>
(
false
))
{
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
turbulence
=
compressible
::
turbulenceModel
::
New
(
rho
,
U
,
phi
,
thermo
);
}
#include
"createDpdt.H"
...
...
applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H
deleted
100644 → 0
View file @
f68ed978
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
tmp
<
volScalarField
>
talphaEff
;
IOobject
turbulencePropertiesHeader
(
"turbulenceProperties"
,
runTime
.
constant
(),
mesh
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
,
false
);
if
(
turbulencePropertiesHeader
.
typeHeaderOk
<
IOdictionary
>
(
true
))
{
autoPtr
<
compressible
::
turbulenceModel
>
turbulence
(
compressible
::
turbulenceModel
::
New
(
rho
,
U
,
phi
,
thermo
)
);
talphaEff
=
turbulence
->
alphaEff
();
}
else
{
talphaEff
=
tmp
<
volScalarField
>
(
new
volScalarField
(
IOobject
(
"alphaEff"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
mesh
,
dimensionedScalar
(
"0"
,
dimMass
/
dimLength
/
dimTime
,
0
.
0
)
)
);
}
applications/solvers/heatTransfer/thermoFoam/thermoFoam.C
View file @
90c0be38
...
...
@@ -54,8 +54,6 @@ int main(int argc, char *argv[])
#include
"createFields.H"
#include
"createFvOptions.H"
const
volScalarField
&
alphaEff
=
talphaEff
();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Evolving thermodynamics
\n
"
<<
endl
;
...
...
src/TurbulenceModels/turbulenceModels/RAS/kOmegaSSTLM/kOmegaSSTLM.C
View file @
90c0be38
...
...
@@ -373,7 +373,8 @@ kOmegaSSTLM<BasicTurbulenceModel>::kOmegaSSTLM
alphaRhoPhi
,
phi
,
transport
,
propertiesName
propertiesName
,
typeName
),
ca1_
...
...
@@ -477,7 +478,12 @@ kOmegaSSTLM<BasicTurbulenceModel>::kOmegaSSTLM
this
->
mesh_
,
dimensionedScalar
(
"0"
,
dimless
,
0
)
)
{}
{
if
(
type
==
typeName
)
{
this
->
printCoeffs
(
type
);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
...
...
src/conversion/vtk/output/foamVtkPatchWriter.C
View file @
90c0be38
...
...
@@ -245,7 +245,7 @@ Foam::vtk::patchWriter::patchWriter
nFaces_
(
0
)
{
outputOptions
opts
(
outOpts
);
opts
.
append
(
false
);
// No append
opts
.
append
(
false
);
// No append
supported
os_
.
open
((
baseName
+
(
legacy_
?
".vtk"
:
".vtp"
)).
c_str
());
format_
=
opts
.
newFormatter
(
os_
);
...
...
src/conversion/vtk/output/foamVtkSurfaceMeshWriter.C
View file @
90c0be38
...
...
@@ -193,7 +193,7 @@ Foam::vtk::surfaceMeshWriter::surfaceMeshWriter
os_
()
{
outputOptions
opts
(
outOpts
);
opts
.
legacy
(
tru
e
);
// No append supported
opts
.
append
(
fals
e
);
// No append supported
os_
.
open
((
baseName
+
(
legacy_
?
".vtk"
:
".vtp"
)).
c_str
());
format_
=
opts
.
newFormatter
(
os_
);
...
...
src/functionObjects/field/DESModelRegions/DESModelRegions.C
View file @
90c0be38
...
...
@@ -172,6 +172,8 @@ bool Foam::functionObjects::DESModelRegions::write()
<<
" writing field "
<<
DESModelRegions
.
name
()
<<
nl
<<
endl
;
DESModelRegions
.
write
();
return
true
;
}
...
...
src/meshTools/output/foamVtkWriteCellSetFaces.C
View file @
90c0be38
...
...
@@ -41,7 +41,7 @@ void Foam::vtk::writeCellSetFaces
)
{
outputOptions
opts
(
outOpts
);
opts
.
legacy
(
true
);
// Legacy only, no append
opts
.
legacy
(
true
);
// Legacy only, no
xml, no
append
const
bool
legacy_
(
opts
.
legacy
());
...
...
src/meshTools/output/foamVtkWriteFaceSet.C
View file @
90c0be38
...
...
@@ -41,7 +41,7 @@ void Foam::vtk::writeFaceSet
)
{
outputOptions
opts
(
outOpts
);
opts
.
legacy
(
true
);
// Legacy only, no append
opts
.
legacy
(
true
);
// Legacy only, no
xml, no
append
const
bool
legacy_
(
opts
.
legacy
());
...
...
src/meshTools/output/foamVtkWritePointSet.C
View file @
90c0be38
...
...
@@ -40,7 +40,7 @@ void Foam::vtk::writePointSet
)
{
outputOptions
opts
(
outOpts
);
opts
.
legacy
(
true
);
// Legacy only, no append
opts
.
legacy
(
true
);
// Legacy only, no
xml, no
append
const
bool
legacy_
(
opts
.
legacy
());
...
...
src/parallel/decompose/decompositionMethods/multiLevelDecomp/multiLevelDecomp.C
View file @
90c0be38
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -99,7 +99,7 @@ void Foam::multiLevelDecomp::subsetGlobalCellCells
forAll
(
cCells
,
i
)
{
// Get locally-compact cell index of neighbouring cell
label
nbrCelli
=
oldToNew
[
cCells
[
i
]];
const
label
nbrCelli
=
oldToNew
[
cCells
[
i
]];
if
(
nbrCelli
==
-
1
)
{
cutConnections
[
allDist
[
cCells
[
i
]]]
++
;
...
...
@@ -109,10 +109,10 @@ void Foam::multiLevelDecomp::subsetGlobalCellCells
// Reconvert local cell index into global one
// Get original neighbour
label
celli
=
set
[
subCelli
];
label
oldNbrCelli
=
cellCells
[
celli
][
i
];
const
label
celli
=
set
[
subCelli
];
const
label
oldNbrCelli
=
cellCells
[
celli
][
i
];
// Get processor from original neighbour
label
proci
=
globalCells
.
whichProcID
(
oldNbrCelli
);
const
label
proci
=
globalCells
.
whichProcID
(
oldNbrCelli
);
// Convert into global compact numbering
cCells
[
newI
++
]
=
globalSubCells
.
toGlobal
(
proci
,
nbrCelli
);
}
...
...
@@ -127,15 +127,16 @@ void Foam::multiLevelDecomp::decompose
const
labelListList
&
pointPoints
,
const
pointField
&
points
,
const
scalarField
&
pointWeights
,
const
labelList
&
pointMap
,
// map back to original points
const
label
levelI
,
const
labelUList
&
pointMap
,
// map back to original points
const
label
currLevel
,
const
label
leafOffset
,
label
Field
&
finalDecomp
label
List
&
finalDecomp
)
{
labelList
dist
(
methods_
[
l
evel
I
].
decompose
methods_
[
currL
evel
].
decompose
(
pointPoints
,
points
,
...
...
@@ -143,30 +144,62 @@ void Foam::multiLevelDecomp::decompose
)
);
// The next recursion level
const
label
nextLevel
=
currLevel
+
1
;
// Number of domains at this current level
const
label
nCurrDomains
=
methods_
[
currLevel
].
nDomains
();
// Calculate the domain remapping.
// The decompose() method delivers a distribution of [0..nDomains-1]
// which we map to the final location according to the decomposition
// leaf we are on.
labelList
domainLookup
(
nCurrDomains
);
{
label
sizes
=
1
;
// Cumulative number of domains
for
(
label
i
=
0
;
i
<=
currLevel
;
++
i
)
{
sizes
*=
methods_
[
i
].
nDomains
();
}
// Distribution of domains at this level
sizes
=
this
->
nDomains
()
/
sizes
;
forAll
(
domainLookup
,
i
)
{
domainLookup
[
i
]
=
i
*
sizes
+
leafOffset
;
}
}
if
(
debug
)
{
Info
<<
"Distribute at level "
<<
currLevel
<<
" to domains"
<<
nl
<<
flatOutput
(
domainLookup
)
<<
endl
;
}
// Extract processor+local index from point-point addressing
forAll
(
pointMap
,
i
)
{
label
orig
=
pointMap
[
i
];
finalDecomp
[
orig
]
+
=
dist
[
i
];
const
label
orig
=
pointMap
[
i
];
finalDecomp
[
orig
]
=
domainLookup
[
dist
[
i
]
]
;
}
if
(
levelI
!=
methods_
.
size
()
-
1
)
if
(
nextLevel
<
methods_
.
size
())
{
// Recurse
// Determine points per domain
label
n
=
methods_
[
levelI
].
nDomains
();
labelListList
domainToPoints
(
invertOneToMany
(
n
,
dist
));
// 'Make space' for new levels of decomposition
finalDecomp
*=
methods_
[
levelI
+
1
].
nDomains
();
labelListList
domainToPoints
(
invertOneToMany
(
nCurrDomains
,
dist
));
// Extract processor+local index from point-point addressing
if
(
debug
&&
Pstream
::
master
())
{
Pout
<<
"Decomposition at level "
<<
l
evel
I
<<
" :"
<<
endl
;
Pout
<<
"Decomposition at level "
<<
currL
evel
<<
" :"
<<
endl
;
}
for
(
label
domainI
=
0
;
domainI
<
n
;
domainI
++
)
for
(
label
domainI
=
0
;
domainI
<
n
CurrDomains
;
domainI
++
)
{
// Extract elements for current domain
const
labelList
domainPoints
(
findIndices
(
dist
,
domainI
));
...
...
@@ -180,7 +213,7 @@ void Foam::multiLevelDecomp::decompose
labelList
nOutsideConnections
;
subsetGlobalCellCells
(
n
,
n
CurrDomains
,
domainI
,
dist
,
...
...
@@ -196,12 +229,12 @@ void Foam::multiLevelDecomp::decompose
Pstream
::
listCombineScatter
(
nOutsideConnections
);
label
nPatches
=
0
;
label
nFaces
=
0
;
for
All
(
nOutsideConnections
,
i
)
for
(
const
label
nConnect
:
nOutsideConnections
)
{
if
(
n
OutsideConnections
[
i
]
>
0
)
if
(
n
Connect
>
0
)
{
nPatches
++
;
nFaces
+=
n
OutsideConnections
[
i
]
;
++
nPatches
;
nFaces
+=
n
Connect
;
}
}
...
...
@@ -224,7 +257,8 @@ void Foam::multiLevelDecomp::decompose
subPoints
,
subWeights
,
subPointMap
,
levelI
+
1
,
nextLevel
,
domainLookup
[
domainI
],
// The offset for this level and leaf
finalDecomp
);
...
...
@@ -238,24 +272,30 @@ void Foam::multiLevelDecomp::decompose
if
(
debug
)
{
// Do straight decompose of two levels
label
nNext
=
methods_
[
l
evel
I
+
1
].
nDomains
();
label
nTotal
=
n
*
nNext
;
const
label
nNext
=
methods_
[
nextL
evel
].
nDomains
();
const
label
nTotal
=
n
CurrDomains
*
nNext
;
// Retrieve original level0 dictionary and modify number of domains
dictionary
::
const_iterator
iter
=
decompositionDict_
.
optionalSubDict
(
typeName
+
"Coeffs"
).
begin
();
dictionary
myDict
=
iter
().
dict
();
myDict
.
set
(
"numberOfSubdomains"
,
nTotal
);
// Get original level0 dictionary and modify numberOfSubdomains
dictionary
level0Dict
;
forAllConstIter
(
dictionary
,
methodsDict_
,
iter
)
{
if
(
iter
().
isDict
())
{
level0Dict
=
iter
().
dict
();
break
;
}
}
level0Dict
.
set
(
"numberOfSubdomains"
,
nTotal
);
if
(
debug
&&
Pstream
::
master
())
{
Pout
<<
"Reference decomposition with "
<<
my
Dict
<<
" :"
Pout
<<
"Reference decomposition with "
<<
level0
Dict
<<
" :"
<<
endl
;
}
autoPtr
<
decompositionMethod
>
method0
=
decompositionMethod
::
New
(
my
Dict
level0
Dict
);
labelList
dist
(
...
...
@@ -267,12 +307,12 @@ void Foam::multiLevelDecomp::decompose
)
);
for
(
label
blockI
=
0
;
blockI
<
n
;
blockI
++
)
for
(
label
blockI
=
0
;
blockI
<
n
CurrDomains
;
blockI
++
)
{
// Count the number inbetween blocks of nNext size
label
nPoints
=
0
;
labelList
nOutsideConnections
(
n
,
0
);
labelList
nOutsideConnections
(
n
CurrDomains
,
0
);
forAll
(
pointPoints
,
pointi
)
{
if
((
dist
[
pointi
]
/
nNext
)
==
blockI
)
...
...
@@ -283,7 +323,7 @@ void Foam::multiLevelDecomp::decompose
forAll
(
pPoints
,
i
)
{
label
distBlockI
=
dist
[
pPoints
[
i
]]
/
nNext
;
const
label
distBlockI
=
dist
[
pPoints
[
i
]]
/
nNext
;
if
(
distBlockI
!=
blockI
)
{
nOutsideConnections
[
distBlockI
]
++
;
...
...
@@ -301,12 +341,12 @@ void Foam::multiLevelDecomp::decompose
Pstream
::
listCombineScatter
(
nOutsideConnections
);
label
nPatches
=
0
;
label
nFaces
=
0
;
for
All
(
nOutsideConnections
,
i
)
for
(
const
label
nConnect
:
nOutsideConnections
)
{
if
(
n
OutsideConnections
[
i
]
>
0
)
if
(
n
Connect
>
0
)
{
nPatches
++
;
nFaces
+=
n
OutsideConnections
[
i
]
;
++
nPatches
;
nFaces
+=
n
Connect
;
}
}
...
...
@@ -330,31 +370,37 @@ void Foam::multiLevelDecomp::decompose
Foam
::
multiLevelDecomp
::
multiLevelDecomp
(
const
dictionary
&
decompositionDict
)
:
decompositionMethod
(
decompositionDict
),
methodsDict_
(
decompositionDict_
.
optionalS
ubDict
(
typeName
+
"Coeffs"
))
methodsDict_
(
decompositionDict_
.
s
ubDict
(
typeName
+
"Coeffs"
))
{
methods_
.
setSize
(
methodsDict_
.
size
());
label
i
=
0
;
label
nLevels
=
0
;
forAllConstIter
(
dictionary
,
methodsDict_
,
iter
)
{
methods_
.
set
(
i
++
,
decompositionMethod
::
New
(
iter
().
dict
()));
// Ignore primitive entries which may be there for additional control
if
(
iter
().
isDict
())
{
methods_
.
set
(
nLevels
++
,
decompositionMethod
::
New
(
iter
().
dict
()));
}
}
label
n
=
1
;
methods_
.
setSize
(
nLevels
);
label
nTot
=
1
;
Info
<<
"decompositionMethod "
<<
type
()
<<
" :"
<<
endl
;
forAll
(
methods_
,
i
)
{
Info
<<
" level "
<<
i
<<
" decomposing with "
<<
methods_
[
i
].
type
()
<<
" into "
<<
methods_
[
i
].
nDomains
()
<<
" subdomains."
<<
endl
;
n
*=
methods_
[
i
].
nDomains
();
n
Tot
*=
methods_
[
i
].
nDomains
();
}
if
(
n
!=
nDomains
())
if
(
n
Tot
!=
nDomains
())
{
FatalErrorInFunction
<<
"Top level decomposition specifies "
<<
nDomains
()
<<
" domains which is not equal to the product of"
<<
" all sub domains "
<<
n
<<
" all sub domains "
<<
n
Tot
<<
exit
(
FatalError
);
}
}
...
...
@@ -385,7 +431,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
CompactListList
<
label
>
cellCells
;
calcCellCells
(
mesh
,
identity
(
cc
.
size
()),
cc
.
size
(),
true
,
cellCells
);
label
Field
finalDecomp
(
cc
.
size
(),
0
);
label
List
finalDecomp
(
cc
.
size
(),
0
);
labelList
cellMap
(
identity
(
cc
.
size
()));
decompose
...
...
@@ -395,6 +441,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
cWeights
,
cellMap
,
// map back to original cells
0
,
0
,
finalDecomp
);
...
...
@@ -410,7 +457,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
const
scalarField
&
pointWeights
)
{
label
Field
finalDecomp
(
points
.
size
(),
0
);
label
List
finalDecomp
(
points
.
size
(),
0
);
labelList
pointMap
(
identity
(
points
.
size
()));
decompose
...
...
@@ -420,6 +467,7 @@ Foam::labelList Foam::multiLevelDecomp::decompose
pointWeights
,
pointMap
,
// map back to original points
0
,
0
,
finalDecomp
);
...
...
src/parallel/decompose/decompositionMethods/multiLevelDecomp/multiLevelDecomp.H
View file @
90c0be38
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -71,21 +71,22 @@ class multiLevelDecomp
labelList
&
cutConnections
)
const
;
//- Decompose
level methodI
without addressing
//- Decompose
at 'currLevel'
without addressing
void
decompose
(
const
labelListList
&
pointPoints
,
const
pointField
&
points
,
const
scalarField
&
pointWeights
,
const
labelList
&
pointMap
,
// map back to original points
const
label
levelI
,
const
labelUList
&
pointMap
,
// map back to original points
const
label
currLevel
,
const
label
leafOffset
,
label
Field
&
finalDecomp
label
List
&
finalDecomp
);
//- Disallow default bitwise copy construct and assignment
void
operator
=
(
const
multiLevelDecomp
&
);
multiLevelDecomp
(
const
multiLevelDecomp
&
);
void
operator
=
(
const
multiLevelDecomp
&
)
=
delete
;
multiLevelDecomp
(
const
multiLevelDecomp
&
)
=
delete
;
public:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment