|
[Sponsors] |
write a UDF to give a velocity boundary condition at an interior face |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 21, 2014, 20:08 |
write a UDF to give a velocity boundary condition at an interior face
|
#1 |
New Member
|
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) } |
|
December 26, 2014, 09:28 |
|
#2 | |
Member
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 16 |
What is your error message?
Quote:
|
||
December 27, 2014, 21:45 |
|
#3 |
New Member
|
This is the error massage and please help
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 |
|
December 30, 2014, 08:18 |
|
#4 | |
Member
Ali.E
Join Date: Sep 2010
Location: Lisboa
Posts: 83
Rep Power: 16 |
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:
|
||
December 30, 2014, 11:15 |
|
#5 |
Member
Join Date: Jul 2013
Posts: 80
Rep Power: 13 |
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. |
|
December 30, 2014, 13:05 |
|
#6 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
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...
|
|
January 5, 2015, 21:09 |
|
#7 |
New Member
|
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.
|
|
January 6, 2015, 02:25 |
|
#8 |
Senior Member
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17 |
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, ... |
|
January 6, 2015, 04:32 |
|
#9 |
New Member
|
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
|
|
February 3, 2015, 18:36 |
|
#10 | |
New Member
Xu Su
Join Date: Jul 2014
Posts: 3
Rep Power: 12 |
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. |
||
February 3, 2015, 19:19 |
|
#11 |
New Member
|
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!! |
|
February 3, 2015, 23:47 |
|
#12 | |
New Member
Xu Su
Join Date: Jul 2014
Posts: 3
Rep Power: 12 |
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. |
||
February 4, 2015, 00:22 |
|
#13 |
New Member
|
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
|
|
February 4, 2015, 00:25 |
|
#14 |
New Member
Xu Su
Join Date: Jul 2014
Posts: 3
Rep Power: 12 |
Good luck. Keep in touch.
|
|
June 4, 2015, 17:40 |
|
#15 |
New Member
Join Date: Jun 2015
Posts: 1
Rep Power: 0 |
Out of curiosity, have you figured out how to do it with UDF? I'm trying to model a cylinder with porous wall.
|
|
June 18, 2015, 00:02 |
|
#16 |
New Member
|
||
January 5, 2018, 09:14 |
velocity and pressure on interior face
|
#17 |
New Member
Prabhu R
Join Date: Nov 2017
Posts: 13
Rep Power: 9 |
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
|
|
January 6, 2018, 19:20 |
|
#18 |
New Member
|
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 |
|
May 23, 2018, 12:08 |
|
#19 | |
New Member
Jianan Zhao
Join Date: Nov 2017
Posts: 1
Rep Power: 0 |
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 |
||
August 5, 2018, 05:29 |
Problem in temperature calculation using udf
|
#20 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
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" DEFINE_PROFILE(fluxloss,thread,position) { real h; real T_ext; face_t f; begin_f_loop(f,thread) { h = 10; T_ext = 300; F_PROFILE(f,thread,position) =-10*(WALL_TEMP_INNER(f,thread)-T_ext); } end_f_loop(f,thread) } |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 60 | July 17, 2024 06:45 |
UDF setting wall boundary condition with a DEFINE_PROFILE | NLao | FLUENT | 3 | September 2, 2019 01:33 |
map outlet boundary profile as an inlet condition using UDF | Daniel_Khazaei | Fluent UDF and Scheme Programming | 2 | June 20, 2016 12:53 |
Time dependant pressure boundary condition | yosuke1984 | OpenFOAM Verification & Validation | 3 | May 6, 2015 07:16 |
UDF Boundary Condition | Victor | FLUENT | 2 | November 6, 2003 12:37 |