LEMOS InflowGenerator
I am currently investigating the use of OpenFoam LES for urban dispersion modelling and would like to use the LEMOS decayingTurbulanceInflowGenerator for the Inlet profile. I have downloaded and compiled the LEMOS library with no issues but am struggling to find any literature on what properties I should use withing the 0/U file. The pdf example file provided with LEMOS gives the following:
inlet { type decayingTurbulenceInflowGenerator; direction 1; LField nonuniform List<scalar> ... refField nonuniform List<vector> ... RField nonuniform List<symmTensor> ... value nonuniform List<vector> ... } However, I am not sure what values / data needs to be entered in the 'List<...> fields and wondered if anyone could provide any help with this or an example they would be willing to provide that demonstrates how to use the InflowGenerator? Thanks Rob 
LEMOS example
1 Attachment(s)
A neat little BC. I believe it is based on Lund's work.
Attached is one based on a quick scan of the source code. All the values are probably nonsense but it runs and gives some eddies. Note that it is based on the motorbike tutorial (without the motorbike) so has a bottom wall moving at 20 m/s. The important bit is the definition of U: Code:
inlet 
roth, thanks for the help. I have just come back from holiday and will give this a go later today. I have been using the atmBoundaryLayerInletVelocity boundary condition and will need to figure out how to combine this with the LeMoS BC. Do you know of any good tutorials on how to use the nonuniform BC? Im new to OpenFoam.
Thanks Rob 
Michael,
I have had a go an managed to et your example running with no problems at all however I struggle to get paraview to visuaise the U and U_0 fields as i get a vtk error: ERROR: In /home/punk/Downloads/vtkPOFFReader/vtkOFFDevReader.cxx, line 7807 vtkOFFReaderPrivate (0x3450a20): Error reading line 4667 of /home/OpenFoamUser/OpenFOAM/Simulations/LEMOS/0.1/U: Expected '(', found 1 Im currently using paraview 3.10.0, do I need an upgrade? Thanks Rob 
Hi Rob,
there is a "bug" in the code. It writes additional variables into the U files (the vortons) and that's why paraview can't read it. As far as I remember, paraFoam could read the U files. Cheers Marc 
Quote:

Would you please tell me where can I download the LEMOS library?

Quote:

Thank you so much Dear Rob
It is really so kind of you. 
I wrote a small bash script to remove the vortons from the U file. It also creates a backup copy of U:
Code:
cp $1 $1.bak ./removeVortons "pathToUFile", e.g. "10/U" Regards Marc 
Quote:
That great. Thanks very much for that. I gave up on LEMOS but will be having another look at in the coming weeks. I don't suppose you have a simple example you could send through that will give me a better idea of how to utilise the unsteady fields? There is so little documentation on the inflow generator that it almost renders it useless. Thanks Rob 
Dear Rob,
we will provide a little test case or tutorial where you can see the settings and some explanations of the inflow generator. Furthermore the OF reader of paraview is not designed to read the vortons which are used to create the fluctuations. So that's not a bug in the code but a missing feature in OF paraview plugin. We will have a look at it and publish a workaround as fast as possible. Best regards Matthias 
Dear Matthias,
you are indeed right, apologies. The bug is in the paraview nativ OF reader, which can't read the SLList field. I use the "remove vortons" script now to postProcess with paraview, works fine. Regards, Marc 
Hello there,
I tried to find the paper from which this boundary condition is developed but did not find the right one. Does anybody know something about that? Give me some hints ? Thank you so much. I have found the corresponding paper in the following webpage, thanks. http://www.lemos.unirostock.de/publikationen/ The title is Code:
Kornev, N. & Hassel, E. (2007). Method of random spots for generation of synthetic inhomogeneous turbulent fields with prescribed autocorrelation functions. Communications in Numerical Methods Engineering, Vol. 23, Issue 1, pp. 3543. Quote:

Hello everyone,
I read both the code and the paper I mentioned in the last thread, I am a little confused about the calculation of C_ in the following. What is the purpose of these lines? Thank you very much. Code:
Field<tensor> C_(R_.size(), pTraits<tensor>::zero); Code:
fixedValueFvPatchField<vector>::operator==(refField_+ turbulent); we can deduce: refField_ is the mean fields and turbulent is the fluctuation field. From Code:
turbulent = Lund_&turbulent; But I got stuck in the following: Code:
turbulent = C_&turbulent; Anybody gives some comments? 
The constant C_ represents some kind of scaling factor in tensor notation. It is chosen during the rms (=standard deviation) calculation from the condition that rms has a prescribed value.
For instance, let us generate a random signal with the rms value of 0.9: First we generate randomly numbers 0.1, 0.2, 0.5, 0.3. The mean value is of this sample is 0.075. The standard deviation is 0.3031. Let us introduce the constant C=(0.9/0.3031). Multiply all numbers above with C. The signal sample 0.1*C, 0.2*C, 0.5*C, 0.3*C has the rms 0.9 or variance of 0.81. The same is made in Lund transformation and referred to as the conditioning 
Dear Matthias,
Thank you so much for your help. I understand this is a kind of normalization (but in your reply it should be C=sqrt(0.9/0.3031)?). I found that this scaling approach is different from what is used in Kornev and Hassel , Commun. Numer. Meth. Engng. 2007. I also checked the paper by Lund from JCP and it seems that they did not explicitly mentioned this scaling method. Could you please give me some references about this scaling approach? Besides I found that there is an variable "ind_" is used in the code. What does this variable mean? it is used in the following equation: Code:
R_=((ind_1)/ind_)*R_+(1/ind_)*sqr(turbulent) 
On our homepage you can find another paper from 2008
Kornev, N., Kröger, H. & Hassel, E. (2008). Synthesis of homogeneous anisotropic turbulent fields with prescribed secondorder statistics by the random spots method. Communications in Numerical Methods in Engineering, Vol. 24, Issue 10, pp. 875877. for information regarding the scaling operations. For Lund transformation I have to look for the correct paper. Exactly if using the square root it should be C=sqrt(0.9/0.091869). That's depending on the definition (or point of view) what the rms value is. The line of code you mentioned is used for time averaging of Reynolds stresses. The ind_ label is increased everytime the bc is activated, so the accuracy of Reynolds stresses will be improved the longer the case is running. 
Thanks, Matthias.
I read the paper you mentioned. It is very helpful for me to understand the algorithms of the BC. However, I did not find the information about the scaling and for my understanding it was emphasized that how to obtain the function f, the inner velocity of the random spots. Did I dismiss something? Thank you for your help and sorry for my frequent questions. I would like to know something about the principle before I use your method. Thank you again. 
Please, have a look at the last part of the paper where the constant C is determined. In principle that is the same scaling operation as done in the inflow generator.
The Lund transformation isn't considered in this paper. 
All times are GMT 4. The time now is 16:42. 