|
[Sponsors] |
how to write udf for property that are depend on temperature |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 22, 2015, 11:11 |
how to write udf for property that are depend on temperature
|
#1 |
New Member
Join Date: Jun 2015
Posts: 2
Rep Power: 0 |
I write a UDF ,but it's displayed error after that interpreted :
UDF for specifying a temperature-dependent thermal conductivity property ************************************************** ********************/ #include "udf.h" DEFINE_PROPERTY(cell_thermalconductivity,cell,thre ad) { # define KS 36 /*thermal conductivity nanoparticle*/ # define BETA 0.1 # define VFR 0.01 /*volume fraction*/ # define PW 998.2 /*densits of water*/ # define PS 3970 /* density of nano particles*/ # define CPW 4182 /*heat capacity of water*/ # define CPS 765 /* heat capacity of nanoparticle*/ # define DH 0.0005605 /*diameter hydraulical*/ # define VELA 1.2281 /* axial velocity*/ # define C 0.005 real thermalconductivity; real knf; real d; real kw; real temp; {temp = C_T(cell, thread) kw= -0.000008*pow(temp,2)+.0063*temp-.05632; } knf=kw*((KS+2*kw+2*(KS-kw)*pow((1+BETA),3)*VFR)/(KS+2*kw-(KS-kw)*pow((1+BETA),3)*VFR)); d=C*((PS*CPS)*VFR+(PW*CPW)*(1-VFR))*VFR*DH*VELA; thermalconductivity=knf+d; return thermalconductivity; } next UDF IS: /************************************************** ******************* UDF for specifying a temperature-dependent viscosity property ************************************************** ********************/ #include "udf.h" DEFINE_PROPERTY(cell_viscosity,cell,thread) {real munf; real muw; #define VFR 0.01 real temp = C_T(cell, thread); if (temp > 297.) muw = (2.414*pow(10,-5))*pow(10,(247.8/(temp-140.0))); munf=muw*(1+(2.5*VFR)) return munf; } I hope , somebody could help me. thanks. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[openSmoke] libOpenSMOKE | Tobi | OpenFOAM Community Contributions | 562 | January 25, 2023 10:21 |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 08:15 |
[Helyx OS] Helyx-OS (GUI for SnappyHexMesh | elvis | OpenFOAM Community Contributions | 210 | January 30, 2017 19:57 |
UDF for Back-flow Temperature | G340 | Fluent UDF and Scheme Programming | 3 | August 21, 2013 05:56 |
is internalField(U) equivalent to zeroGradient? | immortality | OpenFOAM Running, Solving & CFD | 7 | March 29, 2013 02:27 |