|
[Sponsors] |
March 30, 2023, 11:34 |
Sine wave expression at inlet- please help
|
#1 |
New Member
glenmcl
Join Date: Mar 2023
Posts: 8
Rep Power: 3 |
I am running a 2-D transient axisymmetric simulation, which is a rectangle of 5m length, 2.5m height, and on this height line at the bottom ( near the centre axis )there is a inlet line of 0.075m. This velocity-inlet is blowing air (as an ideal gas) essentially into a box. I am looking to see at what distance the velocity reaches 0. I am usinng the turbulent RNG-epsilon model.
My issue: I am trying to have a sine wave at the inlet of my simulation. The sine wave should start at 0, reach +7.7 then dip to -7.7 and then return to 0 in 4s, this will be done for a total of 3 waves ( so 12 seconds). The formula I have been using at the inlet is below. (7.7[m/s])*(sin(((2*PI)/4[s])*(Time))) My issue is, no matter what my simulations do, they will not allow this velocity to drop below 0, instead it will start at 0 and rise to +7.7, drop to 0 and then rise to 7.7 again instead of dropping to -7.7. I have tried importing a .txt file in 2 different formats and loading them at the inlet. this table can be seen below time vel 0 0 0.25 2.945246129 0.5 5.442553895 0.75 7.112111252 1 7.699997559 1.25 7.116802008 1.5 5.451221997 1.75 2.956573257 2 0.012263427 2.25 -2.93391153 2.5 -5.433871987 2.75 -7.107402455 3 -7.699978027 3.25 -7.121474713 3.5 -5.459876271 3.75 -2.967892886 4 -0.024526824 4.25 2.922569489 4.5 5.425176297 4.75 7.102675631 5 7.699938964 5.25 7.126129353 5.5 5.468516697 5.75 2.979204987 6 0.036790158 6.25 -2.911220035 6.5 -5.416466845 6.75 -7.09793079 7 -7.69988037 7.25 -7.130765917 7.5 -5.477143251 7.75 -2.990509531 8 -0.049053399 8.25 2.899863196 8.5 5.407743654 8.75 7.093167944 9 7.699802245 9.25 7.135384394 9.5 5.485755913 9.75 3.001806489 10 0.061316515 10.25 -2.888499001 10.5 -5.399006746 10.75 -7.088387107 11 -7.699704589 11.25 -7.139984772 11.5 -5.494354659 11.75 -3.013095833 12 -0.073579476 Something in the simulation is seemingly not allowing it to ever dip below the x axis into negatives. When alter the formula to make the wave stay above the x axis the sine wave performs as it should. Any help would be greatly appreciated as i truly am puzzled. Thanks (attached is the output displaying the sine wave being bounced back |
|
March 30, 2023, 16:43 |
|
#2 |
Senior Member
Join Date: Jun 2009
Location: Technische Universität Chemnitz
Posts: 107
Rep Power: 16 |
Do you have the inlet boundary condition set to normal to boundary? What happens if you specify the x and y components of velocity directly?
Keep in mind when the flow is negative at the inlet it is pulling air in from the (defined) outlet. Since we really don't know the conditions at this point, make sure you make it far enough away that any air from it does not interact where you are interested. You should be able to add the formula in Fluent using a Named Expression. This will save a step in the setup. Plus when you adjust the time step down, as I am sure 0.25 is much too large, you won't have to regenerate a new text file. |
|
March 31, 2023, 01:11 |
|
#3 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,676
Rep Power: 66 |
Velocity magnitude is an always positive quantity. You need to plot x-velocity, y-velocity- or z-velocity if you want to see negative numbers. As an additional sanity check, make a vector plot.
|
|
March 31, 2023, 02:38 |
|
#4 |
Senior Member
Join Date: Jun 2009
Location: Technische Universität Chemnitz
Posts: 107
Rep Power: 16 |
||
March 31, 2023, 08:26 |
|
#5 | |
New Member
glenmcl
Join Date: Mar 2023
Posts: 8
Rep Power: 3 |
Quote:
|
||
March 31, 2023, 08:29 |
|
#6 | |
New Member
glenmcl
Join Date: Mar 2023
Posts: 8
Rep Power: 3 |
Quote:
Thank you for your reply and looking forward to your next response. All this help is much appreciated. |
||
March 31, 2023, 08:45 |
|
#7 | |
New Member
glenmcl
Join Date: Mar 2023
Posts: 8
Rep Power: 3 |
Quote:
https://youtu.be/ELhFPG95o9s I will attach my geometry. This example is a sine wave to emulate breathing, a gust of wind out at 7.7, then a breath in to -7.7 ITs getting this negative number that has been my issue I currently do not have an outlet set, but i have placed one on the opposite wall to the inlet and it has made no difference. |
||
March 31, 2023, 10:09 |
|
#8 | |
New Member
glenmcl
Join Date: Mar 2023
Posts: 8
Rep Power: 3 |
Quote:
Thanks for all your help i appear to be on the right track now |
||
March 31, 2023, 11:11 |
|
#9 |
Senior Member
Join Date: Jun 2009
Location: Technische Universität Chemnitz
Posts: 107
Rep Power: 16 |
Nice that you had it right all along. I will say that you should have an outlet on the outer boundaries for a person breathing into the environment. What would be most appropriate for this case would be a far field pressure. Without an outlet the pressure would artificially increase, think of it like breathing into a paper bag and the bag expanding.
It is always good to remember that velocity is a vector (therefore magnitude AND direction) and pressure is a scalar (single value). I probably say that daily when teaching the introductory fluids course. |
|
March 31, 2023, 11:42 |
|
#10 | |
New Member
glenmcl
Join Date: Mar 2023
Posts: 8
Rep Power: 3 |
Quote:
|
||
March 31, 2023, 11:43 |
|
#11 | |
New Member
glenmcl
Join Date: Mar 2023
Posts: 8
Rep Power: 3 |
Quote:
|
||
March 31, 2023, 20:01 |
|
#12 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,676
Rep Power: 66 |
If you have you have only x-velocity and y-velocity then you don't have a z-velocity in 2D.
Still, it would be extremely naive of me to assume that your two velocity components are in x and y. Not everybody does CFD the same way. If I say x and y velocity when you have an x and z then you would be upset that I give you the wrong hint. |
|
February 6, 2024, 13:02 |
|
#13 | |
New Member
Cian Daly
Join Date: Feb 2024
Posts: 1
Rep Power: 0 |
Quote:
|
||
February 6, 2024, 13:25 |
|
#14 |
New Member
glenmcl
Join Date: Mar 2023
Posts: 8
Rep Power: 3 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
attachmentPt for floating body at each time step for overInterDyMFoam solver | mahsankhan | OpenFOAM Running, Solving & CFD | 0 | January 24, 2022 11:13 |
Fluent UDF for AUV sine wave movement | conthula | FLUENT | 1 | January 19, 2020 21:33 |
Dambreak initial condition sine wave | joshmccraney | OpenFOAM Pre-Processing | 2 | August 8, 2019 17:00 |
Convergence problem with tetrahedral grids | Tarak | OpenFOAM Running, Solving & CFD | 22 | June 25, 2018 19:09 |
Create rectified square wave inlet flow profile | mhw2015 | Fluent UDF and Scheme Programming | 0 | November 18, 2015 12:30 |