|
[Sponsors] |
January 18, 2021, 08:18 |
heat generation inside battery
|
#1 |
New Member
Join Date: Jan 2021
Posts: 2
Rep Power: 0 |
hi
i need a fluent udf for heat generation inside a battery cell. i wrote the udf but i get c2055 error the code is based on cell temperature and time Can anyone give me a solution or correct the code? thanks |
|
January 19, 2021, 00:46 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
Code:
#include "udf.h" #include "math.h" DEFINE_ADJUST(cellheatgenerate,d) { real SOC,ds,tm,Ri,tempu,volume,source,temp; Thread *t; cell_t c; tm = CURRENT_TIME; thread_loop_c(t,d) { begin_c_loop(c,t) { SOC = 1.-((90.*tm)/5400.); if ((SOC >= 0.) && (SOC <= 0.77)) ds = (99.88*SOC)-76.67; else if ((SOC > 0.77) && (SOC <= 0.87)) ds = -30.; else if ((SOC >0.87) && (SOC <=1.)) ds = -20.; volume = C_VOLUME(c,t); tempu = C_T(c,t); if (tm == 0.) temp = 291.15; else if (tm > 0.) temp = tempu; if (temp <= 298.15) Ri = 0.000002258*pow(SOC,-0.3952); else if ((temp > 298.15) && (temp <= 308.15)) Ri = 0.000001857*pow(SOC,-0.2787); else if (temp > 308.15) Ri = 0.000001659*pow(SOC,-0.1692); temp = C_T(c,t); source = ((Ri*8100.)-(90.*temp*ds/96.485))/volume; C_UDMI(c,t,0) = source; } end_c_loop(c,t) } } DEFINE_SOURCE(my_heat_source,c,t,dS,eqn) { real source; source = C_UDMI(c,t,0); dS[eqn] = 0.0; return source; }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
January 22, 2021, 07:05 |
|
#3 |
New Member
Join Date: Jan 2021
Posts: 2
Rep Power: 0 |
hi dear AlexanderZ
i run the code and its compiled with no error but when i run the calculation its give me this error: "the f1 process could not be started" i tried parallel and serial and this error appeared i gave constant source term and its run perfectly so problem isnt the mesh and model please help to solve problem |
|
January 25, 2021, 01:55 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
allocate user defined memory location in fluent GUI
user defined -> memory -> set udm locations to 1
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
error c2055, heat generation rate, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
heat generation problem | montazar | FLUENT | 0 | March 11, 2016 14:28 |
Fluent transient Simulation - varying Internal Heat generation : Help! | lamboram | FLUENT | 0 | September 14, 2015 05:37 |
heat generation rate in the wall boundary conditions, what this? | serguei | Fluent Multiphase | 3 | September 10, 2015 17:24 |
Error finding variable "THERMX" | sunilpatil | CFX | 8 | April 26, 2013 08:00 |
Heating of a solid cylinder with internal heat generation | Sriram Popuri | Main CFD Forum | 6 | July 13, 1999 19:09 |