Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
03f0092c
Commit
03f0092c
authored
Nov 01, 2010
by
Henry
Browse files
fvcSmooth: The alpha field discriminant parameters are now optional arguments
parent
f12b8631
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/finiteVolume/finiteVolume/fvc/fvcSmooth/fvcSmooth.C
View file @
03f0092c
...
...
@@ -123,7 +123,10 @@ void Foam::fvc::spread
(
volScalarField
&
field
,
const
volScalarField
&
alpha
,
const
label
nLayers
const
label
nLayers
,
const
scalar
alphaDiff
,
const
scalar
alphaMax
,
const
scalar
alphaMin
)
{
const
fvMesh
&
mesh
=
field
.
mesh
();
...
...
@@ -153,11 +156,11 @@ void Foam::fvc::spread
if
(
(
alpha
[
own
]
>
0
.
01
&&
alpha
[
own
]
<
0
.
99
)
||
(
alpha
[
nbr
]
>
0
.
01
&&
alpha
[
nbr
]
<
0
.
99
)
(
alpha
[
own
]
>
alphaMin
&&
alpha
[
own
]
<
alphaMax
)
||
(
alpha
[
nbr
]
>
alphaMin
&&
alpha
[
nbr
]
<
alphaMax
)
)
{
if
(
mag
(
alpha
[
own
]
-
alpha
[
nbr
])
>
0
.
2
)
if
(
mag
(
alpha
[
own
]
-
alpha
[
nbr
])
>
alphaDiff
)
{
changedFaces
.
append
(
facei
);
changedFacesInfo
.
append
...
...
@@ -185,11 +188,14 @@ void Foam::fvc::spread
if
(
(
alpha
[
own
]
>
0
.
01
&&
alpha
[
own
]
<
0
.
99
)
||
(
alphapn
[
patchFacei
]
>
0
.
01
&&
alphapn
[
patchFacei
]
<
0
.
99
)
(
alpha
[
own
]
>
alphaMin
&&
alpha
[
own
]
<
alphaMax
)
||
(
alphapn
[
patchFacei
]
>
alphaMin
&&
alphapn
[
patchFacei
]
<
alphaMax
)
)
{
if
(
mag
(
alpha
[
own
]
-
alphapn
[
patchFacei
])
>
0
.
2
)
if
(
mag
(
alpha
[
own
]
-
alphapn
[
patchFacei
])
>
alphaDiff
)
{
changedFaces
.
append
(
facei
);
changedFacesInfo
.
append
(
smoothData
(
field
[
own
]));
...
...
@@ -227,7 +233,8 @@ void Foam::fvc::sweep
(
volScalarField
&
field
,
const
volScalarField
&
alpha
,
const
label
nLayers
const
label
nLayers
,
const
scalar
alphaDiff
)
{
const
fvMesh
&
mesh
=
field
.
mesh
();
...
...
@@ -250,7 +257,7 @@ void Foam::fvc::sweep
const
label
own
=
owner
[
facei
];
const
label
nbr
=
neighbour
[
facei
];
if
(
mag
(
alpha
[
own
]
-
alpha
[
nbr
])
>
0
.
2
)
if
(
mag
(
alpha
[
own
]
-
alpha
[
nbr
])
>
alphaDiff
)
{
changedFaces
.
append
(
facei
);
changedFacesInfo
.
append
...
...
@@ -275,7 +282,7 @@ void Foam::fvc::sweep
scalarField
alphapn
=
alpha
.
boundaryField
()[
patchi
].
patchNeighbourField
();
if
(
mag
(
alpha
[
own
]
-
alphapn
[
patchFacei
])
>
0
.
2
)
if
(
mag
(
alpha
[
own
]
-
alphapn
[
patchFacei
])
>
alphaDiff
)
{
changedFaces
.
append
(
facei
);
changedFacesInfo
.
append
...
...
src/finiteVolume/finiteVolume/fvc/fvcSmooth/fvcSmooth.H
View file @
03f0092c
...
...
@@ -28,15 +28,18 @@ Description
Provides functions smooth spread and sweep which use the FaceCellWave
algorithm to smooth and redistribute the first field argument.
smooth: smooths the field by ensuring the values in neighbouring
cells are
at least coeff* the cell value.
smooth: smooths the field by ensuring the values in neighbouring
cells are
at least coeff* the cell value.
spread: redistributes the field by spreading the maximum value within
the region defined by the value and gradient of alpha.
spread: redistributes the field by spreading the maximum value within the
region defined by the value (being between alphaMax and alphaMin)
and gradient of alpha (where the difference between the values in
neighbouring cells is larger than alphaDiff).
sweep: redistributes the field by sweeping the maximum value where the
gradient of alpha is large away from that starting point of the
sweep.
gradient of alpha is large (where the difference between the values
in neighbouring cells is larger than alphaDiff) away from that
starting point of the sweep.
SourceFiles
fvcSmooth.C
...
...
@@ -64,14 +67,18 @@ namespace fvc
(
volScalarField
&
field
,
const
volScalarField
&
alpha
,
const
label
nLayers
const
label
nLayers
,
const
scalar
alphaDiff
=
0.2
,
const
scalar
alphaMax
=
0.99
,
const
scalar
alphaMin
=
0.01
);
void
sweep
(
volScalarField
&
field
,
const
volScalarField
&
alpha
,
const
label
nLayers
const
label
nLayers
,
const
scalar
alphaDiff
=
0.2
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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