assign_source#
- Icepak.assign_source(assignment, thermal_condition, assignment_value, boundary_name=None, radiate=False, voltage_current_choice=False, voltage_current_value=None)[source]#
Create a source power for a face.
- Parameters:
- assignment
int
orstr
orlist
Integer indicating a face ID or a string indicating an object name. A list of face IDs or object names is also accepted.
- thermal_condition
str
Thermal condition. Accepted values are
"Total Power"
,"Surface Heat"
,"Temperature"
.- assignment_value
str
ordict
Value and units of the input power, surface heat or temperature (depending on
thermal_condition
). A dictionary can be used for temperature dependent or transientassignment. The dictionary should contain three keys:
"Type"
,"Function"
, and"Values"
. Accepted"Type"
values are:"Temp Dep"
and"Transient"
. - Accepted values for the"Function"
key are:"Linear"
,"Power Law"
,"Exponential"
,"Sinusoidal"
,"Square Wave"
and"Piecewise Linear"
."Temp Dep"
only support the latter."Values"
contains a list of strings containing the parametersrequired by the
"Function"
selection (e.g."Linear"
requires two parameters: the value of the variable at t=0 and the slope of the line). The parameters required by eachFunction
option is in Icepak documentation. The parameters must contain the units where needed.- boundary_name
str
,optional
Name of the source boundary. The default is
None
, in which case the boundary name is generated automatically.- radiatebool,
optional
Whether to enable radiation. The default is
False
.- voltage_current_choice
str
or bool,optional
Whether to assign
"Voltage"
or"Current"
or none of them. The default isFalse
(none of them is assigned).- voltage_current_value
str
ordict
,optional
Value and units of current or voltage assignment. A dictionary can be used for transient assignment. The dictionary must be structured as described for the
assignment_value
argument. The default isNone
.
- assignment
- Returns:
pyaedt.modules.Boundary.BoundaryObject
Boundary object when successful or
None
when failed.
References
>>> oModule.AssignSourceBoundary
Examples
>>> from pyaedt import Icepak >>> app = Icepak() >>> box = app.modeler.create_box([0, 0, 0], [20, 20, 20], name="box") >>> ds = app.create_dataset1d_design("Test_DataSet", [1, 2, 3], [3, 4, 5]) >>> app.solution_type = "Transient" >>> b = app.assign_source("box", "Total Power", assignment_value={"Type": "Temp Dep", ... "Function": "Piecewise Linear", "Values": "Test_DataSet"})