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

UDF not running. Problem known but I can't solve it

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By AlexanderZ

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 5, 2020, 11:05
Default UDF not running. Problem known but I can't solve it
  #1
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 5
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
Hi,
How can I adress the input arguments for c_vol? I need a cell value in my f_loop, but i don't know how to get the value. It would be enough to know the volume off the cell which belongs with one face to the boundary that I want to specify by define_profile. Any help would be great. Is the a solution to adress with pointers the cell of the face in normal direction maybe? Without the c_vol the code works great.

DEFINE_PROFILE(massfraction_for_const_RH,thread,po sition)
{
cell_t cell;
face_t f;
double a= -5800.2206;
double T,massfraction_new;
double p_sat, c_vol;

begin_f_loop(f,thread)
{

T=F_T(f,thread);

c_vol = C_VOLUME(cell, thread);

p_sat= exp(a*pow(T,-1));
massfraction_new=0.7*p_sat/c_vol;
F_PROFILE(f,thread,position)=massfraction_new;

}
end_f_loop(f,thread)
}

Last edited by schwaral; August 5, 2020 at 18:20.
schwaral is offline   Reply With Quote

Old   August 6, 2020, 04:03
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
try this code, compile it
Code:
DEFINE_PROFILE(massfraction_for_const_RH,t,i)
{
cell_t c,c0;
face_t f;
Thread *t0;
real a= -5800.2206;
real T,massfraction_new;
real p_sat, c_vol;

begin_f_loop(f,t)
{

T=F_T(f,t);
c0 = F_C0(f,t);
t0 = F_C0_THREAD(f,t);
c_vol = C_VOLUME(c0, t0); /*get volume of cell adjusted to face */
p_sat= exp(a*pow(T,-1));
massfraction_new=0.7*p_sat/c_vol;
F_PROFILE(f,t,i)=massfraction_new;

}
end_f_loop(f,t)
}
snow.shaoy likes this.
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   August 6, 2020, 06:06
Default
  #3
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 5
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
Thanks a lot AlexanderZ for the reply!

Unfortunately this does not work. The Error is: structure reference not implemented

in the following line: t0 = F_C0_THREAD(f,t);

I like your idea using the Connectivity Variables. Somehow I can't find a post where someone used DEFINE_PROFILE in combination with a cell_value of the boundary cells one tries to modify.

best regards,
Alex

Last edited by schwaral; August 6, 2020 at 07:34.
schwaral is offline   Reply With Quote

Old   August 13, 2020, 09:31
Default
  #4
Member
 
Deutschland
Join Date: Jun 2020
Location: https://t.me/pump_upp
Posts: 43
Rep Power: 5
schwaral is on a distinguished road
Send a message via ICQ to schwaral Send a message via AIM to schwaral Send a message via Yahoo to schwaral
I am very sorry for my previous answer. Your solutioon works perfect. I did not read, that you have to compile it. Instead i tried with interpreting.

Thanks again!
schwaral is offline   Reply With Quote

Reply

Tags
cell value, define profile, loop, udf


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
UDF problem for Population balance model Amir.11 Fluent UDF and Scheme Programming 6 May 30, 2022 04:36
Problem with running UDF of linux Tomsho Fluent UDF and Scheme Programming 2 June 12, 2019 12:59
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 00:53
Can I use UDF function to solve this problem? bright181 Fluent UDF and Scheme Programming 3 December 10, 2010 04:46
Can I solve this problem by Fluent? Kai_kc FLUENT 1 October 27, 2010 05:29


All times are GMT -4. The time now is 19:52.