Commit 47dc264b authored by Greenwood, Scott's avatar Greenwood, Scott
Browse files

update examples and add lessen

parent 4691b192
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2,10 +2,13 @@

This repository is for the creation of thermal hydraulics cooling system models for POWER9 type datacenters using the ExaDigit AutoCSM hierarchal templated approach.

- The current library provides basic models for creation of a datacenter. Future work should create different or modified models for different versions of subsystems and controls.

# Contents
- data - folder to house data for testing models
- json - input specifications for autogenerating the models
- POWER9Datacenter - Modelica library following AutoCSM templated approach
- fmus - folder containing pregenerated license-free fmus of the select example systems

# Dependencies
- Modelica IDE: Currently only tested with Dymola
@@ -31,5 +34,3 @@ At this stage you can use or explore. Suggested options include:
- use the FMU created standalone or with ExaDigit,
- open up the project in Dymola using the autogenerated 'setup.mos' file and modify or explore the system model
- modify or create new input_specification files (see 'json' folder)
 No newline at end of file

json/lassen.json

0 → 100644
+51 −0
Original line number Diff line number Diff line
{
	"InstanceName":"simulator",
	"Structure":{"n":1},
	"ModelClass":"v0",
    "Systems": [
        {
            "Name": "Datacenter",
			"InstanceName":"datacenter",
			"Structure":{"n":1},
            "Systems":[
                {
                    "Name": "CoolingBlock",
					"InstanceName":"computeBlock",
					"Structure":{"n":44},
                    "ModelClass":"v1",
                    "Systems":[
                        {
                            "Name": "CDU",
							"InstanceName":"cdu",
							"Structure":{"n":1},
                            "Systems":[{}]
                        },
                        {
                            "Name": "Cabinet",
							"Structure":{"n":1},
							"InstanceName":"cabinet",
							"ModelClass":"v1",
                            "Systems":[{}]
                        }]
                }]
        },
        {
            "Name": "CentralEnergyPlant",
			"InstanceName":"centralEnergyPlant",
			"Structure":{"n":1},
            "Systems":[
                {
                    "Name": "IntermediateLoop",
					"InstanceName":"intermediateLoop",
					"Structure":{"n":1},
                    "Systems":[{}]
                },
                {
                    "Name": "CoolingTowerLoop",
					"InstanceName":"coolingTowerLoop",
					"Structure":{"n":1},
					"ModelClass":"v0",
                    "Systems":[{}]
                }]
        }]
}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
                {
                    "Name": "CoolingBlock",
					"InstanceName":"computeBlock",
					"Structure":{"n":51},
					"Structure":{"n":49},
                    "ModelClass":"v1",
                    "Systems":[
                        {
+27 −24
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ import sys
base_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(base_path,r'submodules/AutoCSM/AutoCSM'))
from auto_csm import AutoCSM
from pathlib import Path

if __name__ == "__main__":

@@ -22,11 +23,13 @@ if __name__ == "__main__":
    csm.terminal_animation = False
    
    # Load the JSON specification
    csm.input_specification = 'json/marconi100.json'
    # csm.input_specification = '../data/input_specification_default_simple.json'# This uses the default ModelClass from the parent model if not specified in the JSON.
    datacenters = ['json/marconi100.json', 'json/summit.json', 'json/lassen.json']
    for datacenter in datacenters:
        # JSON describing the model
        csm.input_specification = datacenter
        
        # Set the path to output created files
    csm.output_path = 'temp'
        csm.output_path = Path('temp') / Path(datacenter).stem
    
        # Project path (path to Modelica library. This will also update the project name)
        csm.project_path = 'POWER9Datacenter'
+9 −3
Original line number Diff line number Diff line
@@ -75,8 +75,14 @@ if __name__ == "__main__":
    var_names = [name for name in signals.dtype.names if name != 'time']
        
    #%% Prepare the inputs for simulating the FMU
    datacenters = ['marconi100', 'summit', 'lassen']
    stop_times = [2000, 86400]
    
    folder = 'temp/{}'.format(datacenters[1]) # Change selected datacenter here
    stop_time = stop_times[0]
    
    # Location of FMU
    fmu_filename = 'temp/Simulator.fmu'
    fmu_filename = '{}/Simulator.fmu'.format(folder)
    
    # Read FMU
    fmpy.dump(fmu_filename)
@@ -108,11 +114,11 @@ if __name__ == "__main__":
    #%% Simulate the FMU
    tt = helper_functions.TicToc()
    tt.tic()
    result = fmpy.simulate_fmu(fmu_filename,input=signals,stop_time=86400, output=outputs, output_interval=15, debug_logging=True)#,output_interval=1)
    result = fmpy.simulate_fmu(fmu_filename,input=signals,stop_time=stop_time, output=outputs, output_interval=15, debug_logging=True)#,output_interval=1)
    tt.toc()
    
    # Save to file. Can load with pf.loadPickle(filename)
    pf.toPickle('temp/result', result) 
    pf.toPickle(f'{folder}/result', result) 
    
    #%% Plot results
    # Path to output