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
4265fc24
Commit
4265fc24
authored
Sep 12, 2019
by
mattijs
Committed by
Andrew Heather
Sep 12, 2019
Browse files
BUG: overset: use correct normalisation. Fixes
#1437
.
parent
a3f3ec81
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.C
View file @
4265fc24
...
...
@@ -330,7 +330,6 @@ bool Foam::dynamicOversetFvMesh::updateAddressing() const
<<
" lower:"
<<
addr
.
lowerAddr
().
size
()
<<
" upper:"
<<
addr
.
upperAddr
().
size
()
<<
endl
;
lduInterfacePtrsList
iFaces
=
this
->
interfaces
();
// Using lduAddressing::patch
forAll
(
patchAddr
,
patchI
)
{
...
...
@@ -340,17 +339,16 @@ bool Foam::dynamicOversetFvMesh::updateAddressing() const
}
// Using interfaces
Pout
<<
"iFaces:"
<<
iFaces
.
size
()
<<
endl
;
const
lduInterfacePtrsList
&
iFaces
=
allInterfaces_
;
Pout
<<
"Adapted interFaces:"
<<
iFaces
.
size
()
<<
endl
;
forAll
(
iFaces
,
patchI
)
{
if
(
iFaces
.
set
(
patchI
))
{
Pout
<<
" "
<<
patchI
<<
"
\t
i
Face:"
<<
iFaces
[
patchI
].
type
()
<<
endl
;
Pout
<<
" "
<<
patchI
<<
"
\t
i
nterface:"
<<
iFaces
[
patchI
].
type
()
<<
endl
;
}
}
Pout
<<
"end of printing."
<<
endl
;
}
return
true
;
...
...
src/overset/dynamicOversetFvMesh/dynamicOversetFvMeshTemplates.C
View file @
4265fc24
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-201
7
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2014-201
9
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -149,14 +149,14 @@ Foam::tmp<Foam::scalarField> Foam::dynamicOversetFvMesh::normalisation
const
fvMatrix
<
Type
>&
m
)
const
{
// Determine normalisation. This is normally the original diagonal
.
// This needs to be stabilised for hole cells
// Determine normalisation. This is normally the original diagonal
plus
//
remote contributions.
This needs to be stabilised for hole cells
// which can have a zero diagonal. Assume that if any component has
// a non-zero diagonal the cell does not need stabilisation.
tmp
<
scalarField
>
tnorm
(
tmp
<
scalarField
>::
New
(
m
.
diag
()));
scalarField
&
norm
=
tnorm
.
ref
();
// Add
boundary
coeffs to duplicate behaviour of fvMatrix::addBoundaryDiag
// Add
remote
coeffs to duplicate behaviour of fvMatrix::addBoundaryDiag
const
FieldField
<
Field
,
Type
>&
internalCoeffs
=
m
.
internalCoeffs
();
for
(
direction
cmpt
=
0
;
cmpt
<
pTraits
<
Type
>::
nComponents
;
cmpt
++
)
{
...
...
@@ -174,10 +174,14 @@ Foam::tmp<Foam::scalarField> Foam::dynamicOversetFvMesh::normalisation
// Count number of problematic cells
label
nZeroDiag
=
0
;
for
(
const
scalar
n
:
norm
)
for
All
(
norm
,
celli
)
{
const
scalar
&
n
=
norm
[
celli
];
if
(
magSqr
(
n
)
<
sqr
(
SMALL
))
{
//Pout<< "For field " << m.psi().name()
// << " have diagonal " << n << " for cell " << celli
// << " at:" << cellCentres()[celli] << endl;
nZeroDiag
++
;
}
}
...
...
@@ -302,22 +306,19 @@ Foam::tmp<Foam::scalarField> Foam::dynamicOversetFvMesh::normalisation
forAll
(
norm
,
celli
)
{
scalar
&
n
=
norm
[
celli
];
if
(
mag
(
n
)
<
SMALL
)
if
(
mag
Sqr
(
n
)
<
sqr
(
SMALL
)
)
{
//Pout<< "For field " << m.psi().name()
// << " for cell " << celli
// << " at:" << cellCentres()[celli]
// << " have norm " << n
// << " have extrapolated norm " << extrapolatedNorm[celli]
// << endl;
// Override the norm
n
=
extrapolatedNorm
[
celli
];
}
else
{
// Use original diagonal
n
=
m
.
diag
()[
celli
];
}
}
}
else
{
// Use original diagonal
norm
=
m
.
diag
();
}
return
tnorm
;
}
...
...
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