|
[Sponsors] |
December 21, 2018, 06:00 |
Set the inlet mass flow like an outlet
|
#1 |
New Member
Join Date: Nov 2018
Posts: 3
Rep Power: 8 |
Hello I want to set a mass-flow outlet like the value from another boundary in my simulation. The source code worked well with a single phase flow, but if I use multiphase the mass flow is not like the value of the other face (reports say so). What can be the problem?
#include "udf.h" int zone_ID = 4; real my_mass_flow = 0.0; /* initial value 0 m/s */ DEFINE_ADJUST(get_my_mass_flow,domain) { #if !RP_HOST Thread *t = Lookup_Thread(domain,zone_ID); Domain *sub_domain; face_t f; real sum = 0.0; my_mass_flow = 0.0; int phase_domain; sub_domain_loop(sub_domain, domain, phase_domain) { thread_loop_f(t, subdomain) { if (DOMAIN_ID(sub_domain) == 3) { /* Compute Mass Flow at Outlet1 */ begin_f_loop(f, t) { my_mass_flow += F_FLUX(f, t); } end_f_loop(f, t) } } } #endif my_mass_flow = PRF_GRSUM1(my_mass_flow); node_to_host_real_1(my_mass_flow); } DEFINE_PROFILE(apply_my_mass_flow,t,i) { face_t f; begin_f_loop(f,t) { F_PROFILE(f,t,i) = my_mass_flow; } end_f_loop(f,t); } DEFINE_ON_DEMAND(print_my_mass_flow) { #if !RP_NODE Message("My Mass Flow = %.5e\n",my_mass_flow); #endif } DEFINE_EXECUTE_AT_END(my_exec_at_end) { print_my_mass_flow(); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Discrete Phase Model, outlet mass flow rate does not fit | edu_aero | FLUENT | 29 | February 3, 2020 09:38 |
mass flow inlet and pressure outlet with target mass flow rate | Zigainer | FLUENT | 13 | October 26, 2018 06:58 |
mass flow in is not equal to mass flow out | saii | CFX | 12 | March 19, 2018 06:21 |
Multiphase flow - incorrect velocity on inlet | Mike_Tom | CFX | 6 | September 29, 2016 02:27 |
Mass flow inlet and pressure outlet BC in star-cd? | sreenivas | Siemens | 4 | February 22, 2008 02:52 |