Jump to content

[Mathematica] Workaround for NDSolve boundry value problem?

Hey guys,

I am currently trying to upgrade my simulation of CPU coolers in Mathematica from simulating just a single fin to multiple fins ('cause my design has some fins not directly connected to the CPU).

When I hand my set of equations over to NDSolve it complains that "NDSolve is not currently able to solve boundary value problems with discrete variables".

I was hoping somebody maybe knows a work around :/ 

Here is my code

Peqns = Table[D[power[i][h], h] == -Cv*Width[h]*temp[i][h] +
   If[i > 1, (temp[i - 1][h] - temp[i][h])*ConW[h]/ConL*Cd,0] + If[i < Fins, (temp[i + 1][h] - temp[i][h],0)*ConW[h]/ConL*Cd], {i, Fins}];
   
Teqns = Table[D[temp[i][h], h] == -power[i][h]/(Cd*Width[h]*thickness), {i, Fins}];

Ieqns = {Table[power[i][0] == CPUpower/Length[ConFins], {i, Fins}], Table[power[i][height] == 0, {i, Fins}]};

eqns = Join[Peqns, Teqns, Ieqns];

sol = NDSolve[eqns, Join[Table[temp[i], {i, 0, Fins}], Table[power[i], {i, Fins}]], {h,0, height}];
     
Evaluate[temp[1][0] /. sol]

All the other stuff is pretty much constant (ie read them as constants, makes more sense that way)

Here is a list of what the things are:

Spoiler

Cd is the conductivity 237 [W/mK]

Width[h] is the width of the fins at a given height currently set to 0.1 everywhere for debugging

thickness is the thickness of the fins 0.001

Cv is the convection 10.45 [W/m²K]

CPUPower is... well the CPU power, 90 [W]

Fins is the number of fins, currently set to 3 for debugging

ConFins is the set of all fins that are connected to the CPU, currently set to {1} for debugging

ConL is the connector (eg heatpipes)  length 0.005 [m]

ConW[h] is a function that gives the width of the connector(s) at the current height. It gives values of 0.01 to 0 and is mostly 0

height is the total height of the cooler/fins, currently 0.14

 

Note that I can verify, that the problem only arises, when there are terms involving the neighboring temps, if I set that term to 0 it works. But even if I choose my conditions in a way that guaranties that these terms will be 0 it refuses to even start to compute

Link to comment
Share on other sites

Link to post
Share on other sites

May I ask what the end goal is? What are you trying to solve for? There may be some CFD equations you could use to solve it more directly.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Brooksie359 said:

May I ask what the end goal is? What are you trying to solve for? There may be some CFD equations you could use to solve it more directly.

I am solving for the temperature on the bottom of the fins

(Really I want the total temperature curves, but I guess these will be needed anyway)

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, ChalkChalkson said:

I am solving for the temperature on the bottom of the fins

(Really I want the total temperature curves, but I guess these will be needed anyway)

Well then this seems like something CFD was created for. Do you know much about CFD?

Link to comment
Share on other sites

Link to post
Share on other sites

if you want to look up more about CFD and how it can help you just search for Patankar's Book and it should be the first result. chapter 4 goes over how to do continuations for conduction while chapter 5 goes over convection. 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Brooksie359 said:

if you want to look up more about CFD and how it can help you just search for Patankar's Book and it should be the first result. chapter 4 goes over how to do continuations for conduction while chapter 5 goes over convection. 

Thanks, I'll look into CFD, but the issue is, that I am sitting on a system that has both conduction and convection on several objects influencing each other.

The topology of the object sadly is purely 2D, so I can't reduce it to 1 continuous function either 

Link to comment
Share on other sites

Link to post
Share on other sites

38 minutes ago, ChalkChalkson said:

Thanks, I'll look into CFD, but the issue is, that I am sitting on a system that has both conduction and convection on several objects influencing each other.

The topology of the object sadly is purely 2D, so I can't reduce it to 1 continuous function either 

I believe you would just use one as the others boundary condition and and solve that way. 

Link to comment
Share on other sites

Link to post
Share on other sites

i do believe the book goes into that as well so if you look at it you will probably be able to figure it out. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×