CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

How can I add a new wall function

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 3 Post By eugene

Reply
 
LinkBack Thread Tools Display Modes
Old   May 3, 2005, 03:37
Default Hello, I want to simulate a
  #1
Member
 
Masashi IMANO
Join Date: Mar 2009
Location: Tokyo, Japan
Posts: 34
Rep Power: 8
imano is on a distinguished road
Hello,

I want to simulate a flow around a square prism exposed with a rough-wall turbulent boundary layer. For saving a calculation time, I want to use the log-law wall function with a roughness length instead of putting appropriate rougness blocks on the ground exactly.

Log-law wall function with a roughness length:

Uw/U*=ln(hw/z0)/kappa + A

where,

z0: roughness length
Uw: velocity near the ground
U*: friction velocity
hw: height from the ground
kappa, A: parameters

This is a my question.
[Q] How can I add a new wall function like this?

Thanks,
Masashi IMANO
imano is offline   Reply With Quote

Old   May 3, 2005, 06:14
Default At the moment, wall functions
  #2
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
At the moment, wall functions are hardwired into the RANS turbulence models. To add a new wall function, you would have to copy an existing turbulence model and insert your new wall function where appropriate.

Example: kEpsilon model src/turbulenceModels/incompressible/kEpsilon/kEpsilin.C
line 88 = # include "wallViscosityI.H"

The "wallViscosityI.H" can be found here:
src/turbulenceModels/incompressible/wallFunc

So copy "wallViscosityI.H" to "roughWallViscosityI.H", modify it as required and include it in a copy of the turbulence model you wish to use. If you are feeling a bit adventurous, making the wall function selectable via a dictionary entry in the turbulenceProperties file would be more elegant.
solefire, kiddmax and songwukong like this.
eugene is offline   Reply With Quote

Old   May 3, 2005, 06:15
Default Are you running LES or RANS?
  #3
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 13
henry is on a distinguished road
Are you running LES or RANS?

Currently LES wall-functions are run-time selectable and it is easy to add new types but RANS wall-functions are not. I have thought about trying to make RANS wall-functions run-time selectable but have not yet come up with an elegant solution. If you would like to change the current RANS implementation you will find them in
OpenFOAM-1.1.1/src/turbulenceModels/compressible/wallFunc
for incompressible flow and in
OpenFOAM-1.1/src/turbulenceModels/compressible/wallFunc
for compressible flow.
henry is offline   Reply With Quote

Old   May 4, 2005, 03:18
Default Sorry, I forgot to mention abo
  #4
Member
 
Masashi IMANO
Join Date: Mar 2009
Location: Tokyo, Japan
Posts: 34
Rep Power: 8
imano is on a distinguished road
Sorry, I forgot to mention about my calculation setup's detail.

1. I'm running high-Re RANS.
2. I need to apply the rough wall function only to a ground and other walls
should be calculated with normal slip wall function. So I would like
to change wall functions whether a wall is a ground or not.

Since I'm beginner about both OpenFOAM and C++ language;;,
I would like to copy and modify the wall function sources directly,
but I still need to switch wall functions with using information of
the wall.

[Q] How can I switch wall functions according to wall's
information(name?) in RANS wall function sources?

Thanks for your advice,
Masashi IMANO
imano is offline   Reply With Quote

Old   May 4, 2005, 03:36
Default You could add a test for the p
  #5
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 13
henry is on a distinguished road
You could add a test for the patch name to the code in

OpenFOAM-1.1.1/src/turbulenceModels/compressible/wallFunc
for incompressible flow and in
OpenFOAM-1.1/src/turbulenceModels/compressible/wallFunc
for compressible flow

and use your rough wall function on some wall patches and the original form on the rest.
henry is offline   Reply With Quote

Old   May 4, 2005, 03:46
Default Thanks. I will add a switch to
  #6
Member
 
Masashi IMANO
Join Date: Mar 2009
Location: Tokyo, Japan
Posts: 34
Rep Power: 8
imano is on a distinguished road
Thanks. I will add a switch to the code you advised.

BTW how can I obtain OpenFOAM-1.1.1?
I could not find out the new release.

Thanks in advance,
Masashi IMANO.
imano is offline   Reply With Quote

Old   May 4, 2005, 04:06
Default OpenFOAM-1.1.1 is not quite re
  #7
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 13
henry is on a distinguished road
OpenFOAM-1.1.1 is not quite ready for release yet, in fact it will go out as OpenFOAM-1.2 as it includes a substantial number of developments. OpenCFD will release it as soon as possible.
henry is offline   Reply With Quote

Old   January 22, 2006, 12:39
Default Hi, Im also trying to implem
  #8
Member
 
David Segersson
Join Date: Mar 2009
Posts: 39
Rep Power: 8
segersson is on a distinguished road
Hi,
Im also trying to implement rough wall functions (with non-uniform roughness...). Is it necessary to make changes anywhere else in the code, besides in the turbulence model, to include roughness effects (e.g. in the velocity b.c.)?

Masashi, have you made any progress in your implementation? In that case, it would probably help me a lot if you could post your code here or in the Wiki.

Regards
David
segersson is offline   Reply With Quote

Old   January 23, 2006, 00:18
Default Hi, David! I actually imple
  #9
Member
 
Masashi IMANO
Join Date: Mar 2009
Location: Tokyo, Japan
Posts: 34
Rep Power: 8
imano is on a distinguished road
Hi, David!

I actually implemented rough wall functions, but my implementation couldn't handle non-uniform roughness and
was very ad-hoc like this:

src/turbulenceModels/incompressible/wallFunc/wallViscosityI.H:

if (yPlus > yPlusLam_)
{
if ((curPatch.name().count('~'))==2) {
nutw[facei] =
nuw[facei]
*(yPlus*kappa_.value()/(log(y_[patchi][facei]/z0_.value())) - 1.0);
} else if ((curPatch.name().count('^'))==2) {
nutw[facei] =
nuw[facei]
*(1.0/alpha_.value() - 1.0);
} else {
nutw[facei] =
nuw[facei]
*(yPlus*kappa_.value()/log(E_.value()*yPlus) - 1);
}
}

So I'm afraid my code would not help you...

Masashi,
imano is offline   Reply With Quote

Old   February 27, 2006, 16:52
Default Thanks Masashi, I'm not famil
  #10
Member
 
David Segersson
Join Date: Mar 2009
Posts: 39
Rep Power: 8
segersson is on a distinguished road
Thanks Masashi,
I'm not familiar with the "wall viscosity" concept. Could you explain how you go from your wall-function for velocity to your implementation in wallViscosityI.H?

Also, since your formulation of a rough wallfunction differ from the one used in other codes e.g. Fluent, which uses Ks "sand grain roughness" to describe the roughness length, it would be interesting to know if you have evaluated the results from your wall-function somehow.

Regards
David
segersson is offline   Reply With Quote

Old   February 27, 2006, 23:29
Default Dear David, Actually I impl
  #11
Member
 
Masashi IMANO
Join Date: Mar 2009
Location: Tokyo, Japan
Posts: 34
Rep Power: 8
imano is on a distinguished road
Dear David,

Actually I implemented the log-law wall function with roughness length,
but there was little difference between a calculation result with the
implemented roughness wall and that with the original smooth wall.
As I had no time for finding out the reason at that time, I switched
the wall function from the roughness type to the original one.
So there is no evaluation about my implementation to show here...

Since my mother tongue is not English , it's difficult to explain the
"wall viscosity" concept here. So please consult guide books about
the numerical calculation of turbulent flow.

Regards,
Masashi
imano is offline   Reply With Quote

Old   February 28, 2006, 07:57
Default Wall viscosity is a pretty str
  #12
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
Wall viscosity is a pretty straightforward concept. Really it is just a "trick" to specify the wall shear stress via turbulent viscosity and the no-slip velocity boundary conditions.

So tau_w = nut_w * dU/dy

where tau_w can be found from some wall function and dU/dy is the wall normal derivative of velocity. See wallFunctions/wallViscosityI.H for details.
eugene is offline   Reply With Quote

Old   December 13, 2007, 11:00
Default Hi all. I'm solving two phase
  #13
New Member
 
Hyunchang Lee
Join Date: Mar 2009
Location: Daejeon, Korea
Posts: 11
Rep Power: 8
asteria is on a distinguished road
Hi all.
I'm solving two phase flow with twoPhaseEulerFoam and I want to implement new drag model. So according to your suggestions, I think it will be better to change the code which exists already(acutally it is schillerNeumann.C) rather than make new code for the drag model. I'm solving new fields, say moments and with those moments, got average diameter fields, let say, volScalarField D10. I want to use this D10 instead phasea_.d() in below code. How can I implement this diameter? I'm not used to C++, so any suggestion and help will be appreciated. Thanks in advance. have fun!!



// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

Foam::tmp<foam::volscalarfield> Foam::SchillerNaumann::K
(
const volScalarField& Ur
) const
{
volScalarField Re = max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3));
volScalarField Cds = 24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re;

forAll(Re, celli)
{
if(Re[celli] > 1000.0)
{
Cds[celli] = 0.44;
}
}

return 0.75*Cds*phaseb_.rho()*Ur/phasea_.d();
}
asteria is offline   Reply With Quote

Old   January 17, 2011, 06:19
Default roughness
  #14
Member
 
s.rasoul_varedi
Join Date: Feb 2010
Posts: 82
Rep Power: 6
desert_1250 is an unknown quantity at this point
Send a message via Yahoo to desert_1250
Hi all of foamers, i hope that you are well
i compiled the new solver with roughness( i modified simpleFoam & i used OF 1.5dev), but my question is how to change the related case to read this coeffs (Ks , Cs)? how to define the BC for this Coeffs?


best regards
desert_1250 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bug in wall function rolando OpenFOAM Bugs 7 June 8, 2007 04:51
wall function for low Re M. Essuri FLUENT 2 December 18, 2006 04:11
wall function Alex CFX 9 May 19, 2005 10:05
Does RSM use wall function? Sam Main CFD Forum 4 March 3, 2005 00:58
Wall function Min-Hua Wang CFX 4 July 5, 2002 12:13


All times are GMT -4. The time now is 14:16.