domain

Domain model keywords

Syntax

domain
variables
variables(Balancing = true)
parameters

Description

domain begins the domain model class definition, which is terminated by an end keyword. Only blank lines and comments can precede domain. You must place a domain model class definition in a file of the same name with a file name extension of .ssc.

variables begins an Across variables declaration block, which is terminated by an end keyword. This block contains declarations for all the Across variables associated with the domain. A domain model class definition can contain multiple Across variables, combined in a single variables block. This block is required.

variables(Balancing = true) begins a Through variables declaration block, which is terminated by an end keyword. This block contains declarations for all the Through variables associated with the domain. A domain model class definition can contain multiple Through variables, combined in a single through block. This block is required.

Each variable is defined as a value with unit. See Declaring Through and Across Variables for a Domain for more information.

parameters begins a domain parameters declaration block, which is terminated by an end keyword. This block contains declarations for domain parameters. These parameters are associated with the domain and can be propagated through the network to all components connected to the domain. This block is optional.

See Propagation of Domain Parameters for more information.

Table of Attributes

For declaration member attributes, see Attribute Lists.

Examples

This file, named rotational.ssc, declares a mechanical rotational domain, with angular velocity as an Across variable and torque as a Through variable.

domain rotational
% Define the mechanical rotational domain
% in terms of across and through variables

  variables
    w = { 1 , 'rad/s' }; % angular velocity
  end

  variables(Balancing = true)
    t = { 1 , 'N*m' }; % torque
  end

end

This file, named t_hyd.ssc, declares a hydraulic domain, with pressure as an Across variable, flow rate as a Through variable, and an associated domain parameter, fluid temperature.

domain t_hyd
  variables
    p = { 1e6, 'Pa' }; % pressure
  end
  variables(Balancing = true)
    q = { 1e-3, 'm^3/s' }; % flow rate
  end
  parameters
    t = { 303, 'K' }; % fluid temperature
  end
end

See Also

component

Was this topic helpful?