|
[Sponsors] |
July 13, 2015, 18:34 |
Mass source UDF in 2D axisymmetric domain
|
#1 |
New Member
Michael
Join Date: May 2014
Posts: 2
Rep Power: 0 |
Hello all,
I want to set up a UDF mass source term that calculates a mass sink for every cell in my domain depending on the varying mass fraction of a certain species (water) in every cell. The species should be reduced by a constant rate of 0.0002 per second. My domain is 2D axisymmetric and I run transient solver. Here what I came up with so far: DEFINE_SOURCE(sink,c,t,dS,eqn) { real sink; if(C_YI(c,t,0)>0) { /* sink term definition: (mass fraction) x (density) x (sink constant rate) (kg/m3 s)*/ sink=-(C_YI(c,t,0)*(998.2)*(0.0002)); /* derivative of sink term */ dS[eqn] = 0; } else sink = dS[eqn] = 0; return sink; The UDF is running perfectly fine showing reduction in the species in the domain but I am getting results that are off by some factors from what I expected. I feel like I made a mistake setting up the sink term but I cant figure out what it is. I thought I might have to implement a loop over every cell but I'm not sure. Thanks in advance for any help. Michael |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
Issues with mass source macros in a multiphase system | cp703 | Fluent UDF and Scheme Programming | 6 | October 17, 2015 01:59 |
Mass source term definition in UDF for an axisymmetric problem | adnanakhtar | Fluent UDF and Scheme Programming | 0 | February 19, 2015 19:18 |
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error | FerdiFuchs | OpenFOAM Community Contributions | 27 | April 16, 2014 16:14 |
I need UDF help. | S.Whitney | FLUENT | 0 | October 15, 2007 12:29 |