write a UDF to give a velocity boundary condition at an interior face
I'm trying to write a UDF to give a velocity boundary condition at an interior face. The velocity condition is U.n=alpa*(C_P(c0,t0)-C_P(c1,t1)). When I'm trying to get velocity condition for C1 cells, error msg is coming. Can anyone advice me on this? Thank you.
udf #include "udf.h" DEFINE_PROFILE(edge_Velo,t,i) { real xf[ND_ND]; real xc[ND_ND]; real xe[ND_ND]; face_t f; cell_t c1 ; Thread*t1 ; cell_t c0 ; Thread*t0 ; double _D=0; begin_f_loop(f,t) { F_CENTROID(xf,f,t); c1=F_C1(f,t) ; t1=THREAD_T1(t); C_CENTROID(xc,c1,t1); c0=F_C0(f,t) ; t0=THREAD_T0(t) ; C_CENTROID(xe,c0,t0); F_PROFILE(f,t,i) = -(0.000025*((C_P(c0,t0)-C_P(c1,t1));)); } end_f_loop(f,thread) } |
What is your error message?
Quote:
|
Quote:
C:\PROGRA~1\ANSYSI~1\v145\fluent\fluent14.5.0\win6 4\3ddp\fl1450s.exe received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor |
I compiled the UDF, it works very well.
You recieved an access violation error, and this error means that UDF can not access a defined value in UDF. I do not have your Fluent file to check the UDF. If it is possible share your file you check the UDF. Quote:
|
You can not set any kind of define-profile in an interior boundary. I think that you have a boundary which happens to be interior and you set it as velocity-inlet.
I have not checked it, but I guess that both THREAD_T1 and F_C1 can only be used if that cell or thread exists, and I think that is not your case. Anyway, if for some reason you want to set a velocity inlet boundary condition in an interior boundary, I would leave that boundary as interior and I would use a momentum source instead, but that still sounds weird to me. |
Indeed, a boundary condition on an interior face sounds weird. I think you should redo the geometry/mesh, make a small zone where you want to fix the velocities, e.g. a zone with only 1 cell layer, and then in Fluent: Cell Zone Conditions => Edit... => Fixed Values...
|
1 Attachment(s)
Hi, there are two regions larger one is porous. I wanted to make velocity v=const.*P at the interface. P is the pressure difference taking from the nearest cell values. Can anyone suggest something pls? Thank you very much for the replies.
|
I have no idea how you can achieve that, all kind of questions are popping in my head:
- 2D or 3D? steady or transient? - you want to define velocity vectors that are normal to the interface? the interface is the yellow circle? - it looks like a little coding nightmare: trying to retrieve pressure on both sides of the interface, calculate some angles, calculate x-y-z velocity components, ... |
It is 3D and Steady state simulation. Yes, I want to define normal velocity (radial). Yellow circle is a non porous region (Cylinder) and cube is porous (hollow). Interface or interior lies between these two regions and want to access pressure values in order to give velocity. This is actually trying to implement a permeable BC at the interface. Indeed, it is a nightmare.. big time :( . Really appreciate your suggestions. Thank you
|
Quote:
How about your simulation now? I met the same problems defining permeable membrane wall in FLUENT. It is pretty difficult to define the velocity. |
Hi,
I couldn't do it and I just gave up. Specially, I was trying to give it at the interface and that was the difficult part. No success. What kind of problem are you dealing with? cheers!! |
Quote:
My project is simulating membrane desalination process which is pretty similar with your problem. I also need to define velocity at the membrane side(interior or interface) to obey the mass conservation law. Now, I'm trying to learn how to use mass source and wish it can solve this problem. |
In order to implement condition (above) at the interface, needs to change the interpolation scheme or the pressure velocity coupling method (I think). I'm trying few things at the moment :) lets see and Hope for the best. Good luck with you work. cheers
|
Quote:
|
:) Out of curiosity, have you figured out how to do it with UDF? I'm trying to model a cylinder with porous wall.
|
Quote:
|
velocity and pressure on interior face
I want to measure the velocity and pressure on interior face in Nozzle design and also required further thrust calculation. Please share any details with u and it is useful for my project and
|
Hi,
Can you explain bit more? I manage to create a one cell thickness layer and implement my BCs in there. I think specifying a BC at an interior surface does not work as we dealing with the cell-based calculations. Thanks |
Quote:
I had the similar problem as you, which was defining a velocity profile on an interior face or wall. This link might be useful for you http://cape-forum.com/index.php?topic=1248.0 However, after following the steps mentioned in above link, you need to define a opposite velocity profile on the other slit wall. This method works for my case, and hope it can help. Jianan |
Problem in temperature calculation using udf
Quote:
I have written a udf for this but it is showing "segmentation fault". can you tell me where might be the problem ? Code:
#include "udf.h" |
All times are GMT -4. The time now is 23:31. |