# change velocity field

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 22, 2013, 11:18 change velocity field #1 Member   Luca Join Date: Mar 2013 Posts: 59 Rep Power: 13 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

August 23, 2013, 03:07
#2
Senior Member

Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
Quote:
 Originally Posted by LM4112 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.
__________________
~roman

August 23, 2013, 05:13
#3
Member

Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 13
Quote:
 Originally Posted by romant 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

August 23, 2013, 05:27
#4
Senior Member

Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
Quote:
 Originally Posted by LM4112 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.
__________________
~roman

August 23, 2013, 05:42
#5
Member

Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 13
Quote:
 Originally Posted by romant 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.

August 26, 2013, 14:33
#6
Member

Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 13
Quote:
 Originally Posted by romant 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

 August 27, 2013, 03:18 #7 Senior Member     Roman Thiele Join Date: Aug 2009 Location: Eindhoven, NL Posts: 374 Rep Power: 21 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. __________________ ~roman

 February 4, 2014, 17:58 #8 Member   Tony Join Date: Nov 2013 Posts: 35 Rep Power: 12 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

 February 4, 2014, 18:02 #9 Member   Tony Join Date: Nov 2013 Posts: 35 Rep Power: 12 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

February 4, 2014, 18:45
#10
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
Quote:
 Originally Posted by wzx1989221 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)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

 February 5, 2014, 05:46 #11 Member   Tony Join Date: Nov 2013 Posts: 35 Rep Power: 12 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

February 5, 2014, 11:25
#12
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
Quote:
 Originally Posted by wzx1989221 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)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

 February 5, 2014, 11:56 #13 Member   Tony Join Date: Nov 2013 Posts: 35 Rep Power: 12 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

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post francois OpenFOAM Post-Processing 11 November 30, 2017 05:52 Angel Main CFD Forum 7 December 13, 2013 20:40 Mojtaba.a OpenFOAM Running, Solving & CFD 6 August 6, 2012 07:43 daviderzen OpenFOAM 0 April 20, 2011 06:24 Glen CFX 3 August 28, 2006 12:17

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

 Contact Us - CFD Online - Privacy Statement - Top