Initial Checkin
[sw/motorsim] / src / com / billkuker / rocketry / motorsim / CylindricalChamber.java
1 package com.billkuker.rocketry.motorsim;\r
2 \r
3 import javax.measure.quantity.Length;\r
4 import javax.measure.quantity.Pressure;\r
5 import javax.measure.quantity.Volume;\r
6 import javax.measure.unit.SI;\r
7 \r
8 import org.jscience.physics.amount.Amount;\r
9 \r
10 public class CylindricalChamber implements Chamber {\r
11         \r
12         private Amount<Length> length;\r
13         \r
14         private Amount<Length> iD;\r
15 \r
16         @Override\r
17         public Amount<Pressure> burstPressure() {\r
18                 return null;\r
19         }\r
20 \r
21         @Override\r
22         public Amount<Volume> chamberVolume() {\r
23                 return iD.divide(2).pow(2).times(Math.PI).times(length).to(SI.CUBIC_METRE);\r
24         }\r
25 \r
26         public Amount<Length> getLength() {\r
27                 return length;\r
28         }\r
29 \r
30         public void setLength(Amount<Length> length) {\r
31                 this.length = length;\r
32         }\r
33 \r
34         public Amount<Length> getID() {\r
35                 return iD;\r
36         }\r
37 \r
38         public void setID(Amount<Length> id) {\r
39                 iD = id;\r
40         }\r
41 \r
42 }\r