/[ascend]/trunk/models/johnpye/datareader/testairprops.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/datareader/testairprops.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2082 - (show annotations) (download) (as text)
Wed Sep 23 10:50:28 2009 UTC (10 years, 10 months ago) by jpye
File MIME type: text/x-ascend
File size: 1165 byte(s)
A silly little model that tests out Jose's interpolation code with air props.
1 REQUIRE "johnpye/thermo_types.a4c";
2 IMPORT "johnpye/datareader/datareader";
3
4 MODEL airdataconfig;
5 filename IS_A symbol_constant;
6 filename :== 'johnpye/datareader/air-props.csv';
7 format IS_A symbol_constant;
8 format :== 'CSV';
9 parameters IS_A symbol_constant;
10 parameters :== '1,2,3,5';
11 END airdataconfig;
12
13 MODEL base;
14 END base;
15
16 MODEL airprops(
17 T WILL_BE temperature;
18 ) REFINES base;
19 rho IS_A mass_density;
20 cp, cp_uncorrected IS_A specific_heat_capacity;
21 mu, mu_uncorrected IS_A viscosity;
22 k IS_A thermal_conductivity;
23
24 config IS_A airdataconfig;
25 reader:datareader(
26 T : INPUT;
27 rho, cp_uncorrected, mu_uncorrected, k : OUTPUT;
28 config : DATA
29 );
30
31 mu = mu_uncorrected / 1e5;
32 cp = cp_uncorrected * 1e3;
33 END airprops;
34
35 MODEL testairprops;
36
37 T[1..10] IS_A temperature;
38
39 props[1..10] IS_A base;
40 FOR i IN [1..10] CREATE
41 props[i] IS_REFINED_TO airprops(T[i]);
42 END FOR;
43
44 METHODS
45 METHOD on_load;
46 FIX T[1..10];
47 T[1] := 100 {K};
48 T[10] := 2500 {K};
49 T[2] := 150 {K};
50 T[3] := 2400 {K};
51 T[4] := 101 {K};
52 T[5] := 2499 {K};
53 T[6] := 99 {K};
54 T[7] := 2501 {K};
55 T[8] := 3000 {K};
56 T[9] := -400 {K};
57 T[10] := 273.15 {K};
58 END on_load;
59 END testairprops;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22