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

How to run my udf about the transient part?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 10, 2021, 23:27
Default How to run my udf about the transient part?
  #1
New Member
 
WANG LU
Join Date: Sep 2019
Posts: 22
Rep Power: 3
smilingwl is on a distinguished road
Hello everyone,
Nowadays I compile an udf about the change of the water latent thermal ,which I compiled successfully. But when I run the case, it showed "Node 27: Process 25448: Received signal SIGSEGV." I have no idea about what's wrong. I hope I can get help from you. The code as follow:
#include "udf.h"
#include "sg_mphase.h"
#include "mem.h"

#define L 2340000.0

DEFINE_SOURCE(energy_source,c,t,dS,eqn)
{
Thread *m_t,*v_t;
m_t=THREAD_SUPER_THREAD(t);
v_t=THREAD_SUB_THREAD(m_t,1);

real a;
real rho_mixture,rho_mixture_last;
real fv,fv_last;
real delta;
rho_mixture=C_R(c,m_t);
rho_mixture_last=C_R_M1(c,m_t);
fv=C_VOF(c,v_t)*C_R(c,v_t)/rho_mixture;
fv_last=C_VOF_M1(c,v_t)*C_R_M1(c,v_t)/rho_mixture_last;
delta = RP_Get_Real("physical-time-step");
a=(rho_mixture_last*fv_last*L-rho_mixture*fv*L)/delta;
dS[eqn]=0.0;
return a;
}
Thanks for your help!
Best wish!
smilingwl is offline   Reply With Quote

Old   June 11, 2021, 03:22
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 1,723
Rep Power: 28
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
as far as I understand, you are using macros to get value from previous timestep:
C_R_M1
C_VOF_M1
others.

on the initial time step these values are not specified.
__________________
best regards


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

Old   June 11, 2021, 22:44
Thumbs up
  #3
New Member
 
WANG LU
Join Date: Sep 2019
Posts: 22
Rep Power: 3
smilingwl is on a distinguished road
Thank you so much!
I think you are right.So,how can I fix the problem?
Best wish!
smilingwl is offline   Reply With Quote

Reply

Tags
udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Transient simulations: how to tell its converged (I've read the FAQ & user guides!) JuPa CFX 12 March 27, 2020 17:24
UDF for transient conduction. Ravindra123 Fluent UDF and Scheme Programming 2 October 20, 2013 09:45
execute udf in ss & transient simulation hosseinhgf FLUENT 0 December 1, 2010 08:41
parse error in transient udf spring FLUENT 1 July 6, 2010 06:26
CFL criterion in transient run prabhu CFX 2 July 5, 2007 17:30


All times are GMT -4. The time now is 01:02.