Thread Subject: SymHydraulics: temperature effects

Subject: SymHydraulics: temperature effects

From: Edoardo Gonfiotti

Date: 8 Apr, 2010 09:18:04

Message: 1 of 11

Hello,

this post is to ask if anybody practical with simscape/simhydraulics platform has ever encountered the need to include temperature effects in their hydraulic models and eventually ask the adopted solutions.
I am actually developing a dynamic model for a lube oil system. Temperature effects may be very significant in my application as oil temperature may vary from 20°C to 75°C. In fact consequent kinematic viscosity variations for standard industrial oils, such as iso vg 32, may have important effects on the characteristic Reynolds number of the flow and consequently system performance and more specifically system response during critical transient phases.
As far as I know simhydraulics is a pure isothermal application (as hydraulics theory suggests); thermal blocks from the foundation library are hardly integrable to simhydraulics as they are born to model prevalently closed systems.
I thought of an approach similar to pneumatics foundation blocks:
here the domain source code:
%-----------------------
domain thermoHydraulics
parameters
    bulk = { 0.8e9 , 'Pa' }; % Bulk modulus at atm. pressure and no gas
    alpha = { 0.005 , '1' }; % Relative amount of trapped air
    c = { 1670 , 'J/(kg*K)'}; % Specific heat
 end
 variables
    p = { 0 , 'Pa' }; %-->across variable
    T = { 0 , 'K' }; %-->across variable
  end
  variables(Balancing = true)
    G = { 0 , 'kg/s' }; %-->though variable
%------------------
Viscosity and density are not included in the domain parameters, and they could be calculated for each component using temp-visc and temp-dens tables red at the simulation's setup.
This approach doesn't respect simscape philosophy of 1across per 1though variable. It would very similar to symhydraulics for what concerns p and G variables (G counterpart in simhydraulics was q volumetric flow rate); T would be threated as a transported scalar variable which could be remain unchanged in many adiabatic components and vary in some critical blocks (such as low efficiency pumps and heat exchangers) due to heat transfer or viscous dissipation.
This approach would require the transposition of all needed foundation.hydraulics and simhydraulic blocks to this "thermohydraulic domain", quite an hard work especially for simhydraulics blocks which do not have source code readability.
I repeat any idea to how include temperature effects on viscosity in hydraulics simulation would be really appreciated. Thus if anybody has ever thought of some kind of "trick" to get around the mentioned problem without reimplementing a whole set of domain blocks, or if you feel to disagree with my statements and have suggestions you are welcome. Even if you agree with my modeling strategy and have any suggestion in merit don't hesitate to let me know.
Thanks in advance.

Edoardo

Subject: SymHydraulics: temperature effects

From: Guy Rouleau

Date: 8 Apr, 2010 22:29:07

Message: 2 of 11

"Edoardo Gonfiotti" <edoardo.gonfiotti@ge.com> wrote in message <hpk70c$iuc$1@fred.mathworks.com>...
> Hello,
>
> this post is to ask if anybody practical with simscape/simhydraulics platform has ever encountered the need to include temperature effects in their hydraulic models and eventually ask the adopted solutions.
> I am actually developing a dynamic model for a lube oil system. Temperature effects may be very significant in my application as oil temperature may vary from 20°C to 75°C. In fact consequent kinematic viscosity variations for standard industrial oils, such as iso vg 32, may have important effects on the characteristic Reynolds number of the flow and consequently system performance and more specifically system response during critical transient phases.
> As far as I know simhydraulics is a pure isothermal application (as hydraulics theory suggests); thermal blocks from the foundation library are hardly integrable to simhydraulics as they are born to model prevalently closed systems.
> I thought of an approach similar to pneumatics foundation blocks:
> here the domain source code:
> %-----------------------
> domain thermoHydraulics
> parameters
> bulk = { 0.8e9 , 'Pa' }; % Bulk modulus at atm. pressure and no gas
> alpha = { 0.005 , '1' }; % Relative amount of trapped air
> c = { 1670 , 'J/(kg*K)'}; % Specific heat
> end
> variables
> p = { 0 , 'Pa' }; %-->across variable
> T = { 0 , 'K' }; %-->across variable
> end
> variables(Balancing = true)
> G = { 0 , 'kg/s' }; %-->though variable
> %------------------
> Viscosity and density are not included in the domain parameters, and they could be calculated for each component using temp-visc and temp-dens tables red at the simulation's setup.
> This approach doesn't respect simscape philosophy of 1across per 1though variable. It would very similar to symhydraulics for what concerns p and G variables (G counterpart in simhydraulics was q volumetric flow rate); T would be threated as a transported scalar variable which could be remain unchanged in many adiabatic components and vary in some critical blocks (such as low efficiency pumps and heat exchangers) due to heat transfer or viscous dissipation.
> This approach would require the transposition of all needed foundation.hydraulics and simhydraulic blocks to this "thermohydraulic domain", quite an hard work especially for simhydraulics blocks which do not have source code readability.
> I repeat any idea to how include temperature effects on viscosity in hydraulics simulation would be really appreciated. Thus if anybody has ever thought of some kind of "trick" to get around the mentioned problem without reimplementing a whole set of domain blocks, or if you feel to disagree with my statements and have suggestions you are welcome. Even if you agree with my modeling strategy and have any suggestion in merit don't hesitate to let me know.
> Thanks in advance.
>
> Edoardo

Hi,

I can tell that you are not the first to try modelling thermohydraulic in the simscape language. I don't have a perfect solution, but I can give you 2 comments:

- In most cases, it is preferable to have the same number of through and across variables. So for thermohydraulic, I would go for example for mass flow and heat flow, or enthalpy.

- In the latest Simscape release, a pneumatic domain is included. It could be useful to look at the provided source .ssc files to get some inspiration. The following documentation page shows the 2 through and 2 across variable used:

http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/simscape/ref/br700pt-1.html

I hope this helps

Guy

Subject: SymHydraulics: temperature effects

From: Edoardo Gonfiotti

Date: 9 Apr, 2010 07:42:20

Message: 3 of 11

"Guy Rouleau" <guy.rouleau.nospam@mathworks.com> wrote in message <hpllbj$o34$1@fred.mathworks.com>...
> "Edoardo Gonfiotti" <edoardo.gonfiotti@ge.com> wrote in message <hpk70c$iuc$1@fred.mathworks.com>...
> > Hello,
> >
> > this post is to ask if anybody practical with simscape/simhydraulics platform has ever encountered the need to include temperature effects in their hydraulic models and eventually ask the adopted solutions.
> > I am actually developing a dynamic model for a lube oil system. Temperature effects may be very significant in my application as oil temperature may vary from 20°C to 75°C. In fact consequent kinematic viscosity variations for standard industrial oils, such as iso vg 32, may have important effects on the characteristic Reynolds number of the flow and consequently system performance and more specifically system response during critical transient phases.
> > As far as I know simhydraulics is a pure isothermal application (as hydraulics theory suggests); thermal blocks from the foundation library are hardly integrable to simhydraulics as they are born to model prevalently closed systems.
> > I thought of an approach similar to pneumatics foundation blocks:
> > here the domain source code:
> > %-----------------------
> > domain thermoHydraulics
> > parameters
> > bulk = { 0.8e9 , 'Pa' }; % Bulk modulus at atm. pressure and no gas
> > alpha = { 0.005 , '1' }; % Relative amount of trapped air
> > c = { 1670 , 'J/(kg*K)'}; % Specific heat
> > end
> > variables
> > p = { 0 , 'Pa' }; %-->across variable
> > T = { 0 , 'K' }; %-->across variable
> > end
> > variables(Balancing = true)
> > G = { 0 , 'kg/s' }; %-->though variable
> > %------------------
> > Viscosity and density are not included in the domain parameters, and they could be calculated for each component using temp-visc and temp-dens tables red at the simulation's setup.
> > This approach doesn't respect simscape philosophy of 1across per 1though variable. It would very similar to symhydraulics for what concerns p and G variables (G counterpart in simhydraulics was q volumetric flow rate); T would be threated as a transported scalar variable which could be remain unchanged in many adiabatic components and vary in some critical blocks (such as low efficiency pumps and heat exchangers) due to heat transfer or viscous dissipation.
> > This approach would require the transposition of all needed foundation.hydraulics and simhydraulic blocks to this "thermohydraulic domain", quite an hard work especially for simhydraulics blocks which do not have source code readability.
> > I repeat any idea to how include temperature effects on viscosity in hydraulics simulation would be really appreciated. Thus if anybody has ever thought of some kind of "trick" to get around the mentioned problem without reimplementing a whole set of domain blocks, or if you feel to disagree with my statements and have suggestions you are welcome. Even if you agree with my modeling strategy and have any suggestion in merit don't hesitate to let me know.
> > Thanks in advance.
> >
> > Edoardo
>
> Hi,
>
> I can tell that you are not the first to try modelling thermohydraulic in the simscape language. I don't have a perfect solution, but I can give you 2 comments:
>
> - In most cases, it is preferable to have the same number of through and across variables. So for thermohydraulic, I would go for example for mass flow and heat flow, or enthalpy.
>
> - In the latest Simscape release, a pneumatic domain is included. It could be useful to look at the provided source .ssc files to get some inspiration. The following documentation page shows the 2 through and 2 across variable used:
>
> http://www.mathworks.com/access/helpdesk/help/toolbox/physmod/simscape/ref/br700pt-1.html
>
> I hope this helps
>
> Guy


Thank you very much for your quick reply and suggestions. I had had already a look at the foundation pneumatics library and I didn't really understand the connection between T and Q viariables (across and through variables respectively) and more specifically the need to introduce as a conserving variable Q. Anyway If I come to interest findings about my problem I'll keep you updated. Bye.

Edoardo

 

Subject: SymHydraulics: temperature effects

From: Walter Driesen

Date: 23 Jun, 2010 08:23:21

Message: 4 of 11

Hi Edoardo,

I am facing similar problems while modeling a heat exchanger in simscape (see http://www.mathworks.com/matlabcentral/newsreader/view_thread/284135#756748 ).

I would agree with you to add only the temperature as an across variable, without adding any corresponding trough variable. As far as my understanding of physics goes, the heat flow in such a hydro-thermal system does not follow the direction of the volumetric flow of the fluid. So, for me, heat flow can't be a conserving variable.

I implemented such a domain and for the moment it seems to work fine. Maybe I will run into problems later. I don't know.

Best,
Walter

Subject: SymHydraulics: temperature effects

From: Arnaud Miege

Date: 1 Jul, 2010 15:49:04

Message: 5 of 11

"Walter Driesen" <walter.driesen@REMOVETHIS.fmtc.be> wrote in message <hvsg9p$dr8$1@fred.mathworks.com>...
> Hi Edoardo,
>
> I am facing similar problems while modeling a heat exchanger in simscape (see http://www.mathworks.com/matlabcentral/newsreader/view_thread/284135#756748 ).
>
> I would agree with you to add only the temperature as an across variable, without adding any corresponding trough variable. As far as my understanding of physics goes, the heat flow in such a hydro-thermal system does not follow the direction of the volumetric flow of the fluid. So, for me, heat flow can't be a conserving variable.
>
> I implemented such a domain and for the moment it seems to work fine. Maybe I will run into problems later. I don't know.
>
> Best,
> Walter

Simscape applies generalized Kirchoff's laws: the algebraic sum of the through variables (e.g. current) at one node is zero, while two ports connected together have the same across variable (e.g. voltage). That is why it is generally recommended to have through and across variables in pairs. Even if the heat flow doesn't follow the volumetric flow of the fluid, you still need to do an energy balance on the heat exchanged somewhere, which is why you would use the heat flow as a through variable. I agree though that it isn't an easy problem.

Arnaud

Subject: SymHydraulics: temperature effects

From: Samuel Dickerson

Date: 16 Mar, 2011 18:17:23

Message: 6 of 11

At the University of Pittsburgh we have a fairly large group of graduate students collaborating on a project in which we are creating a simulation environment for a nuclear reactor coolant system. We have decided to use simscape to model the coolant flow, a thermohydraulic problem, and see the difficulty in doing so.

We now realize, (by looking at whats available in the default libraries and from reading some of the various posts) that we too need to create a thermohydraulic domain, such as some of you have already tried.

I am not one of the nuclear experts in the group, but am somewhat comfortable using/creating simscape models etc., so our team has been given this task. From earlier posts, I see that two sets of across and through variables are recommended. In our case I believe this could be Pressure/Mass flow and Enthalpy/Heat flux.

However from my meager understanding of the physical process, pressure is the 'effort' variable driving the mass flow and that mass flow is what transports the heat. So then bringing that back to the simscape world, would it be a problem to use enthalpy as an across variable? I hope that makes some sense (I am a nano/integrated circuit designer by trade who dabbles in simulation).

Also, if anyone else has made strides in 'simscape thermohydraulics' I would be interested in hearing about what you've found.

-Sam

Subject: SymHydraulics: temperature effects

From: Guy Rouleau

Date: 16 Mar, 2011 18:47:05

Message: 7 of 11

"Samuel Dickerson" <sjdst31@pitt.edu> wrote in message <ilqurj$82l$1@ginger.mathworks.com>...
> At the University of Pittsburgh we have a fairly large group of graduate students collaborating on a project in which we are creating a simulation environment for a nuclear reactor coolant system. We have decided to use simscape to model the coolant flow, a thermohydraulic problem, and see the difficulty in doing so.
>
> We now realize, (by looking at whats available in the default libraries and from reading some of the various posts) that we too need to create a thermohydraulic domain, such as some of you have already tried.
>
> I am not one of the nuclear experts in the group, but am somewhat comfortable using/creating simscape models etc., so our team has been given this task. From earlier posts, I see that two sets of across and through variables are recommended. In our case I believe this could be Pressure/Mass flow and Enthalpy/Heat flux.
>
> However from my meager understanding of the physical process, pressure is the 'effort' variable driving the mass flow and that mass flow is what transports the heat. So then bringing that back to the simscape world, would it be a problem to use enthalpy as an across variable? I hope that makes some sense (I am a nano/integrated circuit designer by trade who dabbles in simulation).
>
> Also, if anyone else has made strides in 'simscape thermohydraulics' I would be interested in hearing about what you've found.
>
> -Sam

Hi Sam,

I think the best advise I can give you is to inspire your implementation from the Simscape pneumatic library, since all the source code is available. This means using the following through and across variables:

Across variable p (pressure), in Pa
Through variable G (mass flow rate), in kg/s
Across variable T (temperature), in kelvin
Through variable Q (heat flow), in J/s

Guy

Subject: SymHydraulics: temperature effects

From: dpb

Date: 16 Mar, 2011 19:00:08

Message: 8 of 11

On 3/16/2011 1:17 PM, Samuel Dickerson wrote:
> At the University of Pittsburgh we have a fairly large group of graduate
> students collaborating on a project in which we are creating a
> simulation environment for a nuclear reactor coolant system. We have
> decided to use simscape to model the coolant flow, a thermohydraulic
> problem, and see the difficulty in doing so.
>
> We now realize, (by looking at whats available in the default libraries
> and from reading some of the various posts) that we too need to create a
> thermohydraulic domain, such as some of you have already tried.
> I am not one of the nuclear experts in the group, but am somewhat
> comfortable using/creating simscape models etc., so our team has been
> given this task. From earlier posts, I see that two sets of across and
> through variables are recommended. In our case I believe this could be
> Pressure/Mass flow and Enthalpy/Heat flux.
...

I "know nothink" a la Sgt Schultz re: Simscape but re: the modeling I'd
ask first what type of reactor and what portion(s) of the
system--primary, secondary (non-BWR), core interaction or what?

What you'll need and how much will depend in first order on what you're
trying to model...

--

Subject: SymHydraulics: temperature effects

From: Arnaud Miege

Date: 17 Mar, 2011 08:51:04

Message: 9 of 11

"Guy Rouleau" <guy.rouleau.nospam@mathworks.com> wrote in message <ilr0j9$del$1@ginger.mathworks.com>...
> Hi Sam,
>
> I think the best advise I can give you is to inspire your implementation from the Simscape pneumatic library, since all the source code is available. This means using the following through and across variables:
>
> Across variable p (pressure), in Pa
> Through variable G (mass flow rate), in kg/s
> Across variable T (temperature), in kelvin
> Through variable Q (heat flow), in J/s
>
> Guy

I concur with Guy. One thing to bear in mind is that it's not currently possible to use functions like interp1 or interp2 in the equations section of a Simscape file, so to represent the variations of fluid properties (Cp, Cv) with pressure and temperature, I would suggest you did one of two things:
* Approximate fluid properties with a polynomial or other analytic expression, where the (constant) coefficients would be domain-wide parameters. You can then compute the relevant fluid properties in each block;
* Set Cp, Cv, etc... as physical signal inputs to whatever block you are writing, and pressure, temperature, etc... as physical signals outputs of the blocks, and use a PS Lok-up table (1D or 2D) to represent the relationship between the fluid properties and pressure/temperature.

HTH,

Arnaud

Subject: SymHydraulics: temperature effects

From: Walter Driesen

Date: 17 Mar, 2011 10:15:06

Message: 10 of 11

> Hi Sam,
>
> I think the best advise I can give you is to inspire your implementation from the Simscape pneumatic library, since all the source code is available. This means using the following through and across variables:
>
> Across variable p (pressure), in Pa
> Through variable G (mass flow rate), in kg/s
> Across variable T (temperature), in kelvin
> Through variable Q (heat flow), in J/s
>
> Guy

Hi

I started out with a HydroThermal domain with only 3 variables (so no enthalpy flow). As I was told that Simscape does not really like this, I switched to 4-variable domain as suggested by Guy here above and it works fine (although I must say that I did not face any problems (yet) with 3-variable domain).

For the moment I consider fluid properties (heat capacity, density) to be constant, which imposes a limited temperature range of course.

G, T and Q are related by an equation. In practice, I impose an equal ratio between Q/T between corresponding inputs and outputs of my blocks (only for cases where mass flow rate is constant between input and output).

It would be very interesting to have a generic way to model temperature dependant material constants in Simscape, as discussed by Arnaud. For the moment I use polynomals that I define by a block parameter containing an array of coefficients. You have to do something to handle dimensions though.

The example below shows my implementation of a convection coefficient that varies with flow rate.
-----------------------------------------------
parameters
    h_coef = { [0 0 1], 'W/K' }; % coeff. 2nd order polynomial approx. of conv. coefficient (surface 1 m^2)
end
...
equations
    let
        q_c_noDim = q_c /{1,'m^3/s'};
    in
        h == h_coef * [q_c_noDim^2 q_c_noDim 1]';
    end
end
-----------------------------------------------

Hope this can help you out.
Regs,
Walter

Subject: SymHydraulics: temperature effects

From: Samuel Dickerson

Date: 18 Mar, 2011 21:04:04

Message: 11 of 11

Thanks for everyone's response, it has been helpful thus far. For those interested, this is the reactor we are modeling and it is a PWR (pressurized water reactor):
http://www.ap1000.westinghousenuclear.com/ .

Guy\Arnaud: The examples in the pneumatic domain look very similar in form to what was explained to me. The good thing is that we have quite a bit of working professionals/engineers on the project and they should be able to tell me if the pneumatic domain can fit our modeling needs after I review the demos with them. Some of them are quite familar with solving this problem via C programs, etc. and pounding out the algebra, but are not used to solving the network in this manner, with simscape.

Walter: What you described is a similar to what I was thinking in the back of my mind. If they say the pneumatic domain is not sufficient, I will present that as an option and see the group's response.

I'll keep everyone informed

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
hydraulics ther... Walter Driesen 17 Mar, 2011 06:19:38
simscape Walter Driesen 17 Mar, 2011 06:19:38
thermal hydraulic Samuel Dickerson 16 Mar, 2011 14:19:37
simscape Samuel Dickerson 16 Mar, 2011 14:19:37
thermohydraulic Samuel Dickerson 16 Mar, 2011 14:19:37
hydraulics temp... pradeep nandagopal 21 Aug, 2010 04:46:14
simscape therma... Arnaud Miege 1 Jul, 2010 11:54:07
hydraulics temp... Walter Driesen 23 Jun, 2010 04:24:11
temperature eff... Edoardo Gonfiotti 8 Apr, 2010 05:19:14
simscape Edoardo Gonfiotti 8 Apr, 2010 05:19:14
heat transfer Edoardo Gonfiotti 8 Apr, 2010 05:19:14
simhydraulics Edoardo Gonfiotti 8 Apr, 2010 05:19:13
rssFeed for this Thread

Contact us at files@mathworks.com