Overview
Comment:Updated for new MTT
Use FMR in place of R
Fixed bug in sspar
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 2e4379418104726c4deb9fe4f988e135bd898d781a8a95c607ac8a768e553d69
User & Date: gawthrop@users.sourceforge.net on 2003-08-13 17:05:16.000
Other Links: branch diff | manifest | tags
Context
2003-08-14
09:59:17
These should not be here. check-in: 76475393d7 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2003-08-13
17:05:16
Updated for new MTT
Use FMR in place of R
Fixed bug in sspar
check-in: 2e43794181 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
16:12:55
New modulated thermal resistance for use in Thermodynamic Cycles
Eg CarnotCycle
check-in: a316bf7120 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes
1
2
3
4




5
6
7
8
9
10
11
12
13
14
15
16
17




18
19
20
21
22
23
24
25

26


#FIG 3.1
Portrait
Center
Metric




1200 2
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 3827 3152 5402 3152 5177 3377
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 6977 3152 8552 3152 8327 3377
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 8552 2927 8552 3377
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 1352 3150 2927 3150 2702 3375
2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5
	 9900 5850 9900 450 0 450 0 5850 9900 5850
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 2925 2925 2925 3375




4 1 -1 0 0 0 20 0.0000000 4 270 1440 6212 3242 Cycle:cycle\001
4 0 -1 0 0 0 20 0.0000000 4 210 1110 8687 3242 SS:Work\001
4 1 1 1 0 3 20 0.0000000 4 210 735 4456 3466 dS/dT\001
4 1 1 1 0 3 20 0.0000000 4 210 180 4501 2926 T\001
4 1 1 1 0 3 20 0.0000000 4 210 180 7921 2926 P\001
4 1 1 1 0 3 20 0.0000000 4 210 765 7786 3466 dV/dT\001
4 2 -1 0 0 0 20 0.0000000 4 210 990 1170 3285 SS:Heat\001
4 1 1 1 0 3 30 0.0000000 4 390 2310 5085 4635 Carnot cycle\001

4 1 -1 0 0 0 20 0.0000000 4 210 570 3375 3240 RT:r\001


|



>
>
>
>








|
|
|

|
>
>
>
>
|
|
|
|
|
|
<
|
>
|
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

32
33
34
35
36
#FIG 3.2
Portrait
Center
Metric
A4      
100.00
Single
-2
1200 2
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 3827 3152 5402 3152 5177 3377
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 6977 3152 8552 3152 8327 3377
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 8552 2927 8552 3377
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 902 3150 2477 3150 2252 3375
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 2475 2925 2475 3375
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 3825 2925 3825 3375
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 3152 1125 3152 2700 2927 2475
2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5
	 9900 5175 -450 5175 -450 450 9900 450 9900 5175
4 1 -1 0 0 0 20 0.0000 4 285 1440 6212 3242 Cycle:cycle\001
4 0 -1 0 0 0 20 0.0000 4 210 1050 8687 3242 Sf:Work\001
4 1 1 1 0 3 20 0.0000 4 210 735 4456 3466 dS/dT\001
4 1 1 1 0 3 20 0.0000 4 195 180 4501 2926 T\001
4 1 1 1 0 3 20 0.0000 4 195 180 7921 2926 P\001
4 1 1 1 0 3 20 0.0000 4 210 765 7786 3466 dV/dT\001

4 1 1 1 0 3 30 0.0000 4 405 2325 5085 4635 Carnot cycle\001
4 2 -1 0 0 0 20 0.0000 4 210 975 810 3240 Se:Heat\001
4 1 -1 0 0 0 20 0.0000 4 195 1005 3150 3240 FMRT:r\001
4 1 4 100 0 18 14 0.0000 4 195 600 3150 2925 [mod]\001
4 1 -1 0 0 0 20 0.0000 4 210 1170 3150 990 Sf:switch\001
1
2
3
4
5
6
7
8



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Numerical parameter file (CarnotCycle_input.txt)
# Generated by MTT at Mon Dec  8 20:05:30 GMT 1997

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$



# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


alpha = 0.553;

# Set the inputs
if ((t>=0.0)&&(t<1.0))		#Cooling
  u(1) = 300.0;			# Source temperature
  r    = 1e-5;			# Small r - isothermal
  u(2) = -alpha;		# Volume rate-of-change
endif;

if ((t>=1.0)&&(t<2.0))		#Compression
  u(1) = 300.0;			# Source temperature 
  r    = 1e5;			# Large resistance -- isentropic
  u(2) = -(0.8-alpha);		# Volume rate-of-change
  TopTemp = x(1)/(m_g*c_v);
endif;

if ((t>=2.0)&&(t<3.0))		#Heating

  u(1) = TopTemp;		# Source temperature
  r    = 1e-5;			# Small r - isothermal
  u(2) = (0.8-alpha);		# Volume rate-of-change
endif;

if (t>=3.0)			#Cooling
%  Temp = x(1)/(m_g*c_v);	# 
  u(1) = 300.0;			# Source temperature
  r    = 1e5;			# Large resistance -- no entropy flow
  u(2) = alpha;			# Volume rate-of-change
endif;



|







>
>
>







|
|
|



|
|
|
<



>
|
|
|



<
|
|
|

<
<

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35
36
37

38
39
40
41


42
# Input file (CarnotCycle_input.txt)
# Generated by MTT at Mon Dec  8 20:05:30 GMT 1997

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.1  2000/12/28 18:14:40  peterg
# %% To RCS
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


alpha = 0.553;

# Set the inputs
if ((t>=0.0)&&(t<1.0))		#Cooling
  carnotcycle__heat__u= 300.0;	# Source temperature
  carnotcycle__switch__u    = 1e10; # Large conductance - isothermal
  carnotcycle__work__u = -alpha;	# Volume rate-of-change
endif;

if ((t>=1.0)&&(t<2.0))		#Compression
  carnotcycle__heat__u = 300.0;	# Source temperature 
  carnotcycle__switch__u    = 0; # Small conductance -- isentropic
  carnotcycle__work__u = -(0.8-alpha); # Volume rate-of-change

endif;

if ((t>=2.0)&&(t<3.0))		#Heating
  TopTemp = x(1)/(m_g*c_v);
  carnotcycle__heat__u = TopTemp;	# Source temperature
  carnotcycle__switch__u    = 1e10; # Large conductance - isothermal
  carnotcycle__work__u = (0.8-alpha); # Volume rate-of-change
endif;

if (t>=3.0)			#Cooling

  carnotcycle__heat__u = 300.0;	# Source temperature
  carnotcycle__switch__u    = 0; # Small conductance -- isentropic
  carnotcycle__work__u = alpha;	# Volume rate-of-change
endif;



1
2
3
4
5
6
7
8
9
10
11
12
13
14




15
16
17

18
19
20
21



22
23
24
25

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41


42

%SUMMARY CarnotCycle: a simple closed thermodynamic cycle
%DESCRIPTION The Carnot cycle is a simple closed thermodynamic cycle
%DESCRIPTION with four parts:
%DESCRIPTION o Isentropic compression
%DESCRIPTION o Heat injection at constant temperature
%DESCRIPTION o Isentropic expansion
%DESCRIPTION o Heat extraction at constant temperature

%VAR P_0
%VAR T_0
%VAR V_0
%VAR TopTemp
%VAR alpha





%% Label file for system CarnotCycle (CarnotCycle_lbl.txt)

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$



% %% Revision 1.1  1998/07/21 15:18:18  peterg
% %% Initial revision
% %%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%% Each line should be of one of the following forms:
%	a comment (ie starting with %)
%	Component-name	CR_name	arg1,arg2,..argn
%	blank



% Component type Cycle
	cycle	none	ideal_gas;c_v;gamma_g;m_g

% Component type RT
	r		lin	flow,r

% Component type SS
	Heat	SS	external,internal


	Work	SS	internal,external

|
|
|
|
|
|
|

|
|
|
<
|

>
>
>
>
|

<
>
|
|
|
|
>
>
>
|
|
|
<
>

|
|
|
|



|


|
|

|
|
>
>
|
>
1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
27
28
29
30

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#SUMMARY CarnotCycle: a simple closed thermodynamic cycle
#DESCRIPTION The Carnot cycle is a simple closed thermodynamic cycle
#DESCRIPTION with four parts:
#DESCRIPTION o Isentropic compression
#DESCRIPTION o Heat injection at constant temperature
#DESCRIPTION o Isentropic expansion
#DESCRIPTION o Heat extraction at constant temperature

#PAR P_0
#PAR T_0
#PAR V_0

#PAR alpha

#NOTPAR ideal_gas
#NOTPAR	alpha
#NOTPAR	TopTemp

## Label file for system CarnotCycle (CarnotCycle_lbl.txt)


# ###############################################################
# ## Version control history
# ###############################################################
# ## $Id$
# ## $Log$
# ## Revision 1.2  1998/08/10 16:40:07  peterg
# ## Added VARs and parametrs
# ##
# ## Revision 1.1  1998/07/21 15:18:18  peterg
# ## Initial revision
# ##

# ###############################################################

## Each line should be of one of the following forms:
#	a comment (ie starting with #)
#	Component-name	CR_name	arg1,arg2,..argn
#	blank



# Component type Cycle
	cycle	none	ideal_gas;c_v;gamma_g;m_g

# Component type RT
	r		lin	flow,1

# Component type Se
	Heat	SS	external

# Component type Sf
	Work    SS	external
	switch  SS	external
1
2
3
4
5
6
7
8



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Numerical parameter file (CarnotCycle_numpar.txt)
# Generated by MTT at Mon Dec  8 20:02:31 GMT 1997

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$



# %% Revision 1.1  1998/03/04 11:49:01  peterg
# %% Initial revision
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# Initial states -- needed to choose an approppriate mass
P_0 = 1e5;
V_0 = 1;
T_0 = 300;

# Parameters
c_v = 	718.0; # Parameter c_v for CU
gamma_g = 1.4; # Parameter gamma for CU
m_g = 	P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU


r = 	1.0; # Parameter r for CarnotCycle










>
>
>











|
|

<
<
<
<

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25




26
# Numerical parameter file (CarnotCycle_numpar.txt)
# Generated by MTT at Mon Dec  8 20:02:31 GMT 1997

# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% Version control history
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# %% $Id$
# %% $Log$
# %% Revision 1.2  2000/12/28 18:14:40  peterg
# %% To RCS
# %%
# %% Revision 1.1  1998/03/04 11:49:01  peterg
# %% Initial revision
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# Initial states -- needed to choose an approppriate mass
P_0 = 1e5;
V_0 = 1;
T_0 = 300;

# Parameters
c_v = 	718.0;			# Parameter c_v for CU
gamma_g = 1.4;			# Parameter gamma for CU
m_g = 	P_0*V_0/(T_0*(gamma_g-1)*c_v); # Parameter m for CU





1
2
3
4
5
6
7
8



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

43
44
% Steady-state parameter file (CarnotCycle_sspar.r)
% Generated by MTT at Wed Mar  4 11:02:40 GMT 1998

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % $Id$
% % $Log$



% % Revision 1.1  1998/03/04 11:49:14  peterg
% % Initial revision
% %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



% Set a pressure of 1 bar
P_0 := 10^5;

% Unit initial volume
V_0 := 1;

% Internal energy
U_0 := P_0*V_0/(gamma_g-1);

% Set initial temperature of 300k
T_0 := 300;

% Deduce the mass of gas
m :=  U_0/(T_0*c_v);

% Entropy
S_0 := U_0/T_0;

% Steady-state states
MTTX1 := 	U_0;         % CarnotCycle_cycle_gas (c)
MTTX2 := 	V_0;         % CarnotCycle_cycle_gas (c)
MTTX3 := 	S_0;         % CarnotCycle_cycle_entropy (3)
MTTX4 := 	V_0;         % CarnotCycle_cycle_volume (3)

% Steady-state inputs
MTTU1 := 	0; % CarnotCycle (Heat)
MTTU2 := 	0; % CarnotCycle (Work)

;;END;









>
>
>








|


|





|


|







|
|


|

>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% Steady-state parameter file (CarnotCycle_sspar.r)
% Generated by MTT at Wed Mar  4 11:02:40 GMT 1998

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % $Id$
% % $Log$
% % Revision 1.2  2000/12/28 18:14:40  peterg
% % To RCS
% %
% % Revision 1.1  1998/03/04 11:49:14  peterg
% % Initial revision
% %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



% Set a pressure of 1 bar
%P_0 := 10^5;

% Unit initial volume
%V_0 := 1;

% Internal energy
U_0 := P_0*V_0/(gamma_g-1);

% Set initial temperature of 300k
%T_0 := 300;

% Deduce the mass of gas
m_g :=  U_0/(T_0*c_v);

% Entropy
S_0 := U_0/T_0;

% Steady-state states
MTTX1 := 	U_0;         % CarnotCycle_cycle_gas (c)
MTTX2 := 	V_0;         % CarnotCycle_cycle_gas (c)
MTTX3 := 	S_0;         % CarnotCycle_cycle_volume (3)
MTTX4 := 	V_0;         % CarnotCycle_cycle_entropy (3)

% Steady-state inputs
MTTU1 := 	T_0; % CarnotCycle (Heat)
MTTU2 := 	0; % CarnotCycle (Work)
MTTU3 := 	0; % Switch (conduction)
;;END;

1
2
3
4




5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21




22
23
24
25
26
27
28
29
30
31
32
33


#FIG 3.1
Portrait
Center
Metric




1200 2
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 2026 3151 3601 3151 3376 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 5176 3151 6751 3151 6526 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 6751 2926 6751 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 2026 2926 2026 3376
2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5
	 10350 5850 10350 450 675 450 675 5850 10350 5850
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 7425 2925 7425 3375
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 7426 3150 9001 3150 8776 3375
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 7065 2924 7065 1349 7290 1574




4 1 4 0 0 0 20 0.0000 4 240 735 3601 2926 [Heat]\001
4 1 -1 0 0 0 20 0.0000 4 255 1290 4411 3241 Cycle:cycle\001
4 1 4 0 0 0 20 0.0000 4 240 825 5176 2926 [Work]\001
4 2 -1 0 0 0 20 0.0000 4 195 960 1936 3241 SS:Heat\001
4 1 1 1 0 3 20 0.0000 4 210 690 2655 3465 dS/dT\001
4 1 1 1 0 3 20 0.0000 4 195 165 2700 2925 T\001
4 1 1 1 0 3 20 0.0000 4 195 165 6120 2925 P\001
4 1 1 1 0 3 20 0.0000 4 210 720 5985 3465 dV/dT\001
4 0 -1 0 0 0 20 0.0000 4 195 1050 9091 3241 SS:Work\001
4 1 1 1 0 3 30 0.0000 4 405 2085 5535 4500 Diesel cycle\001
4 1 -1 0 0 0 20 0.0000 4 195 135 7066 3241 1\001
4 1 -1 0 0 0 20 0.0000 4 195 375 7021 1261 R:r\001


|



>
>
>
>









<
<





|
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#FIG 3.2
Portrait
Center
Metric
A4      
100.00
Single
-2
1200 2
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 2026 3151 3601 3151 3376 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 5176 3151 6751 3151 6526 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 6751 2926 6751 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 2026 2926 2026 3376


2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 7425 2925 7425 3375
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 7426 3150 9001 3150 8776 3375
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 6975 2924 6975 1349 7200 1574
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 5176 1125 6751 1125 6526 1350
2 4 0 2 31 7 1 0 -1 0.000 0 0 7 0 0 5
	 10350 4950 675 4950 675 450 10350 450 10350 4950
4 1 4 0 0 0 20 0.0000 4 240 795 3601 2926 [Heat]\001
4 1 -1 0 0 0 20 0.0000 4 285 1440 4411 3241 Cycle:cycle\001
4 1 4 0 0 0 20 0.0000 4 255 900 5176 2926 [Work]\001
4 2 -1 0 0 0 20 0.0000 4 210 945 1936 3241 Sf:Heat\001
4 1 1 1 0 3 20 0.0000 4 210 735 2655 3465 dS/dT\001
4 1 1 1 0 3 20 0.0000 4 195 180 2700 2925 T\001
4 1 1 1 0 3 20 0.0000 4 195 180 6120 2925 P\001
4 1 1 1 0 3 20 0.0000 4 210 765 5985 3465 dV/dT\001
4 0 -1 0 0 0 20 0.0000 4 210 1080 9091 3241 Se:Work\001
4 1 1 1 0 3 30 0.0000 4 405 2160 5535 4500 Diesel cycle\001
4 1 -1 0 0 0 20 0.0000 4 195 150 7066 3241 1\001
4 0 -1 0 0 0 20 0.0000 4 195 825 6930 1215 FMR:r\001
4 1 4 0 0 0 20 0.0000 4 255 750 6705 945 [mod]\001
4 2 -1 0 0 0 20 0.0000 4 210 1170 5085 1215 Sf:Switch\001
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# %% Revision 1.1  2000/12/28 18:15:21  peterg
# %% To RCS
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


# Set the inputs

if ((t>=0.0)&&(t<1.0))		#Compression
  dieselcycle__heat = 0.0;	# Entropy flow
  r = 1e10;			# Big R to make a flow source 
  dieselcycle__work = 0.8*r;	#- Volume rate-of-change
  TopPressure = (gamma_g-1)*(x(1)/x(2))
endif;

if ((t>=1.0)&&(t<2.0))		#Heating

  dieselcycle__heat = 1000;	# Entropy flow
  r    = 1e4;			# small r constant pressure
  dieselcycle__work = TopPressure; # Pressure source
  Volume = x(4);
endif;

if ((t>=2.0)&&(t<3.0))		#Expansion
  dieselcycle__heat = 0.0;	# Entropy flow
  r = 1e10;			# Big R to make a flow source 
  dieselcycle__work = -(1-Volume)*r; # Volume rate-of-change
endif;

if (t>=3.0)			#Cooling
  Pressure = (gamma_g-1)*x(1)/x(2);
  dieselcycle__heat = -1000*(Pressure>1e5);	# Entropy flow
  r = 1e10;			# Big R to make a flow source 
  dieselcycle__work = 0.0*r;	# Volume rate-of-change
endif;







<

|
|
|
<



>
|
|
|




|
|
|




|
|
|

9
10
11
12
13
14
15

16
17
18
19

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# %% Revision 1.1  2000/12/28 18:15:21  peterg
# %% To RCS
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


# Set the inputs

if ((t>=0.0)&&(t<1.0))		#Compression
  dieselcycle__Heat__u = 0.0;	# Entropy flow
  dieselcycle__switch__u = 1/big; # Large R to make a flow source 
  dieselcycle__Work__u = 0.8/big;	#- Volume rate-of-change

endif;

if ((t>=1.0)&&(t<2.0))		#Heating
  TopPressure = (gamma_g-1)*(x(1)/x(2))
  dieselcycle__Heat__u = 1000;	# Entropy flow
  dieselcycle__switch__u = big; # small r constant pressure
  dieselcycle__Work__u = TopPressure; # Pressure source
  Volume = x(4);
endif;

if ((t>=2.0)&&(t<3.0))		#Expansion
  dieselcycle__Heat__u = 0.0;	# Entropy flow
  dieselcycle__switch__u = 1/big; # Large R to make a flow source 
  dieselcycle__Work__u = -(1-Volume)*big; # Volume rate-of-change
endif;

if (t>=3.0)			#Cooling
  Pressure = (gamma_g-1)*x(1)/x(2);
  dieselcycle__Heat__u = -1000*(Pressure>1e5);	# Entropy flow
  dieselcycle__switch__u = 1/big; # Large R to make a flow source 
  dieselcycle__Work__u = 0.0;	# Zero volume rate-of-change
endif;
1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
#SUMMARY DieselCycle:a simple closed thermodynamic cycle
#DESCRIPTION The Diesel cycle is a simple closed thermodynamic cycle
#DESCRIPTION with four parts:
#DESCRIPTION o Isentropic compression
#DESCRIPTION o Heating at constant pressure
#DESCRIPTION o Isentropic expansion
#DESCRIPTION o Cooling at constant volume
  
#PAR P_0
#PAR T_0
#PAR V_0
#PAR S_0
#PAR U_0


### NB TopPressure should be computed within input.txt !!!
#PAR TopPressure
#PAR Volume
#PAR Pressure

#NOTPAR ideal_gas













>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#SUMMARY DieselCycle:a simple closed thermodynamic cycle
#DESCRIPTION The Diesel cycle is a simple closed thermodynamic cycle
#DESCRIPTION with four parts:
#DESCRIPTION o Isentropic compression
#DESCRIPTION o Heating at constant pressure
#DESCRIPTION o Isentropic expansion
#DESCRIPTION o Cooling at constant volume
  
#PAR P_0
#PAR T_0
#PAR V_0
#PAR S_0
#PAR U_0
#PAR big

### NB TopPressure should be computed within input.txt !!!
#PAR TopPressure
#PAR Volume
#PAR Pressure

#NOTPAR ideal_gas
41
42
43
44
45
46
47
48
49
50
51


52






# Component type Cycle
	cycle	none	ideal_gas;c_v;gamma_g;m_g	

# Component type R
	r		lin	flow,r

# Component type SS
	Heat	SS	internal,external


	Work	SS	external,internal










|

|
|
>
>
|
>
>
>
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58



# Component type Cycle
	cycle	none	ideal_gas;c_v;gamma_g;m_g	

# Component type R
	r		lin	flow,1

# Component type Sf
	Heat	SS	external

# Component type Se
	Work	SS	external

# Component type Sf
	Switch	SS	external
9
10
11
12
13
14
15


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# %% Revision 1.1  2000/12/28 18:15:21  peterg
# %% To RCS
# %%
# %% Revision 1.1  1998/03/04 11:45:49  peterg
# %% Initial revision
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



# Initial states -- needed to choose an approppriate mass
P_0 = 1e5;
V_0 = 1;
T_0 = 300;

# Parameters
c_v = 	718.0;			# Parameter c_v for CU
gamma_g = 1.4;			# Parameter gamma_g for CU
m_g = 	P_0*V_0/(T_0*(gamma_g-1)*c_v);# Parameter m for CU

## Removed by MTT on Wed Aug  6 17:32:59 BST 2003: pressure	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003
r	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003
s_0	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003
## Removed by MTT on Wed Aug  6 17:32:59 BST 2003: ## Removed by MTT on Wed Aug  6 17:32:59 BST 2003: toppressure	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003
u_0	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003
## Removed by MTT on Wed Aug  6 17:32:59 BST 2003: volume	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003
pressure	= 1.0; # Added by MTT on Wed Aug 06 17:36:47 BST 2003
toppressure	= 1.0; # Added by MTT on Wed Aug 06 17:36:47 BST 2003
volume	= 1.0; # Added by MTT on Wed Aug 06 17:36:47 BST 2003







>
>












<







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
# %% Revision 1.1  2000/12/28 18:15:21  peterg
# %% To RCS
# %%
# %% Revision 1.1  1998/03/04 11:45:49  peterg
# %% Initial revision
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

big = 1e5;			# Large number

# Initial states -- needed to choose an approppriate mass
P_0 = 1e5;
V_0 = 1;
T_0 = 300;

# Parameters
c_v = 	718.0;			# Parameter c_v for CU
gamma_g = 1.4;			# Parameter gamma_g for CU
m_g = 	P_0*V_0/(T_0*(gamma_g-1)*c_v);# Parameter m for CU

## Removed by MTT on Wed Aug  6 17:32:59 BST 2003: pressure	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003

s_0	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003
## Removed by MTT on Wed Aug  6 17:32:59 BST 2003: ## Removed by MTT on Wed Aug  6 17:32:59 BST 2003: toppressure	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003
u_0	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003
## Removed by MTT on Wed Aug  6 17:32:59 BST 2003: volume	= 1.0; # Added by MTT on Wed Aug 06 17:31:21 BST 2003
pressure	= 1.0; # Added by MTT on Wed Aug 06 17:36:47 BST 2003
toppressure	= 1.0; # Added by MTT on Wed Aug 06 17:36:47 BST 2003
volume	= 1.0; # Added by MTT on Wed Aug 06 17:36:47 BST 2003
1
2
3
4
5
6
7
8



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% Steady-state parameter file (DieselCycle_sspar.r)
% Generated by MTT at Wed Mar  4 11:02:40 GMT 1998

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % $Id$
% % $Log$



% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Set a pressure of 1 bar
P_0 := 10^5;

% Unit initial volume
V_0 := 1;

% Internal energy
U_0 := P_0*V_0/(gamma_g-1);

% Set initial temperature of 300k
T_0 := 300;

% Deduce the mass of gas
m :=  U_0/(T_0*c_v);

% Entropy
S_0 := U_0/T_0;

% Steady-state states
MTTX1 := 	U_0;         % DieselCycle_cycle_gas (c)
MTTX2 := 	V_0;         % DieselCycle_cycle_gas (c)








>
>
>




|


|





|


|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% Steady-state parameter file (DieselCycle_sspar.r)
% Generated by MTT at Wed Mar  4 11:02:40 GMT 1998

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % $Id$
% % $Log$
% % Revision 1.1  2000/12/28 18:15:21  peterg
% % To RCS
% %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Set a pressure of 1 bar
%P_0 := 10^5;

% Unit initial volume
%V_0 := 1;

% Internal energy
U_0 := P_0*V_0/(gamma_g-1);

% Set initial temperature of 300k
%T_0 := 300;

% Deduce the mass of gas
m_g :=  U_0/(T_0*c_v);

% Entropy
S_0 := U_0/T_0;

% Steady-state states
MTTX1 := 	U_0;         % DieselCycle_cycle_gas (c)
MTTX2 := 	V_0;         % DieselCycle_cycle_gas (c)
1
2
3
4




5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#FIG 3.1
Portrait
Center
Metric




1200 2
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 2026 3151 3601 3151 3376 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 5176 3151 6751 3151 6526 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 6751 2926 6751 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 2026 2926 2026 3376
2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5
	 8325 5850 8325 450 675 450 675 5850 8325 5850
4 1 -1 0 0 0 20 0.0000000 4 270 1440 4411 3241 Cycle:cycle\001
4 0 -1 0 0 0 20 0.0000000 4 210 1110 6886 3241 SS:Work\001
4 2 -1 0 0 0 20 0.0000000 4 210 990 1936 3241 SS:Heat\001
4 1 1 1 0 3 20 0.0000000 4 210 735 2655 3465 dS/dT\001
4 1 1 1 0 3 20 0.0000000 4 210 180 2700 2925 T\001
4 1 1 1 0 3 20 0.0000000 4 210 180 6120 2925 P\001
4 1 1 1 0 3 20 0.0000000 4 210 765 5985 3465 dV/dT\001
4 1 1 1 0 3 30 0.0000000 4 390 1800 4365 4770 Otto cycle\001
|



>
>
>
>











|
|
|
|
|
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#FIG 3.2
Portrait
Center
Metric
A4      
100.00
Single
-2
1200 2
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 2026 3151 3601 3151 3376 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 3
	 5176 3151 6751 3151 6526 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 6751 2926 6751 3376
2 1 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 2
	 2026 2926 2026 3376
2 4 0 1 31 7 1 0 -1 0.000 0 0 7 0 0 5
	 8325 5850 8325 450 675 450 675 5850 8325 5850
4 1 -1 0 0 0 20 0.0000 4 285 1440 4411 3241 Cycle:cycle\001
4 0 -1 0 0 0 20 0.0000 4 210 1050 6886 3241 Sf:Work\001
4 2 -1 0 0 0 20 0.0000 4 210 945 1936 3241 Sf:Heat\001
4 1 1 1 0 3 20 0.0000 4 210 735 2655 3465 dS/dT\001
4 1 1 1 0 3 20 0.0000 4 195 180 2700 2925 T\001
4 1 1 1 0 3 20 0.0000 4 195 180 6120 2925 P\001
4 1 1 1 0 3 20 0.0000 4 210 765 5985 3465 dV/dT\001
4 1 1 1 0 3 30 0.0000 4 405 1815 4365 4770 Otto cycle\001
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# %% Initial revision
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# Set the inputs

if ((t>=0.0)&&(t<1.0))		#Compression
  OttoCycle__Heat = 0.0;	# Entropy flow
  OttoCycle__Work = -0.8;	# Volume rate-of-change
endif;

if ((t>=1.0)&&(t<2.0))		#Heating
  OttoCycle__Heat = 1000;	# Entropy flow
  OttoCycle__Work = 0.0;	# Volume rate-of-change
endif;

if ((t>=2.0)&&(t<3.0))		#Expansion
  OttoCycle__Heat = 0.0;	# Entropy flow
  OttoCycle__Work = 0.8;	# Volume rate-of-change
endif;

if (t>=3.0)			#Cooling
  OttoCycle__Heat = -1000;	# Entropy flow
  OttoCycle__Work = 0.0;	# Volume rate-of-change
endif;











|
|



|
|



|
|



|
|





17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# %% Initial revision
# %%
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

# Set the inputs

if ((t>=0.0)&&(t<1.0))		#Compression
  OttoCycle__Heat__u = 0.0;	# Entropy flow
  OttoCycle__Work__u = -0.8;	# Volume rate-of-change
endif;

if ((t>=1.0)&&(t<2.0))		#Heating
  OttoCycle__Heat__u = 1000;	# Entropy flow
  OttoCycle__Work__u = 0.0;	# Volume rate-of-change
endif;

if ((t>=2.0)&&(t<3.0))		#Expansion
  OttoCycle__Heat__u = 0.0;	# Entropy flow
  OttoCycle__Work__u = 0.8;	# Volume rate-of-change
endif;

if (t>=3.0)			#Cooling
  OttoCycle__Heat__u = -1000;	# Entropy flow
  OttoCycle__Work__u = 0.0;	# Volume rate-of-change
endif;




40
41
42
43
44
45
46
47
48
49
#	blank



# Component type Cycle
	cycle	none	ideal_gas;c_v;gamma_g;m_g	

# Component type SS
	Heat	SS	internal,external
	Work	SS	internal,external







|
|
|
40
41
42
43
44
45
46
47
48
49
#	blank



# Component type Cycle
	cycle	none	ideal_gas;c_v;gamma_g;m_g	

# Component type Sf
	Heat	SS	external
	Work	SS	external
1
2
3
4
5
6
7
8



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
% Steady-state parameter file (OttoCycle_sspar.r)
% Generated by MTT at Wed Mar  4 11:02:40 GMT 1998

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % $Id$
% % $Log$



% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Set a pressure of 1 bar
P_0 := 10^5;

% Unit initial volume
V_0 := 1;

% Internal energy
U_0 := P_0*V_0/(gamma_g-1);

% Set initial temperature of 300k
T_0 := 300;

% Deduce the mass of gas
m :=  U_0/(T_0*c_v);

% Entropy
S_0 := U_0/T_0;

% Steady-state states
MTTX1 := 	U_0;         % OttoCycle_cycle_gas (c)
MTTX2 := 	V_0;         % OttoCycle_cycle_gas (c)








>
>
>




|


|





|


|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% Steady-state parameter file (OttoCycle_sspar.r)
% Generated by MTT at Wed Mar  4 11:02:40 GMT 1998

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % $Id$
% % $Log$
% % Revision 1.1  2000/12/28 18:15:52  peterg
% % To RCS
% %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Set a pressure of 1 bar
%%P_0 := 10^5;

% Unit initial volume
%%V_0 := 1;

% Internal energy
U_0 := P_0*V_0/(gamma_g-1);

% Set initial temperature of 300k
%%T_0 := 300;

% Deduce the mass of gas
m_g :=  U_0/(T_0*c_v);

% Entropy
S_0 := U_0/T_0;

% Steady-state states
MTTX1 := 	U_0;         % OttoCycle_cycle_gas (c)
MTTX2 := 	V_0;         % OttoCycle_cycle_gas (c)

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]