|
[Sponsors] |
multiphase flow monitor the volume fraction by udf |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 17, 2017, 06:31 |
multiphase flow monitor the volume fraction by udf
|
#1 |
New Member
ChenChong
Join Date: Jul 2017
Posts: 7
Rep Power: 9 |
I simulated boiling process ,and I want to stop calculation when the vapor appear,the multiphase model is Mixture,primary phase is water,vapor is secondary。I made an udf,but it just fit for 2D geometry,if used in3D geometry,it would be error,I need some help,thank you!the udf wrote as follow:
#include "udf.h" # define domain_ID 3 real stop_coeff=1; real sum_vof=0.; real sum_volume=0.; DEFINE_ADJUST(stop_vof, domain) { Thread *t; cell_t c; face_t f; domain = Get_Domain(domain_ID); thread_loop_c (t,domain) { begin_c_loop (c,t) { sum_vof += C_VOF(c,t); } end_c_loop(c,t) } if(sum_vof >0) { real stop_coeff=1; } else { stop_coeff+=1; } thread_loop_c(t,domain) { begin_c_loop(c,t) { C_UDMI(c,t,0) = stop_coeff; C_UDMI(c,t,1) = C_P(c,t); C_UDMI(c,t,2) = C_VOF(c,t); } end_c_loop(c,t) } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiphase flow in a pipe with a CHT | wissal | CFX | 4 | June 12, 2017 13:15 |
alphaEqn.H in twoPhaseEulerFoam | cheng1988sjtu | OpenFOAM Bugs | 15 | May 1, 2016 17:12 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 07:20 |
Problem of simulating of small droplet with radius of 2mm | liguifan | OpenFOAM Running, Solving & CFD | 5 | June 3, 2014 03:53 |
dynamic Mesh is faster than MRF???? | sharonyue | OpenFOAM Running, Solving & CFD | 14 | August 26, 2013 08:47 |