Я столкнулся с проблемой при попытке извлечь тепловой поток «HFL Magnitude» из узлов (наборов узлов) в файле Abaqus ODB с помощью скрипта Python. Однако этот же скрипт корректно работает для извлечения температуры NT11. Код выполняется, но всегда возвращает пустой список значений HFL. Ниже приведен сценарий HFL, а под ним я добавил функциональный сценарий NT11.
"Сценарий NT11 python:
from odbAccess import *
import numpy as np
# Path to the ODB file
path0 = 'E:/Job-TCMT.odb'
# Open the ODB file
odb = openOdb(path=path0)
# Name of the node sets
nodeset_1 = 'NODESET-ZCT-1'
nodeset_2 = 'NODESET-ZCT-2'
# Extract the node sets
mySet_1 = odb.rootAssembly.instances['PART-1-1'].nodeSets[nodeset_1]
mySet_2 = odb.rootAssembly.instances['PART-1-1'].nodeSets[nodeset_2]
# Extract the last frame of the step
lastFrame = odb.steps['Step-1'].frames[-1]
# Temperature field (NT11)
TEMP = lastFrame.fieldOutputs['NT11']
# Get temperature values for the two node sets
mySetTemp_1 = TEMP.getSubset(region=mySet_1)
mySetTemp_2 = TEMP.getSubset(region=mySet_2)
# Retrieve temperatures for each node set
temp_values_1 = [v.data for v in mySetTemp_1.values]
temp_values_2 = [v.data for v in mySetTemp_2.values]
# Combine temperatures from both sets
all_temp_values = temp_values_1 + temp_values_2
# Calculate the average temperature
Tint_moyenne_arith = np.mean(all_temp_values)
# Display the result
print('The average temperature (arithmetic) =', Tint_moyenne_arith)
# Close the ODB file
odb.close()
"Скрипт HFL Python:
from odbAccess import *
import numpy as np
# Path to the ODB file
path0 = 'E:/Job-TCMT.odb'
# Open the ODB file
odb = openOdb(path=path0)
# Name of the node sets
nodeset_1 = 'NODESET-ZCT-1'
nodeset_2 = 'NODESET-ZCT-2'
# Extract the node sets
mySet_1 = odb.rootAssembly.instances['PART-1-1'].nodeSets[nodeset_1]
mySet_2 = odb.rootAssembly.instances['PART-1-1'].nodeSets[nodeset_2]
# Extract the last frame of the step
lastFrame = odb.steps['Step-1'].frames[-1]
# Heat flux field (HFL magnitude)
HFL = lastFrame.fieldOutputs['HFL']
# Get heat flux values for the two node sets
mySetHFL_1 = HFL.getSubset(region=mySet_1)
mySetHFL_2 = HFL.getSubset(region=mySet_2)
# Retrieve heat flux values for each node set
hfl_values_1 = [v.magnitude for v in mySetHFL_1.values]
hfl_values_2 = [v.magnitude for v in mySetHFL_2.values]
# Combine heat flux values from both sets
all_hfl_values = hfl_values_1 + hfl_values_2
# Calculate the average heat flux
HFL_moyenne_arith = np.mean(all_hfl_values)
# Display the result
print('The average heat flux (arithmetic) =', HFL_moyenne_arith)
# Close the ODB file
odb.close()
Подробнее здесь: https://stackoverflow.com/questions/793 ... -scripting
Извлеките величину HFL из сценариев Python abaqus для набора узлов ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Почему имя задания abaqus не обновляется в моем скрипте Python abaqus?
Anonymous » » в форуме Python - 0 Ответы
- 38 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Как вывести контактное давление всех точек в наборе узлов в файле odb abaqus через python
Anonymous » » в форуме Python - 0 Ответы
- 20 Просмотры
-
Последнее сообщение Anonymous
-
-
-
В любом случае, изменение русалкой узлов / параметров, чтобы исправить положение узлов
Anonymous » » в форуме CSS - 0 Ответы
- 69 Просмотры
-
Последнее сообщение Anonymous
-