ThermalLoadCaseSetup#

Qualified name: load_cases.thermal_load_case.api.thermal_load_case_api.ThermalLoadCaseSetup

class load_cases.thermal_load_case.api.thermal_load_case_api.ThermalLoadCaseSetup(item: ThermalLoadCase)[source]#

Bases: LoadCaseSetupPipeline, DataTableDependentLoadsHandlerApiMixin

The API handler for thermal load cases

The following example shows how to create a thermal load case using the API, it is assumed that these steps were performed in each of the examples for other methods in this class.

Example

>>> from more.api import ApiGateway
>>> api = ApiGateway(proj=proj)
>>> simulation_setup = api.create_simulation_setup()
>>> lcc_setup = simulation_setup.create_load_case_container_setup().set_name(name='Example LCC')
>>> load_case_setup = lcc_setup.create_load_case_setup(lc_type='Thermal load case').set_name(name='Example LC')

The next example shows how to get an API object for an already existing load case.

Example

>>> from more.api import ApiGateway
>>> api = ApiGateway(proj=proj)
>>> simulation_setup = api.create_simulation_setup()
>>> lcc_setup = simulation_setup.create_load_case_container_setup().set_name(name='Example LCC')
>>> load_case_setup = lcc_setup.get_load_case_setup(name='Example LC') # The load case must already exist

Methods

create_load_setup

Creates a load of a specified type

get_data_table_query_config

Returns the api object for setting up the data table query for this load case

get_load_setup

Gets a load setup object for an existing load

get_name

Returns the name of the load case

remove_load_setup

Removes the load under the specified index

set_data_table_by_name

Sets the data table to be used in this load case

set_name

Sets the name of the load case

set_time_dependent_data_bool

Sets whether data table data should be used in the load case

set_time_dependent_data_column_index

Deprecated method

set_time_dependent_data_table_by_name

Deprecated method

Attributes

available_data_table_names

Returns the names of compatible data tables

available_data_tables_dict

Deprecated method

property available_data_table_names: List[str]#

Returns the names of compatible data tables

Example

>>> print("Available data tables: {}".format(load_case_setup.available_data_table_names)) # To check which data tables are available
Available data tables: ...
Returns:

available_data_tables – A list with the names of compatible data tables

Return type:

Dict(str, str)

property available_data_tables_dict: Dict[str, str]#

Deprecated method

Deprecated

available_data_tables_dict will be removed in a future MORe release, it is replaced by available_data_table_names()

create_load_setup(load_type: str) LoadSetup[source]#

Creates a load of a specified type

Example

>>> heat_flow_setup = load_case_setup.create_load_setup(load_type='Heat flow')
>>> heat_flux_load_setup = load_case_setup.create_load_setup(load_type='Heat flux')
Parameters:

index (int) – The index of the load in the load table

Returns:

LoadSetup

Return type:

LoadSetup

Raises:
  • NameNotFoundError – Raised if not load with the specified type was found

  • NotCompatibleError – Raised if the specified load type exists, but is not compatible with this load case

get_data_table_query_config()[source]#

Returns the api object for setting up the data table query for this load case

Example

>>> print("Available data tables: {}".format(load_case_setup.available_data_table_names)) # To check which data tables are available
Available data tables: ...
>>> load_case_setup = load_case_setup \
... .set_data_table_by_name(data_table_name='data_table_name') \
... .set_time_dependent_data_bool(value=True)
>>> query_config = load_case_setup.get_data_table_query_config()
Returns:

An object for configuring the data table querying in the load case

Return type:

Query config

Raises:

NotCompatibleError – Raised if the current load case configuration is not compatible with a query config object

get_load_setup(index: int) LoadSetup[source]#

Gets a load setup object for an existing load

Example

>>> load_setup = load_case_setup.get_load_setup(index=1) # Two loads must already exist
Parameters:

index (int) – The index of the load in the load table

Returns:

LoadSetup

Return type:

LoadSetup

Raises:

TypeError – Raised if the index is not an integer

get_name() str[source]#

Returns the name of the load case

Example

>>> load_case_setup.set_name(name='new_name')
<more...>
>>> load_case_setup.get_name()
'new_name'
Returns:

name – The name of the load case

Return type:

str

remove_load_setup(index: int) ThermalLoadCaseSetup[source]#

Removes the load under the specified index

Example

>>> load_case_setup = load_case_setup.remove_load_setup(index=1) # Two loads must already exist
Parameters:

index (int) – The index of the load in the load table

Returns:

ThermalLoadCaseSetup

Return type:

ThermalLoadCaseSetup

Raises:

TypeError – Raised if the index is not an integer

set_data_table_by_name(data_table_name: str) ThermalLoadCaseSetup[source]#

Sets the data table to be used in this load case

Example

>>> print("Available data tables: {}".format(load_case_setup.available_data_table_names)) # To check which data tables are available
Available data tables: ...
>>> load_case_setup = load_case_setup.set_data_table_by_name(data_table_name='data_table_name')
Parameters:

data_table_name (str) – The name of the data table to set

Returns:

self

Return type:

ThermalLoadCaseSetup

Raises:

NameNotFoundError – Raised if the data table was not found

set_name(name, resolve_duplicate_name: bool = False) ThermalLoadCaseSetup[source]#

Sets the name of the load case

See example at the top to see how to create a ThermalLoadCaseSetup object

Example

>>> load_case_setup.set_name(name='new_name')
<more...>
>>> second_load_case_setup.set_name(name='new_name', resolve_duplicate_name=True).get_name()
'new_name 1'
Parameters:
  • name (str) – The new name for the load case

  • resolve_duplicate_name (bool) – Whether to automatically assign a new name when the chosen one is already taken

Returns:

self

Return type:

ThermalLoadCaseSetup

Raises:
  • NameNotUniqueError – Raised if the given name is not unique

  • TypeError – Raised if the given name is not a string

set_time_dependent_data_bool(value: bool) ThermalLoadCaseSetup[source]#

Sets whether data table data should be used in the load case

Example

>>> load_case_setup = load_case_setup.set_time_dependent_data_bool(value=True)
Parameters:

value (bool) – A boolean value specifying whether data table dependence should be used

Returns:

ThermalLoadCaseSetup

Return type:

ThermalLoadCaseSetup

set_time_dependent_data_column_index(index: int) ThermalLoadCaseSetup[source]#

Deprecated method

Deprecated

set_time_dependent_data_column_index will be removed in a future MORe release, it is replaced by the more general get_data_table_query_config()

set_time_dependent_data_table_by_name(data_table_name: str) ThermalLoadCaseSetup[source]#

Deprecated method

Deprecated

set_time_dependent_data_table_by_name will be removed in a future MORe release, it is replaced by set_data_table_by_name()