Skip to content

Intro_Course_2_5

Jason Harvey edited this page Feb 19, 2021 · 1 revision

Intro Course 2.5: Initial Conditions

Config & Input vs. Default Data

GUNNS is designed to allow maximum flexibility in defining initial conditions (I.C.) The I.C. of a network and all of its contained objects are defined with a combination of “Config” and “Input” data:

  • “Config” data is any I.C. parameter that is not meant to change during run-time. They’re intended to be constant. Things like the flow coefficient of a valve, the conductance of a resistor, the lump mass of a thermal capacitor, etc.
  • “Input” data is any I.C. parameter that can change during run-time. Things like a valve’s or a switch’s position, a fan’s speed, etc.

Although we call them different names and they mean conceptually different things, most GUNNS classes actually treat both config & input data exactly the same. Some config data are allowed to change in run-time, and some input data never actually change, etc. So the distinction between config & input data is largely moot; we just mention it since you’ll be seeing these a lot when you use or develop GUNNS.

GUNNS does not use Trick “Default Data” jobs. Rather, the default data are the hard-coded initial values of the config & input data in a network’s constructor. The user defines these values in GunnsDraw. They are saved within the GunnsDraw drawing, and exported into the network’s constructor when the network code is auto-generated from the drawing.

Run-Time Initialization Process

  • Construction (default data): The Network and all contained objects are constructed with default values for their config & input data I.C.
    • The default values come from from the shape data set in the GunnsDraw drawing.
  • Input File: Config & input data values can be overridden by the Trick Input Processor (Input File).
    • All config & input data objects & attributes are public-scope all the way down from the Trick Sim Object. This allows access from the Input Processor.
  • Initialize Job: The Network’s initialize method is called from a Trick initialization job.
    • The Network initializes its contained objects with their corresponding config & input data objects:
      • The object first initializes its base class with the same config & input data objects, and this pattern repeats so that the objects are initialized from their base class on up.
      • After the object’s base class has been initialized, the initialize method continues by copying the config & input values from the config & input data objects into the object’s internal protected attributes, and may also derive other internal state initial values from the config & input data.

See Also:

Run-Time Architecture: Config & Input Data Classes
Trick Sim Products: Sim Object Class
Trick Sim Products: Input Files

Previous Page / Next Page

Clone this wiki locally