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

Error: invalid type conversion: double -> pointer to char.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2019, 10:17
Default Error: invalid type conversion: double -> pointer to char.
  #1
Member
 
Sebi
Join Date: Mar 2019
Posts: 49
Rep Power: 7
bloodflow is on a distinguished road
For this UDF:

/* Generalised power-law Viscosity Model */

#include "udf.h"

double muinf=0.035;
double du=0.25;
double ninf=1;
double dn=0.45;
double ac=50;
double bc=3;
double cc=50;
double dc=4;

DEFINE_PROPERTY(cell_viscosity,c,t)
{
real t=CURRENT_TIME;
real stmag;
real p1;
real p2;
real p3;
real p4;
real lst;
real nst;
real indi;
real visco;
real sivisco;
if (t<0.05)
{
sivisco=0.035;
}
else if (t>0.05)
{
stmag=(fabs((C_STRAIN_RATE_MAG(c,t))));
p1=(exp((-bc)/(stmag)));
p2=(exp(-(p1)*(1+((stmag)/(ac)))));
p3=(exp((-dc)/(stmag)));
p4=(exp(-(p3)*(1+((stmag)/(cc)))));
lst=((muinf)+((du)*(p2)));
nst=((ninf)-((dn)*(p4)));
indi=((nst)-1);
visco=((lst)*(pow((stmag),(indi))));
sivisco=((visco)/10);
}
return sivisco;
}

I don't understand why it is wrong? I am having to add the loop about time because initially the strain magnitude is 0 and it kills my simulations due to errors.
bloodflow is offline   Reply With Quote

Old   April 3, 2019, 21:44
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
write down here full console output next time

Code:
/* Generalised power-law Viscosity Model */

#include "udf.h"

real muinf=0.035;
real du=0.25;
real ninf=1;
real dn=0.45;
real ac=50;
real bc=3;
real cc=50;
real dc=4;

DEFINE_PROPERTY(cell_viscosity,c,t)
{
real flow_time = RP_Get_Real("flow-time");
real stmag;
real p1;
real p2;
real p3;
real p4;
real lst;
real nst;
real indi;
real visco;
real sivisco;
if (flow_time<0.05)
{
sivisco=0.035;
}
else if (flow_time>0.05)
{
stmag=(fabs((C_STRAIN_RATE_MAG(c,t))));
p1=(exp((-bc)/(stmag)));
p2=(exp(-(p1)*(1+((stmag)/(ac)))));
p3=(exp((-dc)/(stmag)));
p4=(exp(-(p3)*(1+((stmag)/(cc)))));
lst=((muinf)+((du)*(p2)));
nst=((ninf)-((dn)*(p4)));
indi=((nst)-1);
visco=((lst)*(pow((stmag),(indi))));
sivisco=((visco)/10);
}
return sivisco;
}
best regards
AlexanderZ is offline   Reply With Quote

Reply

Tags
udf, viscosity


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
time step continuity problem in VAWT simulation lpz_michele OpenFOAM Running, Solving & CFD 5 February 22, 2018 19:50
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 09:28
singularity? mihaipruna OpenFOAM Running, Solving & CFD 5 April 24, 2012 17:18
Missing math.h header Travis FLUENT 4 January 15, 2009 11:48


All times are GMT -4. The time now is 21:50.