|
[Sponsors] |
Error: invalid type conversion: double -> pointer to char. |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Member
Dave
Join Date: Mar 2019
Posts: 34
Rep Power: 6 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,259
Rep Power: 33 ![]() ![]() |
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; } |
|
![]() |
![]() |
![]() |
Tags |
udf, viscosity |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |