|
[Sponsors] |
Changing Pressure at specifird location in domain |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 30, 2019, 04:11 |
Changing Pressure at specifird location in domain
|
#1 |
Member
MEK
Join Date: Oct 2016
Posts: 39
Rep Power: 10 |
Hello everyone, i would like to know that how can we change the pressure in a transient run simulation at some specified location e.g after some time in simulation i want to increse or decrease the pressure in domain at specified location. Please look at my work and suggest.
i am using DEFINE_ADJUST but its not working # define domain_ID 7 /* Pressure calculations */ DEFINE_ADJUST(my_adjust,d) { real del_p = 0; real p_operating = RP_Get_Real ("operating-pressure"); Thread *t; cell_t c; face_t f; t=Lookup_Thread(d, domain_ID); d = Get_Domain(domain_ID); if(CURRENT_TIME == 0.1) { del_p = -5; } else del_p = 0; thread_loop_c(t,d) { begin_c_loop(c,t) { real pressure = C_P(c,t); C_P(c,t) = pressure + del_p + p_operating; } end_c_loop(c,t) } thread_loop_f(t,d) { begin_f_loop(f,t) { real pressure = C_P(c,t); C_P(c,t) = pressure + del_p + p_operating; } end_f_loop(f,t) } if(CURRENT_TIME == 0.1) { del_p = -5; } else del_p = 0; thread_loop_c(t,d) { begin_c_loop(c,t) { real pressure = F_P(f,t); F_P(f,t) = pressure + del_p + p_operating; } end_c_loop(c,t) } thread_loop_f(t,d) { begin_f_loop(f,t) { real pressure = F_P(f,t); F_P(f,t) = pressure + del_p + p_operating; } end_f_loop(f,t) } } |
|
October 31, 2019, 01:16 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
it depends on the way, how you will define location
__________________
best regards ****************************** press LIKE if this message was helpful |
|
October 31, 2019, 03:29 |
|
#3 |
Member
MEK
Join Date: Oct 2016
Posts: 39
Rep Power: 10 |
Thank u so much for replying
By using f_centroid we can restrict location but question am I right? |
|
November 1, 2019, 00:14 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
yes, using f_centroid you can control coordinates on faces, to control coordinates in cells you need C_centroid macro
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 1, 2019, 00:37 |
|
#5 |
Member
MEK
Join Date: Oct 2016
Posts: 39
Rep Power: 10 |
Thank you so much.
But my problem is I am unable to see any changes in pressure field. Looks like I am doing something wrong |
|
November 1, 2019, 03:59 |
|
#6 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
firstly, compile your code, It has several errors.
your statement time == 0.1 most likely will never be true
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 1, 2019, 04:04 |
|
#7 |
Member
MEK
Join Date: Oct 2016
Posts: 39
Rep Power: 10 |
UDF is compiling and giving no error and current time ==0.1 means that it will execute at flow time 0.1. but when I see pressure contours at 0.1flow time nothing happened.
|
|
November 1, 2019, 06:05 |
|
#8 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
code above is wrong, show the code you are using with no errors....
del_p = -5; could be negligibly small, cause normal pressure is 101325 ,check it if(CURRENT_TIME == 0.1) is only 1 moment time and it is possible, that fluent will never have exactly 0.1 time inside solver, it is possible to get 0.09999999999
__________________
best regards ****************************** press LIKE if this message was helpful |
|
November 1, 2019, 07:26 |
|
#9 |
Member
MEK
Join Date: Oct 2016
Posts: 39
Rep Power: 10 |
Once again really appreciated your insight.
My time step size is 0.001 so surely 0.1 comes in it's progression Regarding dp=-5 I have just replaced my equation with this constant 5 value to make my point. Actually in that equation I am using C_Centroid to restrict the location of pressure change. In actual equation it will surely have effect prominent enough if it works properly. Because I have solved it manually and its value is compareble to 101325. |
|
November 4, 2019, 11:31 |
|
#10 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
But you fail to see that, even if you happen to hit exactly time 0.1 on time step 100, you don't have it anymore at time step 101. So the pressure changes for only one millisecond in your simulation. I suspect that you don't want that. I suspect that you want the pressure to be changed for all times after 0.1 seconds. In that case: Code:
if(CURRENT_TIME > 0.1) |
||
November 4, 2019, 21:15 |
|
#11 | |
Member
MEK
Join Date: Oct 2016
Posts: 39
Rep Power: 10 |
Quote:
|
||
November 4, 2019, 21:27 |
|
#12 | |
Member
MEK
Join Date: Oct 2016
Posts: 39
Rep Power: 10 |
Quote:
https://youtu.be/IvIzLIqN29w |
||
November 5, 2019, 02:53 |
|
#13 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Is this your simulation? If so, why did you say that the UDF was not working? |
||
November 5, 2019, 03:04 |
|
#14 |
Member
MEK
Join Date: Oct 2016
Posts: 39
Rep Power: 10 |
yes this is my simulation of vortical gust impinging to the cylinder i have generated the vortical gust by source term implementation in x and y momentum source through UDF.
according to my little understanding yes by increasing velocity at a point the pressure will be drop to compensate it . But i dont want to see the pressure drop thats why i am trying to use DEFINE_ADJUST UDF to compensate that pressure loss (UDF is compiling and giving no error i have hooked it in function hook but i am unable to see it effect i dont know how to check if UDF is effecting or not. if i only apply DEFINE_ADJUST UDF there is no change in lift, drag, pressure or residuals.) |
|
November 5, 2019, 04:40 |
|
#15 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
You have been told already a few times why you see no effect.
I worry a bit about your statement Quote:
|
||
November 5, 2019, 05:00 |
|
#16 |
Member
MEK
Join Date: Oct 2016
Posts: 39
Rep Power: 10 |
by introducing the vortical gust in domain there is a change in velocity and vorticity contours at localize location but in pressure contours whole inlet domain is disturbed. that is what bothering me.
|
|
November 5, 2019, 07:09 |
|
#17 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Well, it can be physical or non-physical.
If it is physical, then you should accept it, because it's just what it is. You should not use a UDF to change the result just because you don't like it. If it is non-physical, something is wrong in your simulation. You should find out what is wrong. What is the cause of this non-physical thing. Don't write a UDF to suppress the effect, but find the cause and get rid of it. So you see, whatever it is, your UDF is not what you need. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Periodic Pressure drop | cfd_begin | CFX | 10 | May 25, 2017 08:09 |
Closed Domain Buoyancy Flow Problem | Madhatter92 | CFX | 6 | June 20, 2016 22:05 |
Setting rotating frame of referece. | RPFigueiredo | CFX | 3 | October 28, 2014 05:59 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 05:05 |