CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Question about C_UDMI use

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By NPat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 17, 2013, 18:09
Smile Question about C_UDMI use
  #1
New Member
 
Join Date: Sep 2012
Posts: 11
Rep Power: 14
NPat is on a distinguished road
Hi friends,

I've had some questions about the use of C_UDMI for UDF coding. I've tried to interpret the following codes in FLUENT (two separate files):

#include "udf.h"

DEFINE_ADJUST(teste, domain)
{
Thread *t;
cell_t c;

thread_loop_c(t, domain)
{
begin_c_loop_all(c, t)
{
C_UDMI(c,t,0) = 1.;
}
end_c_loop_all(c, t)
}
}


#include "udf.h"

DEFINE_MASS_TRANSFER(mass_exchange_3, cell, thread, from_index,from_species_index, to_index, to_species_index)
{
real m_lg;
m_lg = C_UDMI(cell, thread, 0);
return (m_lg);
}

I don't have any problem interpreting this functions, but when I ran it in FLUENT I checked the mass transfer rate and I got 0.0. Moreover, in post processing the value of C_UDMI is also 0.0. There is any problem whith these codes?

Please, help me with this issue...
djn likes this.
NPat is offline   Reply With Quote

Old   February 17, 2013, 19:10
Smile
  #2
New Member
 
Join Date: Sep 2012
Posts: 11
Rep Power: 14
NPat is on a distinguished road
Friends,

I already solved this problem. Thank you!

Regards,
Natan
NPat is offline   Reply With Quote

Old   November 14, 2018, 02:30
Default received a fatal signal - during calculation of evaporation using UDF
  #3
Senior Member
 
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10
vidyadhar is on a distinguished road
Hello Natan,


I am also working on evaporation of a liquid using VOF method.
I have written the following UDF (single file) for simulating mass transfer.

After interpretation and initialization, I am facing this problem-

Error: received a fatal signal (Segmentation fault). Error Object: #f

when I press the "Run Calculate ----> calculate" button:




-------------------------------------------------

I request you to help me what is wrong in the UDF.


#include "udf.h"
#include "sg_mphase.h"
#define T_SAT 343
#define LAT_HT 339.8e3
#define CON 3.2

DEFINE_ADJUST(my_adjust,d)
{
real source;
Thread *t0;
face_t f;
cell_t c0;
int ID=3; /* 3 IS THE ZONE ID FOR MENISCUS AS SEEN IN BOUNDARY CONDITIONS PANEL*/
/*BELOW MENTIONED IS THE POINTER FOR DOMAIN OF PHASE*/
Domain *domain = Get_Domain (3); /*CHECK WHETHER I HAVE TO SPECIFY 1-MIXTURE OR 2-PRIMARY PHASE OR 3-SECONDARY PHASE.*/
Thread *thread = Lookup_Thread(domain,ID);
begin_f_loop(f,thread)
{
/*TO SELECT ONE LAYER OF CELLS ADJACENT TO MENISCUS*/
c0 = F_C0(f,thread); /*See ADJACENT CELL INDEX*/
t0 = THREAD_T0(thread); /*See ADJACENT CELL THREAD*/
source= 0.002; /*MENTION SOURCE HERE*/;
if(C_T(c0,thread) >= T_SAT)
{
C_UDMI(c0,t0,0)=source;
}
}
end_f_loop(f,thread) /*the semicolon should be present or not check*/
}

DEFINE_MASS_TRANSFER(liq_gas_source,cell,mix_th,fr om_index,from_species_index,to_index,to_species_in dex)
{
real m_lg=0;
Thread *liq=THREAD_SUB_THREAD(mix_th,from_index);
Thread *gas=THREAD_SUB_THREAD(mix_th,to_index);
m_lg=C_UDMI(cell,liq,0);
return (m_lg);
}



--------------------------------------------



Quote:
Originally Posted by NPat View Post
Hi friends,

I've had some questions about the use of C_UDMI for UDF coding. I've tried to interpret the following codes in FLUENT (two separate files):

#include "udf.h"

DEFINE_ADJUST(teste, domain)
{
Thread *t;
cell_t c;

thread_loop_c(t, domain)
{
begin_c_loop_all(c, t)
{
C_UDMI(c,t,0) = 1.;
}
end_c_loop_all(c, t)
}
}


#include "udf.h"

DEFINE_MASS_TRANSFER(mass_exchange_3, cell, thread, from_index,from_species_index, to_index, to_species_index)
{
real m_lg;
m_lg = C_UDMI(cell, thread, 0);
return (m_lg);
}

I don't have any problem interpreting this functions, but when I ran it in FLUENT I checked the mass transfer rate and I got 0.0. Moreover, in post processing the value of C_UDMI is also 0.0. There is any problem whith these codes?

Please, help me with this issue...
vidyadhar is offline   Reply With Quote

Old   November 14, 2018, 23:54
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
did you set correct number of UDMs in FLuent GUI, which you are using in code?
user-defined -> memory -> UDM Locations switch to 1

best regards
AlexanderZ is offline   Reply With Quote

Old   November 15, 2018, 00:03
Default
  #5
Senior Member
 
vidyadhar
Join Date: Jul 2016
Posts: 138
Rep Power: 10
vidyadhar is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
did you set correct number of UDMs in FLuent GUI, which you are using in code?
user-defined -> memory -> UDM Locations switch to 1

best regards

Thanks for the reply.


Yes, I have swithced UDM locations to 1.
Even then, I am facing the problem:

Error: received a fatal signal (Segmentation fault). Error Object: #f



I wanted to apply the source terms on one layer of cells adjacent to "meniscus" boundary zone (with Zone ID=3) in the liquid phase domain(Domain ID=3).


May I request you to correct me if I have done any mistake in the UDF.

Is there any mistake in the "loop" of the code?
Is placing C_UDMI under DEFINE_ADJUST and using it in DEFINE_MASS_TRANSFER works?


Thanks in advance!
Vidyadhar
vidyadhar is offline   Reply With Quote

Reply

Tags
fluent, mass transfer, udf, udmi


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question Re Engineering Data Source imnull ANSYS 0 March 5, 2012 14:51
internal field question - PitzDaily Case atareen64 OpenFOAM Running, Solving & CFD 2 January 26, 2011 16:26
question on bounday layer modeling Wen Long Main CFD Forum 2 November 12, 2005 18:29
Poisson Solver question Suresh Main CFD Forum 3 August 12, 2005 05:37
Philosophical CFD question Richard Howe Main CFD Forum 14 June 17, 2001 15:41


All times are GMT -4. The time now is 04:28.