|
[Sponsors] |
UDF to modify the value of a user defined scalar |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 11, 2000, 17:07 |
UDF to modify the value of a user defined scalar
|
#1 |
Guest
Posts: n/a
|
Hi, I have a two-phase flow between two parallel plates. I am using VOF model to simulate the flow. I have introduced a user defined scalar and trying to assign a value to the scalar at the interface. I am finding the interface by determining the cells which have the liquid volume fraction between 0 and 1. I am using DEFINE_ADJUST macro as I want it to be done every iteration. But it is not assigning the scalar value at the interface. I am provding here the code which I have written:
#include "udf.h" #include "sg_mphase.h" DEFINE_ADJUST(vol_frac_find, domain) { Thread *t=Lookup_Thread(domain,8); cell_t c; begin_c_loop(c,t) { if(C_VOF(c,t,1)>0. && C_VOF(c,t,1)<1.) C_UDSI(c,t,0)=0.0228; } end_c_loop(c,t); } I would appreciate, if someone can point out my mistake. The id that I have used in the Lookup_Thread function corresponds to the zone- default-interior in the boundary conditions dialog-box. Thanks Raja Banerjee |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Change user defined scalar flux function | Kaazem_RA | Fluent UDF and Scheme Programming | 0 | February 15, 2019 08:01 |
Division by zero exception - loop over scalarField | Pat84 | OpenFOAM Programming & Development | 6 | February 18, 2017 05:57 |
User Defined Scalar Flux | SandilyaCFD | OpenFOAM Running, Solving & CFD | 0 | February 15, 2017 15:08 |
is internalField(U) equivalent to zeroGradient? | immortality | OpenFOAM Running, Solving & CFD | 7 | March 29, 2013 01:27 |
User Defined Scalar (UDS) question (units) | D | FLUENT | 0 | March 1, 2006 20:04 |