aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-01-20 18:10:06 -0500
committerSam Anthony <sam@samanthony.xyz>2024-01-20 18:10:06 -0500
commit9ad538983290fbd62da7f8d6db5a6dfe123a25c3 (patch)
treea61d3c4d0639e2d68cd60cd20ae840fdd357fabf /main.go
parentc952a096a161e991a54a569b71c7bb773b583eb3 (diff)
downloadvolute-9ad538983290fbd62da7f8d6db5a6dfe123a25c3.zip
extract default values to constants
Diffstat (limited to 'main.go')
-rw-r--r--main.go27
1 files changed, 20 insertions, 7 deletions
diff --git a/main.go b/main.go
index 6a24964..aaf4264 100644
--- a/main.go
+++ b/main.go
@@ -14,19 +14,32 @@ const (
airMolarMass = 0.0289647 // kg/mol
)
+var (
+ defaultDisplacement = 2 * Litre
+ defaultSpeed int32 = 2000
+ defaultVE int32 = 80
+ defaultTemperature = Temperature{25, Celcius}
+)
+
+var (
+ defaultManufacturer = "borgwarner"
+ defaultSeries = "efr"
+ defaultModel = "6258"
+)
+
// Number of data points on the compressor map.
var numPoints = 1
var (
- displacement = 2000 * CubicCentimetre
+ displacement = defaultDisplacement
volumeUnitIndex int32
// Angular crankshaft speed in RPM.
- speed = []int32{2000}
+ speed = []int32{defaultSpeed}
- volumetricEfficiency = []int32{80}
+ volumetricEfficiency = []int32{defaultVE}
- intakeAirTemperature = []Temperature{{25, Celcius}}
+ intakeAirTemperature = []Temperature{defaultTemperature}
temperatureUnitIndex int32
manifoldPressure = []Pressure{AtmosphericPressure()}
@@ -77,9 +90,9 @@ var (
)
func init() {
- manufacturer := "garrett"
- series := "g"
- model := "25-660"
+ manufacturer := defaultManufacturer
+ series := defaultSeries
+ model := defaultModel
c, ok := Compressors[manufacturer][series][model]
if !ok {
fmt.Printf("compressor.Compressors()[\"%s\"][\"%s\"][\"%s\"] does not exist.\n",