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

Creating a UDF to model the heat generation of a Li-ion battery

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 10, 2022, 12:29
Default Creating a UDF to model the heat generation of a Li-ion battery
  #1
New Member
 
Join Date: Mar 2022
Posts: 6
Rep Power: 4
canderous is on a distinguished road
I am working on a project involving analysing liquid cooling structures of electric vehicle battery packs, and am currently trying to roughly model the heat generation of an 18650 cylindrical Li-ion battery. I have come across a method proposed in a paper that I wish to replicate in some way, the only problem being the UDF is not directly covered. The methodology is described in section 3.1 of "Analysing the performance of liquid cooling designs in cylindrical lithium-ion batteries"- Matthew Yates et al. (https://www.sciencedirect.com/scienc...52152X1930461X), where it describes how the power generation per unit volume is 190,000W/m3, is run over a period of 720s, and also how the power generation is set as a function of the height of the cell aswell.*

The geometry I have is simple, it is just a cylinder with diameter 18mm and height 65mm, I wish to just have a user defined function to model the heat generation described above, so I can finally move on to modelling the cooling. I have never created a UDF before, and have no experience in programming, if this involves writing something in C. I would really appreciate any help in how to create this UDF.

Many thanks
canderous is offline   Reply With Quote

Old   July 10, 2022, 21:47
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
you mat use DEFINE_SOURCE macro to apply heat source

algorithm I can suggest:
1. you check Z-axis zoordinate (assuming the height in z direction) look for C_CENTROID macro
2. dependint on Z coordinate you have some expression to calculate heat source

Ansys Fluent Customization manual
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   July 11, 2022, 11:01
Default
  #3
New Member
 
Join Date: Mar 2022
Posts: 6
Rep Power: 4
canderous is on a distinguished road
Thanks for your response Alexander,

I have had a look through the UDF manual, and looked at DEFINE_SOURCE, although the problem is writing a script like this is very much out of my depth, I have no programming experience. I did find a youtube video (https://youtu.be/Pi2hHNazhNQ) which showed a UDF for some variable heat source:

#include"udf.h"
DEFINE_SOURCE(variableheatsource, c, t, ds, eqn)
{
real time,source;
time=CURRENT_TIME;
source=10000*time;
ds[eqn] = 0;
return source;
}

I guess this is a starting point, although it of course is still not close to what I need, do you have any idea how I can convert this script to the conditions I need?

Many thanks
canderous is offline   Reply With Quote

Reply

Tags
battery model, udf code


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
UDF for mass and heat source with heat transfer rajendra1 Fluent UDF and Scheme Programming 35 October 13, 2017 05:04
udf for heat generation sarah l Fluent UDF and Scheme Programming 1 October 16, 2013 18:48
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
UDF for Heat Exchanger model francois louw FLUENT 2 July 16, 2010 03:21
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


All times are GMT -4. The time now is 04:52.