Skip to content

Commit

Permalink
Added saab Embrace use case to test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
robha67 authored and lochel committed Apr 12, 2021
1 parent 78d2568 commit 174e966
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
16 changes: 16 additions & 0 deletions testsuite/Aircraft_DT/CONOPS.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
time,Alt,Mach,heatLoad,WGT_ON_WHL
0,0,0.2,500,1
60,0,0.2,500,1
60,0,0.2,500,0
110,8000,0.8,500,0
460,8000,0.8,500,0
460,8000,0.8,3500,0
580,8000,0.8,3500,0
640,1000,1.3,3500,0
640,1000,1.3,500,0
700,1000,1.3,500,0
750,8000,0.8,500,0
1100,8000,0.8,500,0
1150,0,0.2,500,0
1150,0,0.2,500,1
1200,0,0,500,1
Binary file added testsuite/Aircraft_DT/Embrace.ssp
Binary file not shown.
64 changes: 64 additions & 0 deletions testsuite/Aircraft_DT/SimulateSSP.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 21 10:30:26 2020
@author: robha67
"""
import OMSimulator

#OMSimulator.OMSimulator()
oms=OMSimulator.OMSimulator()
a=oms.getVersion()
print(a)
oms.setCommandLineOption("--suppressPath=true --wallTime=true --progressBar=true")


oms.importFile("Embrace.ssp")
oms.addSubModel("model.root.BC", "CONOPS.csv")

##----------------- Connections to BC files ----------------------------
#BC -> Consumer
oms.addConnection("model.root.Consumer.Alt","model.root.BC.Alt")
oms.addConnection("model.root.Consumer.Mach","model.root.BC.Mach")
oms.addConnection("model.root.Consumer.heatLoad","model.root.BC.heatLoad")

# #BC -> ECS_HW
oms.addConnection("model.root.ECS_HW.Alt","model.root.BC.Alt")
oms.addConnection("model.root.ECS_HW.Mach","model.root.BC.Mach")

# #BC -> ECS_SW
oms.addConnection("model.root.ECS_SW.WGT_ON_WHL","model.root.BC.WGT_ON_WHL")

# #BC -> Atmos
oms.addConnection("model.root.Atmos.Alt","model.root.BC.Alt")
oms.addConnection("model.root.Atmos.Ma","model.root.BC.Mach")
# #-----------------------------------------------------------------------

#set params
oms.setReal("model.root.ECS_SW.PID.k", 10)
oms.setReal("model.root.ECS_HW.eCS.MaxCoolPower.k", 5)
oms.setInteger("model.root.ECS_HW.coolinPackAir.looptype", 2)
oms.setInteger("model.root.ECS_HW.phSrc.looptype", 2)
oms.setInteger("model.root.ECS_HW.pipeB1.looptype", 2)

# #simulation settings
#oms.setResultFile("model", "ReferenceResults_L=5_CONOPS.mat")
oms.setResultFile("model", "sim_results.mat")
oms.setStopTime("model", 1200)
oms.setFixedStepSize("model", 1e-3)
oms.setLoggingInterval("model", 1)
oms.exportDependencyGraphs("model.root","init.dot","event.dot","simulation.dot")

oms.instantiate("model")
oms.initialize("model")
print("info: Initialize:")
print("info: model.root.ECS_HW.coolinPackAir.looptype: " , oms.getInteger("model.root.ECS_HW.coolinPackAir.looptype")[0])
print("info: model.root.ECS_SW.PID.k : " , oms.getReal("model.root.ECS_HW.eCS.MaxCoolPower.k")[0])
print("info: model.root.ECS_SW.PID.k : " , oms.getReal("model.root.ECS_SW.PID.k")[0])
print("info: model.root.ECS_HW.pipeB1.L : " , oms.getReal("model.root.ECS_HW.pipeB1.L")[0])
print("info: model.root.ECS_HW.pipeB.L : " , oms.getReal("model.root.ECS_HW.pipeB.L")[0])
print("info: model.root.ECS_HW.pipeA.L : " , oms.getReal("model.root.ECS_HW.pipeA.L")[0])

oms.simulate("model")
oms.terminate("model")
oms.delete("model")

0 comments on commit 174e966

Please sign in to comment.