CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

change velocity field

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2013, 12:18
Default change velocity field
  #1
Member
 
Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 13
LM4112 is on a distinguished road
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
LM4112 is offline   Reply With Quote

Old   August 23, 2013, 04:07
Default
  #2
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
romant is on a distinguished road
Quote:
Originally Posted by LM4112 View Post
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
romant is offline   Reply With Quote

Old   August 23, 2013, 06:13
Default
  #3
Member
 
Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 13
LM4112 is on a distinguished road
Quote:
Originally Posted by romant View Post
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
LM4112 is offline   Reply With Quote

Old   August 23, 2013, 06:27
Default
  #4
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
romant is on a distinguished road
Quote:
Originally Posted by LM4112 View Post
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
romant is offline   Reply With Quote

Old   August 23, 2013, 06:42
Default
  #5
Member
 
Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 13
LM4112 is on a distinguished road
Quote:
Originally Posted by romant View Post
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 is offline   Reply With Quote

Old   August 26, 2013, 15:33
Default
  #6
Member
 
Luca
Join Date: Mar 2013
Posts: 59
Rep Power: 13
LM4112 is on a distinguished road
Quote:
Originally Posted by romant View Post
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
LM4112 is offline   Reply With Quote

Old   August 27, 2013, 04:18
Default
  #7
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Eindhoven, NL
Posts: 374
Rep Power: 21
romant is on a distinguished road
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
romant is offline   Reply With Quote

Old   February 4, 2014, 18:58
Default
  #8
Member
 
Tony
Join Date: Nov 2013
Posts: 35
Rep Power: 13
wzx1989221 is on a distinguished road
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 is offline   Reply With Quote

Old   February 4, 2014, 19:02
Default
  #9
Member
 
Tony
Join Date: Nov 2013
Posts: 35
Rep Power: 13
wzx1989221 is on a distinguished road
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
wzx1989221 is offline   Reply With Quote

Old   February 4, 2014, 19:45
Default
  #10
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by wzx1989221 View Post
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
gschaider is offline   Reply With Quote

Old   February 5, 2014, 06:46
Default
  #11
Member
 
Tony
Join Date: Nov 2013
Posts: 35
Rep Power: 13
wzx1989221 is on a distinguished road
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
wzx1989221 is offline   Reply With Quote

Old   February 5, 2014, 12:25
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by wzx1989221 View Post
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
gschaider is offline   Reply With Quote

Old   February 5, 2014, 12:56
Default
  #13
Member
 
Tony
Join Date: Nov 2013
Posts: 35
Rep Power: 13
wzx1989221 is on a distinguished road
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
wzx1989221 is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cartesian to cylindrical velocity field conversion francois OpenFOAM Post-Processing 11 November 30, 2017 06:52
real velocity field from energy spectrum Angel Main CFD Forum 7 December 13, 2013 21:40
Solving transport equations with known velocity field Mojtaba.a OpenFOAM Running, Solving & CFD 6 August 6, 2012 08:43
accessing another velocity field in bc daviderzen OpenFOAM 0 April 20, 2011 07:24
fixed velocity field Glen CFX 3 August 28, 2006 13:17


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