ConvectionSetup

Qualified name: loads.convection.api.convection_api.ConvectionSetup

class loads.convection.api.convection_api.ConvectionSetup(item)[source]

Bases: LoadSetup

The API handler for convection loads

The following example shows how to create a convection 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')
>>> lc_setup = lcc_setup.create_load_case_setup(lc_type='Thermal load case').set_name(name='Example LC')
>>> load_setup = lc_setup.create_load_setup(load_type='Convection')

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

class:

note

>>> 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')
>>> lc_setup = lcc_setup.create_load_case_setup(lc_type='Thermal load case').set_name(name='Example LC')
>>> load_setup = lc_setup.get_load_setup(index=0) # The load under this index must already exist

Methods

set_component_by_name

Sets the component for the associated convection

set_dof

Sets the value of an element of the DOF vector

set_dof_dict

Sets the values of the DOF vector to those given in the dictionary

set_interface_by_name

Sets the interface for the associated convection

set_link

Deprecated method

set_link_by_name

Deprecated method

set_temperature

Deprecated version of set_general_job_settings_parameter()

set_value

Sets the value of the convection

set_component_by_name(component_name: str) ConvectionSetup[source]

Sets the component for the associated convection

See example at the top for how to create a convection setup object

Example

>>> load_setup = load_setup.set_component_by_name(component_name='example component')
Returns:

self

Return type:

ConvectionSetup

Raises:

NameNotFoundError – Raised if the supplied name is not a recognized component

set_dof(dof_name, value) ConvectionSetup[source]

Sets the value of an element of the DOF vector

See example at the top for how to create the setup object

Example

>>> load_setup = load_setup.set_dof(dof_name='value', value=10)
Returns:

self

Return type:

ConvectionSetup

Raises:
  • TypeError – Raised if the supplied value is not a floating point number

  • NameNotFoundError – Raised if there is no DOF with the given name

set_dof_dict(dof_values_dict: Dict[str, float]) ConvectionSetup[source]

Sets the values of the DOF vector to those given in the dictionary

See example at the top for how to create a convection setup object

Example

>>> load_setup = load_setup.set_dof_dict(dof_values_dict={'value': 20})
Returns:

self

Return type:

ConvectionSetup

Raises:
  • TypeError – Raised if the supplied value is not a floating point number

  • NameNotFoundError – Raised if a key in the supplied dictionary is not a recognized dof

set_interface_by_name(interface_name) ConvectionSetup[source]

Sets the interface for the associated convection

Returns:

self

Return type:

ConvectionSetup

Raises:

NameNotFoundError – Raised if the supplied name is not recognized

Deprecated method

Deprecated

Convection no longer uses links. set_link will be removed in a future MORe release, it is replaced by set_component_by_name() and set_interface_by_name()

Deprecated method

Deprecated

Convection no longer uses links. set_link_by_name will be removed in a future MORe release, it is replaced by set_component_by_name() and set_interface_by_name()

set_temperature(value) ConvectionSetup[source]

Deprecated version of set_general_job_settings_parameter()

Deprecated

set_convection will be removed in a future MORe release, it is replaced by set_temperature_value()

set_value(value) ConvectionSetup[source]

Sets the value of the convection

See example at the top for how to create a convection setup object

Example

>>> load_setup = load_setup.set_value(value=20)
Returns:

self

Return type:

ConvectionSetup

Raises:

TypeError – Raised if the supplied value is not a floating point number