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

Multiphase UDF Parse Error

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 13, 2020, 05:05
Default Multiphase UDF Parse Error
  #1
New Member
 
Nederland
Join Date: Sep 2020
Posts: 9
Rep Power: 5
mdmtramper is on a distinguished road
Hello everyone!

I am trying to interpret two UDFs to describe the non-Newtonian behaviour of blood in a multiphase simulation. I have written two DEFINE_PROPERTY functions, included in the text below. However, if I want to interpret them, FLUENT keeps giving me the 'parse error' after starting at the 'Domain *plasma_domain' line.

I have tried numerous things, and also tried to delete the Get_Domain and Lookup_Thread sections in my code. But if I did that, the initialization gave me a mtp_9999 error and the whole simulation immediately quit.

I have no idea what to do next, so maybe someone here has an idea? I know that my mesh is correct, since I used it for a range of other simulations as well. I am using ANSYS version 19.1 and have to run simulations via an external hpc cluster (using max 16 nodes). Maybe that has an influence as well, but I cannot even get the simulation working on my own computer (because I keep getting the parse error / mtp_9999 error).

Thanks in advance!

#include "udf.h"
DEFINE_PROPERTY(granular_viscosity_rbc, cell, thread)
{

int phase_domain_index, ID = 2;

Domain *mixture_domain;
mixture_domain = Get_Domain(1);

Domain *plasma_domain;
plasma_domain = Get_Domain(2);

Domain *rbc_domain;
rbc_domain = Get_Domain(3);

Thread* mixture_thread;
mixture_thread = Lookup_Thread(mixture_domain,ID);


real muplasma = 0.006;
real murbc = 0.01;
real mumix = 0.0037;
real eps_rbc = 0.45;
real lambda = 0.110;
real m = 9.106;
real n = 0.749;
real sr = 500;

Thread* mixture_thread;
Thread* subthread;

sub_thread_loop(subthread, mixture_thread, phase_domain_index)
{
if(subthread == Lookup_Thread(plasma_domain,ID))
{
muplasma=C_MU_L(cell,subthread);
}
else if(subthread == Lookup_Thread(rbc_domain,ID))
{
sr = C_STRAIN_RATE_MAG(cell,subthread);
eps_rbc = C_VOF(cell,subthread);
}
}

n = 0.8092*pow(eps_rbc ,3.) - 0.8246*pow(eps_rbc ,2.) - 0.3503*eps_rbc + 1.;
m = 122.28*pow(eps_rbc ,3.) - 51.213*pow(eps_rbc ,2.) + 16.305*eps_rbc + 1.;
mumix = m* pow( (1.+ pow((lambda*sr) ,2.) ),((n-1.)/2.) );
murbc = (mumix*muplasma -(1.-eps_rbc)*muplasma)/eps_rbc;
return murbc;
}

#include "udf.h"
DEFINE_PROPERTY(density_rbc,cell,thread)
{
int phase_domain_index;
int ID=2;

Domain *mixture_domain;
Domain *plasma_domain;
Domain *rbc_domain;

Thread *mixture_thread;
Thread *subthread;

real rhoplasma = 10;
real rhorbc = 10;
real vof = 0.45;
real rhomix = 1080;

sub_thread_loop(subthread, mixture_thread, phase_domain_index)
{
if(subthread == plasma_domain)
{
rhoplasma = C_R(cell,subthread);
}
else if(subthread == rbc_domain)
{
vof = C_VOF(cell,subthread);
}
rhorbc = (rhomix - (rhoplasma*(1-vof)))/(vof+1e-4);
}
return rhorbc;
}
mdmtramper is offline   Reply With Quote

 

Tags
get_domain, multiphase, non-newtonian, parse error, 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
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries NickG OpenFOAM Installation 3 December 30, 2019 00:21
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 19:43
Errors in UDF shashank312 Fluent UDF and Scheme Programming 6 May 30, 2013 20:30
[swak4Foam] installing funkySetFields igo OpenFOAM Community Contributions 1 November 20, 2012 20:16
user subroutine error CFDUSER CFX 2 December 9, 2006 06:31


All times are GMT -4. The time now is 05:44.