|
[Sponsors] |
March 2, 2013, 20:26 |
UDF mass transfer
|
#1 |
Member
cfd^2
Join Date: Mar 2013
Posts: 31
Rep Power: 13 |
Hi everyone,
I've a question about interphase mass transfer in FLUENT using an Eulerian framework. I'm using Eulerian-Eulerian model, but I am planning to do some tests with mixture model and VOF model as well. I wrote a UDF to calculate the interphase flux as follows: DEFINE_MASS_TRANSFER(mass_source_0, cell, thread, from_index,from_species_index, to_index, to_species_index) { real m_lg_0; m_lg_0 = C_UDMI(cell, thread, 0); return (m_lg_0); } "C_UDMI(cell, thread, 0)" is provided by a DEFINE_ADJUST macro, i.e. applied to the whole multiphase domain (right?). My question is if it adequately represents the interphase exchange, or there is some additional requirement to be included in the code? Have anyone worked with this kind of modeling? Best Regards. Last edited by cfd^2; March 2, 2013 at 20:57. |
|
March 2, 2013, 21:36 |
|
#2 |
Member
cfd^2
Join Date: Mar 2013
Posts: 31
Rep Power: 13 |
I checked elsewhere that a guy recommended to use the following structure to "mark" the region of mass transfer, taking into account just the interface... It stands for something like this:
DEFINE_MASS_TRANSFER(mass_source_0, cell, thread, from_index,from_species_index, to_index, to_species_index) { real m_lg_0; if ((C_VOF(cell,thread) != 0) && (C_VOF(cell,thread) !=1)) { m_lg_0 = C_UDMI(cell, thread, 0); } return (m_lg_0); } I tried to run it, but FLUENT tells me that I got an ACCESS VIOLATION... Is this approach valid... if yes, could anyone tell me what is wrong (why I'm violating FLUENT access?)... Please, help me.... |
|
March 3, 2013, 06:15 |
|
#3 |
Senior Member
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 14 |
The problem is with C_UDMI. Where have you defined it?
|
|
March 3, 2013, 08:11 |
|
#4 |
Member
cfd^2
Join Date: Mar 2013
Posts: 31
Rep Power: 13 |
||
March 4, 2013, 00:54 |
|
#5 |
Senior Member
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 14 |
The whole UDF should be investigated.
|
|
May 23, 2013, 18:35 |
|
#6 |
Member
Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 86
Rep Power: 16 |
C_UDMI only works inside a cell loop I believe. You can try and see if that works out for you.
begin... C_UDMI(c,t,i); end_c_loop(c,t) |
|
May 24, 2013, 02:27 |
|
#7 |
Member
Shashank
Join Date: Apr 2011
Posts: 74
Rep Power: 14 |
The line marked in red in your post #2 does not necessarily define the interface.
Secondly, the "thread" here is a mixture thread and your VOF command cannot be passed over a mixture thread. You have to use a THREAD_SUB_THREADS function to locate the phase thread for which the VOF is being calculated. Also, I would advise you to share the adjust routine if you want folks to help you out here. |
|
May 28, 2013, 14:00 |
running in parallel mass_trasfer udf
|
#8 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 15 |
Hi
I have problem to run in parallel this code?It is simple C_UDMI which is calculated before: DEFINE_MASS_TRANSFER(water1,c,t,from_index, from_species_index, to_index, to_species_index) { #if !RP_HOST return(C_UDMI(c,t,10)); #endif } in serial it is ok but parallel giving me following error: warning C4716: 'water1' : must return a value. is there anyone had expericed before? Thanks in advance!!! |
|
May 28, 2013, 15:18 |
Phase thread
|
#9 |
Member
Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 86
Rep Power: 16 |
Shashank312 is spot on! You have to define the fluid interface correctly using VOF_G(radient) macro and also use the phase thread instead of the mixture thread.
@Kanarya I have used C_UDMI in parallel and did not get any errors. But to let you know, I ran in batch mode over a remote server using a pbs (batch job) file. Listing the pbs script file here, if it is of any use: ... #!/bin/bash #PBS -l nodes=2pn=1 module add fluent cd $PBS_O_WORKDIR cp /home/* . /cm/shared/apps/Fluent.Inc/bin/fluent 2d -t2 -g -ssh -mpi=hp -cnf=$PBS_NODEFILE -i file.jou ... The line starting with "cp" does the trick of copying all variables for parallel processing (Note the space between {*} and {.} at the end of the same line). Of course, you will have to use the -t2 in the last line for specifying the number of processors. |
|
May 28, 2013, 18:20 |
|
#10 |
Senior Member
Join Date: May 2011
Posts: 231
Rep Power: 15 |
Hi pranab_jha,
thanks for quick answer! OK! did you use #if !RP_HOST or #if !RP_NOPE? or you did not use any of them.. is it working without parallelising? Thanks again for the answer! #!/bin/bash #PBS -l nodes=2pn=1 module add fluent cd $PBS_O_WORKDIR cp /home/* . /cm/shared/apps/Fluent.Inc/bin/fluent 2d -t2 -g -ssh -mpi=hp -cnf=$PBS_NODEFILE -i file.jou ... The line starting with "cp" does the trick of copying all variables for parallel processing (Note the space between {*} and {.} at the end of the same line). Of course, you will have to use the -t2 in the last line for specifying the number of processors.[/QUOTE] |
|
May 29, 2013, 11:56 |
parallel consideration
|
#11 | |
Member
Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 86
Rep Power: 16 |
Quote:
I think the problem might be that you are trying to return a value from one of the nodes that does not generate the UDMI value. In serial, the value is being generated by THE only node. But not in parallel. I think you might try using !RP_NODE. That will ensure that only the host process is returning the data. Let us know if that works. I used the UDMI (a while back) in parallel, but used it regardless of the NODE or HOST. So, it gave me an output for each node. So, for example, for each time step, I had multiple values of either 0 or non-zero from each node. Later, I had to filter the values out in Matlab. You are doing it the right way! |
||
November 16, 2013, 13:13 |
|
#12 |
Member
mehdimoradi
Join Date: Jun 2013
Posts: 53
Rep Power: 12 |
I have a question about mass transfer in multiphase problems; we have used DEFINE-MASS TRANSFER macro for species transport from solid phase to gas phase as a udf, recently. I want to know this udf is updated in each iteration or not? if not what work must be done to do this? Tashakor Last edited by mehdimoradi.; November 24, 2013 at 00:46. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass transfer in ANSYS | thipps | ANSYS | 1 | August 29, 2013 12:05 |
Simulation with UDF for species mass fraction and velocity profile | virgy | Fluent UDF and Scheme Programming | 8 | February 7, 2012 05:30 |
Multiphase Multicomponent mass transfer -Initial condition | pannsave | CFX | 10 | February 9, 2011 02:12 |
Mass Transfer UDF using Fluent VOF | Anirudh_Deodhar | FLUENT | 0 | February 7, 2011 16:10 |
Help with mass transfer in heat and water vapor exchanger | mullenc525 | CFX | 7 | January 26, 2011 00:26 |