CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   change velocity field (http://www.cfd-online.com/Forums/openfoam-solving/122582-change-velocity-field.html)

 LM4112 August 22, 2013 11:18

change velocity field

Dear all,

I'm simulating a flow within a bluff body with a diffuser. At a certain road clearance, the flow within the diffuser region is unstable and it becomes asymmetric. I'm trying to capture this state flow using steady RANS. So far I have obtained a symmetric solution and I would like to change the velocity field of this solution introducing an asymmetry, re-start the simulation with the new velocity field and then see if the simulation returns to the symmetric condition. In order to do that, I want to decrease the velocity of only one half of the domain (say 80%) and then restart the simulation. I 've seen that the velocity field value is a column of numbers; the column index indicates the number of the cell (e.g. first number column 1 and so on)? How can I obtain the list of cells that belongs to a defined sub-domain? What is the best approach in order to change the velocity field of a sub region? Do you have any suggestions about how capture this asymmetry? Thank you in advance

best regards

L. Metellli

 romant August 23, 2013 03:07

Quote:
 Originally Posted by LM4112 (Post 447488) Dear all, I'm simulating a flow within a bluff body with a diffuser. At a certain road clearance, the flow within the diffuser region is unstable and it becomes asymmetric. I'm trying to capture this state flow using steady RANS. So far I have obtained a symmetric solution and I would like to change the velocity field of this solution introducing an asymmetry, re-start the simulation with the new velocity field and then see if the simulation returns to the symmetric condition. In order to do that, I want to decrease the velocity of only one half of the domain (say 80%) and then restart the simulation. I 've seen that the velocity field value is a column of numbers; the column index indicates the number of the cell (e.g. first number column 1 and so on)? How can I obtain the list of cells that belongs to a defined sub-domain? What is the best approach in order to change the velocity field of a sub region? Do you have any suggestions about how capture this asymmetry? Thank you in advance best regards L. Metellli
Hej,

try http://openfoamwiki.net/index.php/Contrib/swak4Foam where you can use funkySetFields. It should be able to take the values present and then just half them or any other factor. Conditions can be applied based on location values.

If you want to capture asymmetry, you might want to look at URANS and/or LES/VLES and turbulence models which support asymmetry (higher order turbulence models, Reynolds Stress Transport models), otherwise you probably won't be able to catch this behavior.

 LM4112 August 23, 2013 05:13

Quote:
 Originally Posted by romant (Post 447615) Hej, try http://openfoamwiki.net/index.php/Contrib/swak4Foam where you can use funkySetFields. It should be able to take the values present and then just half them or any other factor. Conditions can be applied based on location values. If you want to capture asymmetry, you might want to look at URANS and/or LES/VLES and turbulence models which support asymmetry (higher order turbulence models, Reynolds Stress Transport models), otherwise you probably won't be able to catch this behavior.
Hi Roman,

funkySetFields seems to be the utility whom I was looking for, thank you.

Do you think that the asymmetry can be captured only using unsteady solvers? In the wind tunnel tests , after that the instability occurs, the asymmetry doesn't change side and remains in that condition. I was thinking to use DES as well to see it is able to capture this state flow. However it would be more interesting to capture this state flow using steady RANS as clearly it much less computational expensive and then more attractive for industry.
Moreover you wrote that I need to use RSTM or higher order turbulence models as the others RANS models don't support asymmetry, where did you read that? Can you give me some references? I would like to learn more about that. Thank you

best regards
L. Metelli

 romant August 23, 2013 05:27

Quote:
 Originally Posted by LM4112 (Post 447646) Hi Roman, funkySetFields seems to be the utility whom I was looking for, thank you. Do you think that the asymmetry can be captured only using unsteady solvers? In the wind tunnel tests , after that the instability occurs, the asymmetry doesn't change side and remains in that condition. I was thinking to use DES as well to see it is able to capture this state flow. However it would be more interesting to capture this state flow using steady RANS as clearly it much less computational expensive and then more attractive for industry. Moreover you wrote that I need to use RSTM or higher order turbulence models as the others RANS models don't support asymmetry, where did you read that? Can you give me some references? I would like to learn more about that. Thank you best regards L. Metelli
If your geometry is asymmetric, then there will also be an asymmetry in the flow. However, in a CFD simulation, if your mesh and your geometry is symmetric, I would not expect asymmetry, but I could be wrong on that.

The higher order turbulence models or RSTM do not rely on isotropic turbulence, but their turbulence tensor can by anisotropic (closer to reality), which means that they should be better at capturing these phenomena. The are better at reproducing turbulence which results from curvatures and swirling flows, depending on how complex your diffuser and the flow around it are, it could be worth a shot.

A good start to learn about turbulence is Pope, Turbulent Flows and then for turbulence modeling, I would look at Wilcox, Turbulence Modeling for CFD. Both books are very good, in my opinio.

 LM4112 August 23, 2013 05:42

Quote:
 Originally Posted by romant (Post 447653) If your geometry is asymmetric, then there will also be an asymmetry in the flow. However, in a CFD simulation, if your mesh and your geometry is symmetric, I would not expect asymmetry, but I could be wrong on that. The higher order turbulence models or RSTM do not rely on isotropic turbulence, but their turbulence tensor can by anisotropic (closer to reality), which means that they should be better at capturing these phenomena. The are better at reproducing turbulence which results from curvatures and swirling flows, depending on how complex your diffuser and the flow around it are, it could be worth a shot. A good start to learn about turbulence is Pope, Turbulent Flows and then for turbulence modeling, I would look at Wilcox, Turbulence Modeling for CFD. Both books are very good, in my opinio.
What a coincidence, I am reading these two books just in this period XD.
I agree that you loss accuracy assuming that the turbulence viscosity is isotropic but I don't think that with this approach you can't capture an asymmetry for sure. However I will try RSTM as well and see what happens.

 LM4112 August 26, 2013 14:33

Quote:
 Originally Posted by romant (Post 447615) Hej, try http://openfoamwiki.net/index.php/Contrib/swak4Foam where you can use funkySetFields. It should be able to take the values present and then just half them or any other factor. Conditions can be applied based on location values. If you want to capture asymmetry, you might want to look at URANS and/or LES/VLES and turbulence models which support asymmetry (higher order turbulence models, Reynolds Stress Transport models), otherwise you probably won't be able to catch this behavior.
Hi Roman,

I am not familiar with c++, can you please tell me which is the command to compute U*0.8 if x>=0 using funkySetFields? Thank you

 romant August 27, 2013 03:18

Please take a look at the example given on the funkySetFields wiki page http://openfoamwiki.net/index.php/Co...Usage_Examples It is the old page, since funkySetFields is now part of swak4foam. The example will work nevertheless though.

 wzx1989221 February 4, 2014 18:58

Hello, I notice your post, do you have any idea using funkysetfields to manipulate existing velocity filed (i.e. keep existing values and modify them)?

Thanks you very much.

Tony

 wzx1989221 February 4, 2014 19:02

Hi Roman,

Have you figured out how to modify the existing velocity filed with funkysetfileds?
I mean keep the values obtained and then modify the field.

Thank you very much.

Regards,
Tony

 gschaider February 4, 2014 19:45

Quote:
 Originally Posted by wzx1989221 (Post 473450) Hi Roman, Have you figured out how to modify the existing velocity filed with funkysetfileds? I mean keep the values obtained and then modify the field. Thank you very much. Regards, Tony
Try -condition and -keepPatches. Roman already pointed to http://openfoamwiki.net/index.php/Co...funkySetFields (there are some examples)

 wzx1989221 February 5, 2014 06:46

Dear Gschaider,

Many thanks for replying. I already know how to use -condition and -keepPatched (that's how I gave the initial velocity field). My problem is I want to add random number to the velocity filed after the simulation has run for some time without resetting the field (I guess -keepPatches only useful for keep the boundary unchanged, right?). Do you have any ideas for that?

Thanks and regards,
Tony

 gschaider February 5, 2014 12:25

Quote:
 Originally Posted by wzx1989221 (Post 473524) Dear Gschaider, Many thanks for replying. I already know how to use -condition and -keepPatched (that's how I gave the initial velocity field). My problem is I want to add random number to the velocity filed after the simulation has run for some time without resetting the field (I guess -keepPatches only useful for keep the boundary unchanged, right?). Do you have any ideas for that? Thanks and regards, Tony
My guess was that "how to modify the existing velocity filed" meant that you wanted to modify an existing U only in a part of the domain. Rule of thumb: spend AT LEAST as much time formulating your question as you expect the person answering on it. Otherwise you'll get answers like "Yes. It works."

Anyway: so you want to "spoil" a perfectly good velocity field with a random vector. Something like
Code:

`funkySetFields -time 1: -field U -keepPatches -expression "U+0.01*vector(randNormal(),randNormal(),randNormal())"`
does that (when modifying U you can use the old version of U in the expression)

 wzx1989221 February 5, 2014 12:56

Thank you so much for the help. That's exactly what I want (I tried in a similar way but turned out to be error).

Sorry for the confusion. Next time I will try my best to make my question clearer.

Thanks and regards,
Tony

 All times are GMT -4. The time now is 10:49.