CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Plane-Averaged dynSmagorinsky (http://www.cfd-online.com/Forums/openfoam/81424-plane-averaged-dynsmagorinsky.html)

 mdjames October 26, 2010 15:11

Plane-Averaged dynSmagorinsky

Hi All,

I'm involved in modeling a particular channel flow and have been using a dynamic Smagorinsky large eddy simulation.

Through reading some threads and browsing the source, it appears that dynSmagorinsky as packaged with OF-1.6 averages Cd over the entire domain in space. My problem is that it appears I need to use some sort of ad-hoc wall function which is contrary to the point of the dynamic model as described by Germano (1991). In this paper, Cd is averaged over wall-normal planes in a channel flow, yielding a coefficient which is a function of y and t only.

It appears the implementation of dynSmag is correct aside from the blanket averaging. I'm struggling to find a way to define the layers which need to be averaged over. Perhaps writing all unaveraged coefficients to a file, and then averaging through a series which corresponds to nodes that lie on the same plane?

Sorry for the wordiness.

 xiao October 27, 2010 08:23

Hi,

Sorry that I did not follow up our previous exchanges on this subject.

For your question, it is certainly doable, assuming the cells are all "hex" and your mesh can be divided into layers (since you want to average on each layer). The starting point would be the "postChannel" utility. See how the "plane averaging" is done there.

The basic idea as I understand is, the user specify a patch as an initial "front" via dictionary. In your case (I mean, in a typical channel flow case, if you want plane average), this is one walls. You "walk" along the wall normal direction by finding an "opposite face" for each of the face on your current "front". The "opposite face" exist and is unique if your cell is hex. Now, you obtained a new "front". The cells you sweep through is defined as an "region". By continuing this sweeping procedure, you obtained many of these regions. These are the layers you want. In your computation, you average the values on each of these regions (layers). This is done in the "collapse" class/function in "postChannel" utility.

I would recommend that you study the "postChannel" utility in detail, and come back with questinos. Sorry that I would not have time to do that myself, but I would be happy to help!

Resorting to "file" is not a good idea. This is going to kill your efficiency, and it is not elegant ... Just think how elegant OpenFoam is, I would not want to do inelegant things with it!

Best,
Heng

Quote:
 Originally Posted by mdjames (Post 280854) Hi All, It appears the implementation of dynSmag is correct aside from the blanket averaging. I'm struggling to find a way to define the layers which need to be averaged over. Perhaps writing all unaveraged coefficients to a file, and then averaging through a series which corresponds to nodes that lie on the same plane? Sorry for the wordiness.

 mdjames November 29, 2010 19:05

Thanks for the reply, Heng

I'm working right now (although I'm having compilation issues) to simply remove the averaging from dynSmagorisnky.C . Apparently it isn't as easy as removing average() from the code.

After this, it looks as if I could just copy the code from postChannel.C, replacing the U averaging with cD averaging.

I suppose the final scheme would look like this:

1. Read the dict file to declare which patch to use as the starting layer

Loop:
1. Calculate cD and cI from U(and D)
2. Call the postChannel-like code to do the layer-averaging, having already pulled the necessary info from the dict file
3. Calculate nuSgs with cD,
:endLoop

 huangxianbei June 8, 2014 21:52

Quote:
 Originally Posted by mdjames (Post 285273) Thanks for the reply, Heng I'm working right now (although I'm having compilation issues) to simply remove the averaging from dynSmagorisnky.C . Apparently it isn't as easy as removing average() from the code. After this, it looks as if I could just copy the code from postChannel.C, replacing the U averaging with cD averaging. I suppose the final scheme would look like this: 1. Read the dict file to declare which patch to use as the starting layer Loop: 1. Calculate cD and cI from U(and D) 2. Call the postChannel-like code to do the layer-averaging, having already pulled the necessary info from the dict file 3. Calculate nuSgs with cD, :endLoop
Hi,mdjames:
Have you managed to implement this? I also get stuck in this problem. Any advice is appreciated.

Xianbei

 All times are GMT -4. The time now is 12:32.