|
[Sponsors] |
May 19, 2016, 07:31 |
UDF for calculate total mass in the model
|
#1 |
New Member
Bramantyo
Join Date: May 2016
Location: Java
Posts: 11
Rep Power: 10 |
Hello there
I'm having trouble: how to calculate the total mass of fluid in the model using UDF, at every time step? My simulation is transient, with 1 inlet and 1 outlet. I know that there's a feature in FLUENT (volume integral) option that can measure it easily, but I do need to create it via UDF for iteration purpose Thanks, any help would be very helpful |
|
May 19, 2016, 07:43 |
|
#2 | |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
Quote:
This is a on demand macro, but you can change it accordingly to your purpose. DEFINE_ON_DEMAND(mass) { Domain *domain; Thread *ct; cell_t c; domain = Get_Domain(1); double mass; thread_loop_c(ct, domain) { begin_c_loop(c,ct) { mass += C_R(c,ct) * C_VOLUME(c,ct); } end_c_loop(c,ct) } } |
||
May 19, 2016, 13:58 |
|
#3 |
New Member
Bramantyo
Join Date: May 2016
Location: Java
Posts: 11
Rep Power: 10 |
Thank you Bruno!
I modified it to Define_Execute_At_End, and it works well, calculate the total mass in the model But now, I have to calculate the mass of specific phase onl. Since my simulation is consisted of many phases. What is the additional syntax to get total mass of 1 phase only, not all of phases? Thank you |
|
Tags |
mass, total mass, transient, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF to obtain total mass of species | Michael.Z | Fluent UDF and Scheme Programming | 0 | July 21, 2015 22:15 |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 06:36 |
Overflow Error in Multiphase Modelling with Two Continuous Fluids | ashtonJ | CFX | 6 | August 11, 2014 15:32 |
total mass loss/gain--simulating taylor couette flow | nwpukaka | OpenFOAM Programming & Development | 0 | February 12, 2014 19:57 |
UDF for linear PTT model implementation | dpitz | Fluent UDF and Scheme Programming | 1 | February 4, 2011 11:08 |