×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Simulation of water cooling circuit

## Simulation of water cooling circuit

(OP)
Hi

I'm working on a water cooling circuit, where I have a heat tank with a heat source that's on/off in 5 min. intervals, and a buffer tank, that's constantly cooled by a heat exchanger. There's a pump, that cycles water between the two tanks to keep a temperature of 15 °C (+/- 0.5 °C) in the heat tank.

I've tried to programme the on/off function of the pump to keep the temperature of the heat tank within the required interval, which seems to work, but would like to know if there's a cleaner way to achieve what I want, or is it done the way I've done it? Besides I would like to have the ability to change the number of cycles the calculation runs for, which is done manually in the attached example. Can this be done?

### RE: Simulation of water cooling circuit

Your pump switching logic is fine, you could probably do it as one liner but it would be harder to understand. Hysteresis is by its nature a non smooth function

If you want to change the number of loops on the fly change it to a function and call it from the command line eg

>>pumpything(17)

function[]=pumpything(loops)
clc
clear
close all

% Loops in calculation

lv = 1:loops*2; % Loop vector
even = lv(mod(lv,2)==0); % Even values in loop vector
odd = lv(mod(lv,2)~=0); % Odd values in loop vector

% Conditions/constants
t_v = 15; % Temperature in heat tank [°C]
t_b = 6.5; % Temperature in buffer tank [°C]
t_v_lim = 0.5;

tau_int = 1; % Calculation intervals [s]
tau_end = 600*loops; % Calculation end time [s]

c = 4192; % Specific heat capacity [J/(kg K)]
m_b = 4; % Mass in buffer tank [kg]
m_v = 2; % Mass in heat tank [kg]

P_b = -200; % Power from heat exchanger in buffer tank [W]
P_v = 400; % Power from dypkoger i varmetank [W]

pump = 60; % Pump effect [L/hr]
q_m = pump/3600; % Mass flow from pump [kg/s]

N = (tau_end/tau_int)+1; % Number of calculations

% Start values
tv(1) = t_v; % Temperature in heat tank
tb(1) = t_b; % Temperature in buffer tank
tau(1) = 0; % Start time
tl(1) = t_v+t_v_lim; % Upper temperature limit of heat tank
ll(1) = t_v-t_v_lim; % Lower temperature limit of heat tank

% CALCULATION
for i = 2:N;
tau(i) = tau(i-1)+tau_int;
tv(i) = (((q_m*c*(tb(i-1)-tv(i-1))+P_v)*tau_int)/(m_v*c))+tv(i-1);
tb(i) = (((q_m*c*(tv(i-1)-tb(i-1))+P_b)*tau_int)/(m_b*c))+tb(i-1);
tl(i) = tl(1);
ll(i) = ll(1);
if tv(i)<=t_v-t_v_lim
q_m = 0;
end
if tv(i)>=t_v+t_v_lim
q_m = pump/3600;
end
if tau(i) > (odd*tau_end)/(loops*2)
tv(i) = (((q_m*c*(tb(i-1)-tv(i-1)))*tau_int)/(m_v*c))+tv(i-1);
end
if tau(i) > (even*tau_end)/(loops*2)
tv(i) = (((q_m*c*(tb(i-1)-tv(i-1))+P_v)*tau_int)/(m_v*c))+tv(i-1);
end
end

plot(tau/60,tv,'k-',tau/60,tb,'r-',tau/60,tl,'b--',tau/60,ll,'b--')
end

Cheers

Greg Locock

New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

### RE: Simulation of water cooling circuit

(OP)
The problem have been somewhat solved. See solution in http://ole.dixib.dk/indledende_beregninger_w.m.
There's still some problems in though. Weird things happen when I change the starting temperature. Haven't been able to find a solution to this problem.

For now the above version have been abandoned and I've made a Simulink version instead (http://ole.dixib.dk/sl_tanke.slx and http://ole.dixib.dk/tanke.m). This works fine as it is now, but I'd like to add a delay to the heat source, so the 5 min. on/off intervals doesn't start until the temperature af both tanks are under a certain limit. Hope someone can help with this, since I have been able to find any help through Googling.
In addition I'd like to control the solver step size from the script (maybe even choose the solver). Is this possible?

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a partâ€™s function at the center of their design considerations. Download Now
Industry Perspective: Education and Metal 3D Printing
Metal 3D printing has rapidly emerged as a key technology in modern design and manufacturing, so itâ€™s critical educational institutions include it in their curricula to avoid leaving students at a disadvantage as they enter the workforce. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!