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

define_profile and F_UDMI

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 14, 2015, 11:02
Default define_profile and F_UDMI
  #1
Member
 
Join Date: Jan 2015
Posts: 40
Rep Power: 11
philus is on a distinguished road
Hi all,

I am trying to set a particular wall heat transfer coefficient to an external wall. I also wanted to monitor the value computed by my UDF, then I used the user-defined memory. But the correspondent variable (when I search for it in FLuent) is always zero. Note that if I write in the UDF printf('variable name') I get the good values....but I need to put these values into a variable!

I copy paste the simplified UDF:

Code:
DEFINE_PROFILE(name,t,i)
{
  real h;
  begin_f_loop(f,t){
    h=10.0;
    F_UDMI(f,t,0) = h;
    printf("h:%f\n",h);
    F_PROFILE(f,t,i)= h;
  }
  end_f_loop(f,t)
}
I have the impression that the UDF works well for setting the boundary condition (the results that I obtain from the simulation corresponds to what I was expecting), but I cannot monitor the variable (h) that I have created: the corresponding User Defined Memory variable (User Memory 0) is always nil.

Can someone explain me what is the problem?

Thanks in advance
philus
philus is offline   Reply With Quote

Old   April 14, 2015, 11:57
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
I have seen this behavior too. The UDM stored with F_UDMI did not show up in my Fluent results. I don't know if this is intended or a bug, but I found a workaround that worked for me:
Code:
F_UDMI(f,t,0) = h;
C_UDMI(F_C0(f,t),THREAD_T0(t),0) = F_UDMI(f,t,0);
hos128 likes this.
pakk is offline   Reply With Quote

Old   April 15, 2015, 05:56
Default
  #3
Member
 
Join Date: Jan 2015
Posts: 40
Rep Power: 11
philus is on a distinguished road
Hi pakk,

effectively this workaround works well, thank you!!

philus
philus is offline   Reply With Quote

Old   November 5, 2023, 08:46
Default
  #4
New Member
 
anonymous96
Join Date: Nov 2022
Posts: 17
Rep Power: 4
anonymous96_ is on a distinguished road
Hi Pakk

I am trying to calculate volumetric flow rate through an interior surface and using DEFINE_ON_DEMAND macro for the same. A piece of my code is as follows:
DEFINE_ON_DEMAND(ach_udf)
{

Thread *t;
face_t f;

Domain *d;


real A[ND_ND];

real ACHt_mean_out=0;
real ACHt_mean_in=0;

t = Lookup_Thread(d,2);

begin_f_loop(f,t)
{
F_AREA(A,f,t);
real vel_roof= F_FLUX(f,t)/(NV_MAG(A)*1.12);
if (vel_roof>0)
{
ACHt_mean_out += vel_roof*NV_MAG(A);
}
else
{
ACHt_mean_in +=vel_roof*NV_MAG(A);
}
}
end_f_loop(f,t)


}

The code is compiled successfully but as soon as I am executing it using EXECUTE_ON_DEMAND, it is giving the following error:
Node 1: Process 20248: Received signal SIGSEGV.

================================================== ============================

================================================== ============================

Node 999999: Process 6872: Received signal SIGSEGV.

================================================== ============================

================================================== =================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= RANK 2 PID 4296 RUNNING AT DESKTOP-PA0EM1I
= EXIT STATUS: -1 (ffffffff)

Can anyone tell how to fix this?
anonymous96_ is offline   Reply With Quote

Old   November 6, 2023, 05:31
Default
  #5
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
d is not defined

compile code and READ log to avoid typoes
__________________
best regards


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

Old   November 6, 2023, 06:11
Default
  #6
New Member
 
anonymous96
Join Date: Nov 2022
Posts: 17
Rep Power: 4
anonymous96_ is on a distinguished road
Thankyou Alexander. If figured that out but I am getting stuck at one more point. I have posted in another thread and you are a part of it too. Can you please look into it.
anonymous96_ is offline   Reply With Quote

Old   November 6, 2023, 06:16
Default
  #7
New Member
 
anonymous96
Join Date: Nov 2022
Posts: 17
Rep Power: 4
anonymous96_ is on a distinguished road
UDF - C_UDMI is giving sigsegv error

Can you please look into it Alexander?
anonymous96_ is offline   Reply With Quote

Reply


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



All times are GMT -4. The time now is 15:17.