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

Volumetric flow rate UDF

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 8, 2015, 11:09
Default
  #21
New Member
 
mostafa
Join Date: Jun 2013
Posts: 22
Rep Power: 13
mostafa_zeynalabedini is on a distinguished road
hi every body
I have a problem with interpreting this UDF:
******************
#include "udf.h"
DEFINE_PB_NUCLEATION_RATE(nuc, cell, thread)
{
#if !RP_NODE
if ((C_VOF(cell,thread) > 0.05))
{
C_UDSI(cell,thread,0)=C_VOF(cell,thread);
.
.
.
return (.....);
#endif
}

*****************
the error is:
Error: C:/Users/.... : line xx: label "store_vof_norm" not found (pc=74).
please help me to solve this problem.:c onfused:
mostafa_zeynalabedini is offline   Reply With Quote

Old   April 8, 2015, 19:51
Default
  #22
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Try compiling the UDF instead of interpreting (some functions and macros require compiling rather than interpreting). If that fails, show us the entire UDF and error because where is it trying to access "store_vof_norm"?
`e` is offline   Reply With Quote

Old   April 14, 2015, 04:46
Default
  #23
New Member
 
mostafa
Join Date: Jun 2013
Posts: 22
Rep Power: 13
mostafa_zeynalabedini is on a distinguished road
hi harry
sorry that I was absent for some months, because I had an car accident.
I found out the answer. the problem was from parallelization. when we use parallel run, some faces of some cells stored in another core of cpu and this make some problem. there is a remedy in ANSYS FLUENT Documentation named "parallel consideration". check that, it is very useful.
mostafa_zeynalabedini is offline   Reply With Quote

Old   April 14, 2015, 04:55
Default
  #24
New Member
 
mostafa
Join Date: Jun 2013
Posts: 22
Rep Power: 13
mostafa_zeynalabedini is on a distinguished road
Mr. 'e'
I'm modeling a three-phase problem with Eulerian (+Multi fluid VOF model) model. I also use Population balance model. I want to use a UDF for nucleation rate for third phase (second secondary phase). bellow are some part of this UDF:

#include "udf.h"
#include "sg_pb.h"
#include "sg_mphase.h"
DEFINE_PB_NUCLEATION_RATE(nuc, cell, thread)
{
real Epsilon_Entrainment;
real Vof_CutOff;
int phase1_domain_index = 0;
int phase2_domain_index = 1;
Thread *mixture_thread = THREAD_SUPER_THREAD(thread);
Thread *ContinuousPhaseThread = THREAD_SUB_THREAD(mixture_thread,phase1_domain_ind ex);
Thread *LargeBubbles = THREAD_SUB_THREAD(mixture_thread,phase2_domain_ind ex);
Vof_CutOff= C_VOF(cell, LargeBubbles);
if (C_U(cell,LargeBubbles) > 8)
{
Epsilon_Entrainment = 100000;
}
return (Epsilon_Entrainment);
}

But when I interpret this UDF, I encounter this error:
Error: D:\\xxx: line 20: label "store_vof_norm" not found (pc=74).

this UDF has 19 lines. this error refers to line 20.I found that this error is from sg_mphase.h file. In this file there is "store_vof_norm", But I don't know what is the problem????
mostafa_zeynalabedini is offline   Reply With Quote

Old   April 14, 2015, 07:41
Default
  #25
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
??? You say at 09:46 that you have the answer, and on 09:55 you ask exactly the same question as if you don't have the answer... ???

I would say that `e`'s comment from 9 april is still something you should do.
pakk is offline   Reply With Quote

Old   April 14, 2015, 10:16
Default
  #26
New Member
 
mostafa
Join Date: Jun 2013
Posts: 22
Rep Power: 13
mostafa_zeynalabedini is on a distinguished road
no these two posts are for two different question.
I found the answer of the question that was asked some month ago and I discussed that with harry. and finally found the answer and wants to announce him in post number #23.
but post numbers #21, #22 and #24 are about another question. I compiled my UDF as 'e' said, but the problem does not solved.
mostafa_zeynalabedini is offline   Reply With Quote

Old   April 14, 2015, 10:30
Default
  #27
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Ok I see now that it was two questions.

You say that compiling did not solve the problem, but you can give more information. Which error did you get upon compiling?
pakk is offline   Reply With Quote

Old   April 14, 2015, 17:36
Default
  #28
New Member
 
mostafa
Join Date: Jun 2013
Posts: 22
Rep Power: 13
mostafa_zeynalabedini is on a distinguished road
actually it compiled. but after two steps of running segmentation error happened. I think this error is from multiphase thread assigning. do you know in parallel running how can I find the phase_domain_index of each phase in each computing node?
mostafa_zeynalabedini is offline   Reply With Quote

Old   February 28, 2016, 19:04
Default
  #29
Member
 
Hossein
Join Date: Oct 2010
Location: Greensboro, NC, USA
Posts: 30
Rep Power: 16
hossein65 is on a distinguished road
I searched through the entire forum, my problem still exists. I have reduced the code to just a simple code, but it seems it is not a compliation error (I have tried both interpreting and compiling). Here is the code:
/************************************************** **

*************
UDF for initializing phase volume fraction


************************************************** ***

*************/

#include "udf.h"

/* domain pointer that is passed by INIT function is

mixture domain */
DEFINE_INIT(my_init_function, mixture_domain)
{
int phase_domain_index;
cell_t cell;
Thread *cell_thread;
Domain *subdomain;
real xc[ND_ND];
C_VOF(cell,cell_thread) = 1.;
}

and the error:

Creating library libudf.lib and object libudf.exp
Absorption.obj : error LNK2019: unresolved external symbol __imp__store_vof_norm referenced in function _my_init_function
C:\PROGRA~1\ANSYSI~1\v160\fluent\fluent16.0.0\win6 4\3d\fl1600.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'X86'
libudf.dll : fatal error LNK1120: 1 unresolved externals


However, my final goal after resolving the problem is to complie a code which calculates the absorption and scattering ceofficients for DO model, as a function of secondary phase vof
thanks
__________________
Hossein Amini
PhD student in Biochemical Engineering; Computational Science and Engineering department;
North Carolina Agricultural and Technical State University
hossein65 is offline   Reply With Quote

Old   February 29, 2016, 19:44
Default
  #30
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Quote:
Originally Posted by hossein65 View Post
I searched through the entire forum, my problem still exists. I have reduced the code to just a simple code, but it seems it is not a compliation error (I have tried both interpreting and compiling).
You've declared the variables 'cell' and 'cell_thread' but they have no values yet and you're trying to access them with C_VOF. These variables must be initiailised. You're probably intending to loop over the cells in your domain, try the thread_loop_c (for multiple thread zones) and begin_c_loop (for running through all cells in a thread) looping macros.
`e` 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convergence problem with target mass flow rate ADL FLUENT 2 May 29, 2012 22:11
UDF for inlet mass flow rate rahulsuresh89 Fluent UDF and Scheme Programming 1 October 16, 2010 18:06
UDF mass flow rate Juan FLUENT 2 December 22, 2007 10:29
particle, parcel and mass flow rate balance flybird FLUENT 0 May 24, 2007 11:44
How to define mass flow rate using UDF? SAMUEL FLUENT 0 December 16, 2004 03:55


All times are GMT -4. The time now is 20:06.