Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
0d2fd6b2
Commit
0d2fd6b2
authored
16 years ago
by
henry
Browse files
Options
Downloads
Patches
Plain Diff
Added stabilisation to the nut update.
parent
0ee817a0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C
+32
-24
32 additions, 24 deletions
...oughWallFunction/nutRoughWallFunctionFvPatchScalarField.C
with
32 additions
and
24 deletions
src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutRoughWallFunction/nutRoughWallFunctionFvPatchScalarField.C
+
32
−
24
View file @
0d2fd6b2
...
@@ -49,21 +49,20 @@ scalar nutRoughWallFunctionFvPatchScalarField::fnRough
...
@@ -49,21 +49,20 @@ scalar nutRoughWallFunctionFvPatchScalarField::fnRough
const
scalar
kappa
const
scalar
kappa
)
const
)
const
{
{
//
S
et
deltaB
based on non-dimensional roughness height
//
R
et
urn fn
based on non-dimensional roughness height
scalar
deltaB
=
0
.
0
;
if
(
KsPlus
<
90
.
0
)
if
(
KsPlus
<
90
.
0
)
{
{
deltaB
=
return
pow
1
.
0
/
kappa
(
*
log
((
KsPlus
-
2
.
25
)
/
87
.
75
+
Cs
*
KsPlus
)
(
KsPlus
-
2
.
25
)
/
87
.
75
+
Cs
*
KsPlus
,
*
sin
(
0
.
4258
*
(
log
(
KsPlus
)
-
0
.
811
));
sin
(
0
.
4258
*
(
log
(
KsPlus
)
-
0
.
811
))
);
}
}
else
else
{
{
deltaB
=
1
.
0
/
kappa
*
log
(
1
.
0
+
Cs
*
KsPlus
);
return
(
1
.
0
+
Cs
*
KsPlus
);
}
}
return
exp
(
min
(
deltaB
*
kappa
,
50
.
0
));
}
}
...
@@ -183,7 +182,7 @@ void nutRoughWallFunctionFvPatchScalarField::updateCoeffs()
...
@@ -183,7 +182,7 @@ void nutRoughWallFunctionFvPatchScalarField::updateCoeffs()
const
scalar
Cmu25
=
pow
(
Cmu
,
0
.
25
);
const
scalar
Cmu25
=
pow
(
Cmu
,
0
.
25
);
const
scalar
kappa
=
ras
.
kappa
().
value
();
const
scalar
kappa
=
ras
.
kappa
().
value
();
const
scalar
E
=
ras
.
E
().
value
();
const
scalar
E
=
ras
.
E
().
value
();
scalar
yPlusLam
=
ras
.
yPlusLam
();
const
scalar
yPlusLam
=
ras
.
yPlusLam
();
const
scalarField
&
y
=
ras
.
y
()[
patch
().
index
()];
const
scalarField
&
y
=
ras
.
y
()[
patch
().
index
()];
...
@@ -199,17 +198,35 @@ void nutRoughWallFunctionFvPatchScalarField::updateCoeffs()
...
@@ -199,17 +198,35 @@ void nutRoughWallFunctionFvPatchScalarField::updateCoeffs()
label
faceCellI
=
patch
().
faceCells
()[
faceI
];
label
faceCellI
=
patch
().
faceCells
()[
faceI
];
scalar
uStar
=
Cmu25
*
sqrt
(
k
[
faceCellI
]);
scalar
uStar
=
Cmu25
*
sqrt
(
k
[
faceCellI
]);
scalar
yPlus
=
uStar
*
y
[
faceI
]
/
nuw
[
faceI
];
scalar
yPlus
=
uStar
*
y
[
faceI
]
/
nuw
[
faceI
];
scalar
KsPlus
=
uStar
*
Ks_
[
faceI
]
/
nuw
[
faceI
];
scalar
KsPlus
=
uStar
*
Ks_
[
faceI
]
/
nuw
[
faceI
];
scalar
Edash
=
E
;
scalar
Edash
=
E
;
scalar
yPlusLamNew
=
yPlusLam
;
if
(
KsPlus
>
2
.
25
)
if
(
KsPlus
>
2
.
25
)
{
{
Edash
=
E
/
fnRough
(
KsPlus
,
Cs_
[
faceI
],
kappa
);
Edash
=
E
/
fnRough
(
KsPlus
,
Cs_
[
faceI
],
kappa
);
yPlusLam
=
ras
.
yPlusLam
(
kappa
,
Edash
);
}
if
(
yPlus
>
yPlusLam
)
{
scalar
limitingNutw
=
max
(
nutw
[
faceI
],
nuw
[
faceI
]);
// To avoid oscillations limit the change in the wall viscosity
// which is particularly important if it temporarily becomes zero
nutw
[
faceI
]
=
max
(
min
(
nuw
[
faceI
]
*
(
yPlus
*
kappa
/
log
(
Edash
*
yPlus
)
-
1
),
2
*
limitingNutw
),
0
.
5
*
limitingNutw
);
}
else
{
nutw
[
faceI
]
=
0
.
0
;
}
}
if
(
debug
)
if
(
debug
)
...
@@ -217,18 +234,9 @@ void nutRoughWallFunctionFvPatchScalarField::updateCoeffs()
...
@@ -217,18 +234,9 @@ void nutRoughWallFunctionFvPatchScalarField::updateCoeffs()
Info
<<
"yPlus = "
<<
yPlus
Info
<<
"yPlus = "
<<
yPlus
<<
", KsPlus = "
<<
KsPlus
<<
", KsPlus = "
<<
KsPlus
<<
", Edash = "
<<
Edash
<<
", Edash = "
<<
Edash
<<
",
yPlusLam = "
<<
yPlusLam
<<
",
nutw = "
<<
nutw
[
faceI
]
<<
endl
;
<<
endl
;
}
}
if
(
yPlus
>
yPlusLamNew
)
{
nutw
[
faceI
]
=
nuw
[
faceI
]
*
(
yPlus
*
kappa
/
log
(
Edash
*
yPlus
)
-
1
);
}
else
{
nutw
[
faceI
]
=
0
.
0
;
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment