-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEAT: Add transient support #4990
Changes from all commits
44f325d
d064837
dc9eaa7
44f9c94
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1085,13 +1085,7 @@ | |||||
|
||||||
@pyaedt_function_handler(faces_list="faces", quantity_name="quantity", design_variation="variation") | ||||||
def evaluate_faces_quantity( | ||||||
self, | ||||||
faces, | ||||||
quantity, | ||||||
side="Default", | ||||||
setup_name=None, | ||||||
variations=None, | ||||||
ref_temperature="", | ||||||
self, faces, quantity, side="Default", setup_name=None, variations=None, ref_temperature="", time="0s" | ||||||
): | ||||||
"""Export the field surface output. | ||||||
|
||||||
|
@@ -1111,6 +1105,8 @@ | |||||
Dictionary of parameters defined for the specific setup with values. The default is ``{}``. | ||||||
ref_temperature: str, optional | ||||||
Reference temperature to use for heat transfer coefficient computation. The default is ``""``. | ||||||
time : str | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right. I should've added |
||||||
Timestep to get the data from. Default is ``"0s"``. | ||||||
|
||||||
Returns | ||||||
------- | ||||||
|
@@ -1131,7 +1127,9 @@ | |||||
facelist_name = generate_unique_name(quantity) | ||||||
self._app.modeler.create_face_list(faces, facelist_name) | ||||||
fs = self.create_field_summary() | ||||||
fs.add_calculation("Object", "Surface", facelist_name, quantity, side=side, ref_temperature=ref_temperature) | ||||||
fs.add_calculation( | ||||||
"Object", "Surface", facelist_name, quantity, side=side, ref_temperature=ref_temperature, time=time | ||||||
) | ||||||
out = self._parse_field_summary_content(fs, setup_name, variations, quantity) | ||||||
self._app.oeditor.Delete(["NAME:Selections", "Selections:=", facelist_name]) | ||||||
return out | ||||||
|
@@ -1146,6 +1144,7 @@ | |||||
setup_name=None, | ||||||
variations=None, | ||||||
ref_temperature="", | ||||||
time="0s", | ||||||
): | ||||||
"""Export the field output on a boundary. | ||||||
|
||||||
|
@@ -1169,6 +1168,8 @@ | |||||
Dictionary of parameters defined for the specific setup with values. The default is ``{}``. | ||||||
ref_temperature: str, optional | ||||||
Reference temperature to use for heat transfer coefficient computation. The default is ``""``. | ||||||
time : str | ||||||
Timestep to get the data from. Default is ``"0s"``. | ||||||
|
||||||
Returns | ||||||
------- | ||||||
|
@@ -1193,18 +1194,13 @@ | |||||
quantity, | ||||||
side=side, | ||||||
ref_temperature=ref_temperature, | ||||||
time=time, | ||||||
) | ||||||
return self._parse_field_summary_content(fs, setup_name, variations, quantity) | ||||||
|
||||||
@pyaedt_function_handler(monitor_name="monitor", quantity_name="quantity", design_variation="variations") | ||||||
def evaluate_monitor_quantity( | ||||||
self, | ||||||
monitor, | ||||||
quantity, | ||||||
side="Default", | ||||||
setup_name=None, | ||||||
variations=None, | ||||||
ref_temperature="", | ||||||
self, monitor, quantity, side="Default", setup_name=None, variations=None, ref_temperature="", time="0s" | ||||||
): | ||||||
"""Export monitor field output. | ||||||
|
||||||
|
@@ -1224,6 +1220,8 @@ | |||||
Dictionary of parameters defined for the specific setup with values. The default is ``{}``. | ||||||
ref_temperature: str, optional | ||||||
Reference temperature to use for heat transfer coefficient computation. The default is ``""``. | ||||||
time : str | ||||||
Timestep to get the data from. Default is ``"0s"``. | ||||||
|
||||||
Returns | ||||||
------- | ||||||
|
@@ -1251,7 +1249,9 @@ | |||||
else: | ||||||
raise AttributeError("Monitor {} is not found in the design.".format(monitor)) | ||||||
fs = self.create_field_summary() | ||||||
fs.add_calculation("Monitor", field_type, monitor, quantity, side=side, ref_temperature=ref_temperature) | ||||||
fs.add_calculation( | ||||||
"Monitor", field_type, monitor, quantity, side=side, ref_temperature=ref_temperature, time=time | ||||||
) | ||||||
return self._parse_field_summary_content(fs, setup_name, variations, quantity) | ||||||
|
||||||
@pyaedt_function_handler(design_variation="variations") | ||||||
|
@@ -1264,6 +1264,7 @@ | |||||
setup_name=None, | ||||||
variations=None, | ||||||
ref_temperature="", | ||||||
time="0s", | ||||||
): | ||||||
"""Export the field output on or in an object. | ||||||
|
||||||
|
@@ -1285,6 +1286,8 @@ | |||||
Dictionary of parameters defined for the specific setup with values. The default is ``{}``. | ||||||
ref_temperature: str, optional | ||||||
Reference temperature to use for heat transfer coefficient computation. The default is ``""``. | ||||||
time : str | ||||||
Timestep to get the data from. Default is ``"0s"``. | ||||||
|
||||||
Returns | ||||||
------- | ||||||
|
@@ -1310,5 +1313,6 @@ | |||||
quantity_name, | ||||||
side=side, | ||||||
ref_temperature=ref_temperature, | ||||||
time=time, | ||||||
) | ||||||
return self._parse_field_summary_content(fs, setup_name, variations, quantity_name) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5678,6 +5678,7 @@ def add_calculation( | |||||
side="Default", | ||||||
mesh="All", | ||||||
ref_temperature="AmbientTemp", | ||||||
time="0s", | ||||||
): | ||||||
""" | ||||||
Add an entry in the field summary calculation requests. | ||||||
|
@@ -5710,6 +5711,8 @@ def add_calculation( | |||||
ref_temperature : str, optional | ||||||
Reference temperature to use in the calculation of the heat transfer | ||||||
coefficient. The default is ``"AmbientTemp"``. | ||||||
time : str | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Timestep to get the data from. Default is ``"0s"``. | ||||||
|
||||||
Returns | ||||||
------- | ||||||
|
@@ -5728,9 +5731,20 @@ def add_calculation( | |||||
normal = ",".join(normal) | ||||||
if isinstance(geometry_name, str): | ||||||
geometry_name = [geometry_name] | ||||||
self.calculations.append( | ||||||
[entity, geometry, ",".join(geometry_name), quantity, normal, side, mesh, ref_temperature, False] | ||||||
) # TODO : last argument not documented | ||||||
calc_args = [ | ||||||
entity, | ||||||
geometry, | ||||||
",".join(geometry_name), | ||||||
quantity, | ||||||
normal, | ||||||
side, | ||||||
mesh, | ||||||
ref_temperature, | ||||||
False, | ||||||
] # TODO : last argument not documented | ||||||
if self._app.solution_type == "Transient": | ||||||
calc_args = [time] + calc_args | ||||||
self.calculations.append(calc_args) | ||||||
return True | ||||||
|
||||||
@pyaedt_function_handler(IntrinsincDict="intrinsics", setup_name="setup", design_variation="variation") | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add also assert len(df) == 6 to ensure that all timesteps are added in the calculation. Also what will happen if the timestep provided is not in the solution timestep ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll get an error raised from AEDT. I didn't implement any sanity check (neither the possibility to add all time steps) as there is no way (from APIs) to get saved times. We could read this from setup props, but I don't think it's worth it. It can cause more problems than solutions.