# UDF mass transfer

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 2, 2013, 20:26 UDF mass transfer #1 New Member   cfd^2 Join Date: Mar 2013 Posts: 24 Rep Power: 4 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 New Member   cfd^2 Join Date: Mar 2013 Posts: 24 Rep Power: 4 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: 227 Rep Power: 5 The problem is with C_UDMI. Where have you defined it?

March 3, 2013, 08:11
#4
New Member

cfd^2
Join Date: Mar 2013
Posts: 24
Rep Power: 4
Quote:
 Originally Posted by msaeedsadeghi The problem is with C_UDMI. Where have you defined it?
In a DEFINE_ADJUSt macro that is compiled along with the DEFINE_MASS_TRANSFER one.

 March 4, 2013, 00:54 #5 Senior Member   SSL Join Date: Oct 2012 Posts: 227 Rep Power: 5 The whole UDF should be investigated.

 May 23, 2013, 17:35 #6 Member     Pranab N Jha Join Date: Nov 2009 Location: Houston, TX Posts: 83 Rep Power: 7 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 28, 2013, 13:00 running in parallel mass_trasfer udf #8 Senior Member   rkhr Join Date: May 2011 Posts: 222 Rep Power: 7 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, 14:18 Phase thread #9 Member     Pranab N Jha Join Date: Nov 2009 Location: Houston, TX Posts: 83 Rep Power: 7 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, 17:20 #10 Senior Member   rkhr Join Date: May 2011 Posts: 222 Rep Power: 7 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, 10:56
parallel consideration
#11
Member

Pranab N Jha
Join Date: Nov 2009
Location: Houston, TX
Posts: 83
Rep Power: 7
Quote:
 Originally Posted by Kanarya 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!
[/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

Join Date: Jun 2013
Posts: 50
Rep Power: 4
Quote:
 Originally Posted by msaeedsadeghi The problem is with C_UDMI. Where have you defined it?

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 Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post thipps ANSYS 1 August 29, 2013 11:05 virgy Fluent UDF and Scheme Programming 8 February 7, 2012 05:30 pannsave CFX 10 February 9, 2011 02:12 Anirudh_Deodhar FLUENT 0 February 7, 2011 16:10 mullenc525 CFX 7 January 26, 2011 00:26

All times are GMT -4. The time now is 05:50.