Hello,
I want to simulate a
Hello,
I want to simulate a flow around a square prism exposed with a roughwall turbulent boundary layer. For saving a calculation time, I want to use the loglaw wall function with a roughness length instead of putting appropriate rougness blocks on the ground exactly. Loglaw 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 
At the moment, wall functions
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. 
Are you running LES or RANS?
Are you running LES or RANS?
Currently LES wallfunctions are runtime selectable and it is easy to add new types but RANS wallfunctions are not. I have thought about trying to make RANS wallfunctions runtime 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 OpenFOAM1.1.1/src/turbulenceModels/compressible/wallFunc for incompressible flow and in OpenFOAM1.1/src/turbulenceModels/compressible/wallFunc for compressible flow. 
Sorry, I forgot to mention abo
Sorry, I forgot to mention about my calculation setup's detail.
1. I'm running highRe 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 
You could add a test for the p
You could add a test for the patch name to the code in
OpenFOAM1.1.1/src/turbulenceModels/compressible/wallFunc for incompressible flow and in OpenFOAM1.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. 
Thanks. I will add a switch to
Thanks. I will add a switch to the code you advised.
BTW how can I obtain OpenFOAM1.1.1? I could not find out the new release. Thanks in advance, Masashi IMANO. 
OpenFOAM1.1.1 is not quite re
OpenFOAM1.1.1 is not quite ready for release yet, in fact it will go out as OpenFOAM1.2 as it includes a substantial number of developments. OpenCFD will release it as soon as possible.

Hi,
I´m also trying to implem
Hi,
I´m also trying to implement rough wall functions (with nonuniform 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 
Hi, David!
I actually imple
Hi, David!
I actually implemented rough wall functions, but my implementation couldn't handle nonuniform roughness and was very adhoc 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, 
Thanks Masashi,
I'm not famil
Thanks Masashi,
I'm not familiar with the "wall viscosity" concept. Could you explain how you go from your wallfunction 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 wallfunction somehow. Regards David 
Dear David,
Actually I impl
Dear David,
Actually I implemented the loglaw 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 
Wall viscosity is a pretty str
Wall viscosity is a pretty straightforward concept. Really it is just a "trick" to specify the wall shear stress via turbulent viscosity and the noslip 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. 
Hi all.
I'm solving two phase
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.0e3)); 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(); } 
roughness
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 
how to make the new wall function
hi
I find a guide on how to implement a turbulence model in openfoam: http://www.tfd.chalmers.se/~hani/kur...lenceModel.pdf However, I need to implement a new wall function, can I just follow the guide and make the new wall function? Thanks a lot. Jason 
All times are GMT 4. The time now is 10:20. 