mass transfer udf not working
1 Attachment(s)
I'm simulating a mass transfer udf, mass transfer from 'water' to the 'oil' phase at an interface between these 2 phases. but my udf's inequality condition is not working.
my udf: Code:
#include "udf.h" I tried displaying the contour for a custom function: (C_VOF(cell,water)*C_VOF(cell,oil) ) Attachment 79321 But the mass transfer in zero. |
your UDF seems to be correct,
are you sure, I've hooked UDF properly? from manual Code:
In order to hook a DEFINE_MASS_TRANSFER UDF to Fluent, you must first issue the TUI command solve/set/expert and enter no at the LinearizedMass Transfer UDF? prompt. |
UDF works for code without inequality condition.
Quote:
It will just not be working as per my requirements, the mass transfer occurs through whole of the water phase rather than happening at the interface between the oil and water phase. |
Some modifications in UDF.
Quote:
Quote:
The UDF below works and prints the first statement 'hello_fluent 1' but does not print the other statement which is inside the loop. Code:
#include "udf.h" |
it means, that your condition is not true in the whole domain.
1. you may decrease criteria values 2. may be the problem is your mesh, which could be too course (elements are too huge) C_VOF macro gets value from the center of cell (not from the nodes) so you may try to refine the mesh |
changing the mesh does no help
1 Attachment(s)
Quote:
Attachment 79350 The model is 3 phase model, there is a 3rd phase as well. Is this not working because of that? |
segmentation fault
Quote:
1. This does not happen without UDF. 2. The residual plot is well within 1e-02 for all scalars. Why is this happening? I am running the setup in serial mode. The CPU meter for RAM is also within 40% usage at the time I start. |
unfortunately, I have very little experience in multiphase simulations
if you have 3 phases it could be an issue, try following code to check fileds of concentrations distribution: dont forget to allocate 3 UDMI variables in fluent gui Code:
#include "udf.h" I expect C_UDMI(c,t,0) should give you same distribution as (C_VOF(cell,water)*C_VOF(cell,oil) ) if yes, add your condition in this code, modify variables and try to run it. |
All shows zero value.
Quote:
1) All the 3 UDMI's are showing 0 in the value. 2) I want to know how will the UDMI save the values, will it not update for every node? Like some nodes, the UDMI's will be zero and for some others, it may be non zero, but it will only show the last updated value. 3) In such a case should I not export an array for the values of these UDMI's? 4) If so, then how may I construct an array inside the UDF and saw the values of the UDMI inside the array so that I can later see it! |
UDMIs are variables which store values of defined variable in the whole domain for one time moment (last one)
for instance it is temperature, which could be different along the domain to store data for different timesteps you may define monitors and write information to file, or you can write data files and extract information from there for more information read Ansys Fluent Customization manual |
Quote:
|
it should be same with C_vof(cell, water)*C_vof(cell, oil)
|
3 Attachment(s)
Quote:
C_vof(cell, water)*C_vof(cell, oil) : Attachment 79371 Attachment 79372 UDMI : Attachment 79373 The UDF which I'm using: Code:
#include "udf.h" |
All times are GMT -4. The time now is 10:06. |