|
[Sponsors] |
May 19, 2018, 20:04 |
Hooking multiple erosion UDFs
|
#1 |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 11 |
Hello,
I'm running a multiphase flow to determine sand erosion. In addition to the Generic, Oka, Finnie and Mclaury erosion models available in Fluent, I wish to include 4 more erosion models. I have written the UDFs for them and they compile well without errors. Usually I would hook them up at=> Models -> Discrete Phase -> UDF -> Erosion/Accretion But, I can only hook 1 at a time. I want to run all erosion models simultaneously to save on computation time. Is there something I'm missing? Thanks, -B |
|
June 20, 2018, 13:26 |
|
#2 |
New Member
Edilberto
Join Date: Jun 2018
Posts: 8
Rep Power: 8 |
hi there, Could you please share the UDF for erosion models? I dont have any idea on how to write them and I need them, thank you
|
|
June 20, 2018, 16:10 |
|
#3 | |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 11 |
Quote:
I can guide you in writing your erosion UDFs. Use the DEFINE_DPM_EROSION macro. You can find more information about it in the link below: http://jullio.pe.kr/fluent6.1/help/html/udf/node93.htm There are a few things to keep in mind: 1. define your constants. 2. specify your impact angle function f_alpha. 3. Write your erosion equation with your defined constants and f_alpha. 4. Save your erosion rate in a user-defined memory or in the default erosion storage: F_STORAGE_R(f,t,SV_DPMS_EROSION) It is quite simple actually. -B |
||
June 21, 2018, 04:12 |
|
#4 |
New Member
Edilberto
Join Date: Jun 2018
Posts: 8
Rep Power: 8 |
Good morning, after your reply, I spent all night reading about the topic, I finally was able to "write" something, I am trying to make the DNV erosion model for my dissertation and I wrote this, I did it in notepad but I dont know what if the next step or if that is correct, I would appreciate if you take a look on it. thank you,
#include "udf.h" #include "math.h" float A1 =9.37; float A2 =-42.295; float A3 =110.864; float A4 =-175.804; float A5 =170.137; float A6 =-98.398; float A7 =31.211; float A8 =-4.172; float K= 2.0e-9; /* material Constant */ float pt=7800; /* density of steel */ DEFINE_DPM_EROSION(DNV, p, t, f, normal, alpha, Vmag, mdot) { real erosion; real a=alpha; real v=Vmag; real F_alpha; real m=mdot; real V; real at; at=(M_PI*pow(0.026,2))/(4.*sin(a)); /* area exposed to erosion */ V=pow(v,2.6); /* impact velocity of particle raised to constant n */ F_alpha=A1*pow(((a*M_PI)/180),1)+A2*pow(((a*M_PI)/180),2)+A3*pow(((a*M_PI)/180),3)+A4*pow(((a*M_PI)/180),4)+ A5*pow(((a*M_PI)/180),5)+A6*pow(((a*M_PI)/180),6)+A7*pow(((a*M_PI)/180),7)+A8*pow(((a*M_PI)/180),8); erosion=(m*K*V*F_alpha)/(pt*at); F_STORAGE_R(f,t,SV_DPMS_EROSION)=erosion; } |
|
June 21, 2018, 10:02 |
|
#5 | |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 11 |
Quote:
Great job, but may I make a few suggestions to make it easier to read and edit in the future. 1. You can put A1-A8 directly in the UDF. I made an error in the first comment. It is best to define the variables early on and put the constants in the equation. Your F_alpha would then look something like: f_alpha=9.370*alpha-42.295*pow(alpha,2)+110.864*pow(alpha,3)-175.804*pow(alpha,4)+170.137*pow(alpha,5)-98.298*pow(alpha,6)+31.211*pow(alpha,7)-4.170*pow(alpha,8); 2. While defining K and pt, real is sufficient. I've never tried float but you can try. 3. You need to include the following after the definitions and before you commence your equations. These retrieve and store data in adjacent cells and threads. Your erosion UDF will not compile without these lines. real A[ND_ND]; Thread *t0; cell_t c0; t0 = THREAD_T0(t); c0 = F_C0(f,t); 4. I'm not sure about the necessity for your line for area exposed to erosion. I don't use it since to my understanding, if we add the lines for (3), fluent will do the rest. But please try with and without it and let me know how it goes. Best, -B |
||
June 21, 2018, 17:24 |
|
#6 |
New Member
Edilberto
Join Date: Jun 2018
Posts: 8
Rep Power: 8 |
Hi, I finally get no errors, however, when I try to compile (interpreted), I get these line and fluent crashes after 10 iterations
C:/Users/edilb/AppData/Local/Temp/c5.c.19628.0.c:2: math.h: No such file or directory C:/Users/edilb/AppData/Local/Temp/c5.c.19444.1.c:2: math.h: No such file or directory C:/Users/edilb/AppData/Local/Temp/c5.c.9248.2.c:2: math.h: No such file or directory C:/Users/edilb/AppData/Local/Temp/c5.c.21208.3.c:2: math.h: No such file or directory C:/Users/edilb/AppData/Local/Temp/c5.c.2204.4.c:2: math.h: No such file or directory C:/Users/edilb/AppData/Local/Temp/c5.c.7000.5.c:2: math.h: No such file or directory C:/Users/edilb/AppData/Local/Temp/c5.c.15792.6.c:2: math.h: No such file or directory C:/Users/edilb/AppData/Local/Temp/c5.c.9244.7.c:2: math.h: No such file or directory |
|
June 21, 2018, 17:27 |
|
#7 | |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 11 |
Quote:
Can you run me through your case, setup, BC etc. so I can get a better understanding of the scenario under which this error occurs. -B |
||
June 21, 2018, 17:34 |
|
#8 |
New Member
Edilberto
Join Date: Jun 2018
Posts: 8
Rep Power: 8 |
I am doing the same process as the one I did for erosion prediction using ansys default,,,, I modelled the pipe bend and mesh, then I stated inlet velocity for gas phase and k-e turbulence, calculate, after converging I activate the DPM where I state the sand properties (velocity, diameter, mass rate, etc) , then I click in run again in order to obtain the erosion rate... I tryed to complile the UDF but I got those lines ,,, then I click in injections and select UDF (erosion ) and run again.. then it crashes...
|
|
June 21, 2018, 17:37 |
|
#9 | |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 11 |
Quote:
Is your model steady state or transient. Also, is your particle tracking steady state or transient? -BB |
||
June 21, 2018, 17:39 |
|
#10 |
New Member
Edilberto
Join Date: Jun 2018
Posts: 8
Rep Power: 8 |
both steady state... I dont activate the multiphase function... Basically I solve the continous phase and then I "inject" the sand particles.
|
|
June 21, 2018, 17:42 |
|
#11 | |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 11 |
Quote:
I'm not sure you can run erosion without multiphase. It goes Multiphase model -> Discrete Phase (Where you will hook up your erosion UDF) -> Injections. -BB |
||
June 21, 2018, 17:42 |
|
#12 |
New Member
Edilberto
Join Date: Jun 2018
Posts: 8
Rep Power: 8 |
given that I did not find any tutorial (step by step) on how to get erosion prediction using ansys, I followed the steps stated in this website ..
https://www.ansys-blog.com/erosion-f...mics-modeling/ |
|
June 21, 2018, 17:53 |
|
#13 | |
Member
Bhargav Bharathan
Join Date: Jun 2015
Location: Montreal, Canada
Posts: 71
Rep Power: 11 |
Quote:
I've read that post as well and I've tried their steps, it doesn't work. ANSYS Fluent from my knowledge is a very fickle software. The way you setup is different for each case. I follow some steps which I deem as best practice for erosion simulations in Fluent: 1. Setup the entire case in transient first including multiphase, discrete phase, injections, erosion UDF compiling and hooking up and BC. 2. Go to General and turn steady state ON, delete your injections (its better to write it to a file before deleting) and turn OFF volume fraction under equations in solution controls. 3. Now run the case in steady state till convergence. (This is absolutely critical) Depending on the accuracy you are going for you may change the convergence residuals although smaller the better in this case. I suggest 1e-5 at least. 4. After steady state convergence -> turn ON transient, load your injections, turn ON volume fraction under equations. 5. Run in transient for the duration you wish. These steps work for me without fail, but my case is in transient. For steady state you may have to tweak a little bit. It is going to involve a lot of trial and errors. -BB |
||
June 21, 2018, 17:57 |
|
#14 |
New Member
Edilberto
Join Date: Jun 2018
Posts: 8
Rep Power: 8 |
I will try to do it tomorrow.. thank your for your support.. Im going to bed because im really tired (im in the UK) .. thank you again
|
|
January 2, 2019, 09:02 |
|
#15 | |
New Member
Bob Guo
Join Date: Feb 2016
Posts: 1
Rep Power: 0 |
Quote:
|
||
May 3, 2019, 08:51 |
could you help me
|
#16 |
New Member
James Thor
Join Date: May 2019
Posts: 13
Rep Power: 7 |
I'm sorry to bother you, but I'm also doing research on this, because I'm weak on programming. Could you please give me a relevant UDF erosion program for study?
|
|
May 3, 2019, 08:52 |
Please
|
#17 |
New Member
James Thor
Join Date: May 2019
Posts: 13
Rep Power: 7 |
I'm sorry to bother you, but I'm also doing research on this, because I'm weak on programming. Could you please give me a relevant UDF erosion program for study?
|
|
May 3, 2019, 08:54 |
Please
|
#18 | |
New Member
James Thor
Join Date: May 2019
Posts: 13
Rep Power: 7 |
Quote:
|
||
May 16, 2019, 11:58 |
|
#19 | |
New Member
James Thor
Join Date: May 2019
Posts: 13
Rep Power: 7 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
how can i use multiple udfs | hami9293 | Fluent UDF and Scheme Programming | 15 | May 27, 2020 20:25 |
Interpreting Multiple UDFs | Sarah.Tiani | Fluent UDF and Scheme Programming | 5 | January 18, 2013 05:52 |
OpenFOAM static build on Cray XT5 | asaijo | OpenFOAM Installation | 9 | April 6, 2011 13:21 |
Multiple UDFs | Graeme | FLUENT | 4 | August 28, 2004 16:47 |