CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   define mass transfer - define source (https://www.cfd-online.com/Forums/fluent/42265-define-mass-transfer-define-source.html)

greg September 8, 2006 11:27

define mass transfer - define source
 
hi I have a probblem with boiling (defined by DEFINE_MASS_TRANSFER or DEFINE_SOURCE) using standard (provided by Fluent) tutorials - means udf`s from I can get boiling of water (both in VOF and Mixture model) but.... the temperatures are stupid. In liquid pase temperature is OK but in gas phase it reach maximum or minimum temperature (from temp. on beginning = 350K to 1K or 5000K which are max and min. temperatures in FLUENT). Do you happen to know what to do? Meybe you had the same problem. regards g

gaza July 14, 2016 12:48

FLUENT will automatically include the terms needed to model mass transfer in all relevant conservation equations. Another option to model mass transfer between phases is through the use of user-defined sources and their inclusion in the relevant conservation equations. This approach is a more involved but more powerful, allowing you to split the source terms according to a model of your choice.

FLUENT
provides a DEFINE_MASS_TRANSFER that you can use to input models for different types of mass transfer, e.g. evaporation, condensation, boiling, etc. Note that when using this UDF, FLUENT will automatically add the source contribution to all relevant momentum and scalar equations. This contribution is based on the assumption that the mass "created'' or "destroyed'' will have the same momentum and energy of the phase from which it was created or destroyed.

If you would like to input your source terms directly into mass, momentum, energy, or scalar equations, then the appropriate path is to use UDFs for user-defined sources for all equations, rather than the UDF for mass transfer.

vidyadhar November 14, 2018 01:45

Quote:

Originally Posted by gaza (Post 609494)
FLUENT will automatically include the terms needed to model mass transfer in all relevant conservation equations. Another option to model mass transfer between phases is through the use of user-defined sources and their inclusion in the relevant conservation equations. This approach is a more involved but more powerful, allowing you to split the source terms according to a model of your choice.

FLUENT
provides a DEFINE_MASS_TRANSFER that you can use to input models for different types of mass transfer, e.g. evaporation, condensation, boiling, etc. Note that when using this UDF, FLUENT will automatically add the source contribution to all relevant momentum and scalar equations. This contribution is based on the assumption that the mass "created'' or "destroyed'' will have the same momentum and energy of the phase from which it was created or destroyed.

If you would like to input your source terms directly into mass, momentum, energy, or scalar equations, then the appropriate path is to use UDFs for user-defined sources for all equations, rather than the UDF for mass transfer.


Dear pblasiak,


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

When I press the "Run Calculate ----> calculate" button, after interpretation and initialization, I am facing this problem-

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

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);
}




Thanks in advance!

gaza November 14, 2018 04:33

maybe try compilation instead interpretation?

vidyadhar November 24, 2018 06:34

Quote:

Originally Posted by gaza (Post 715299)
maybe try compilation instead interpretation?

Hello Przemek,
Thanks for your reply.


Even after compilation, I am facing the same Segmentation Fault. I think I have done a mistake in the UDF.
Instead of assigning UDMI at cells next to 'meniscus' which is an interior zone, now I am using the macro sub_domain_loop to apply source term at UDM which is defined at locations where C_VOF is neither zero nor one.


Thanks & Regards,
vidyadhar


All times are GMT -4. The time now is 00:34.