我正在尝试在 Ansys Mechanical 中进行瞬态热仿真。为了获得更合适的模拟,我想“添加”一个源术语。特别是我想在我的方程中添加一个减少程度,这取决于温度。
我尝试使用 APDL 命令来执行此操作,但我对这种编程语言和 Ansys 中的例程都不是很熟悉。
这是到目前为止我想到的“伪代码”:
! ############################################
! Getting values and material data
! ############################################
*GET, NumberOfMeshElements, VOLU, 0, COUNT, , Body 1, ! Number of Elements in Body 1
*GET, TimeStepSize, ACTIVE, 0, SOLU, DTIME
*SET, CeriaAmount, 1000 ! in mol
*SET, ReductionEnthalpy, 500 ! in kJ/mol O (
*SET, OxygenPartialPressure, 100 ! Setting oxygen partial pressure
*SET, Temperature, TEMP ! Setting Temperature as a variable
*SET, ReductionExtent, 0 ! previous reduction extent
! ############################################
! Calculation of Source Term
! ############################################
! Begin of Loop for each time step
*DO, t, 0, 10, TimeStepSize ! solve together with transient thermal analysis (convection, radiation, conduction)
ReductionExtent = 0.35 * EXP(Temperature) ! goal: storing of previous (t-1) value for later calculation of Rate of Change
! Begin of Loop for each element
*DO, i, 1, NumberOfMeshElements, 1 ! needed for each mesh element because each mesh element has a different temperature
*GET, MeshElementVolume, VOLU, i, VOLU, , Body 1,
ReductionExtentRateOfChange = ReductionExtent(t-1)- ReductionExtent(i) / TimeStepSize
S_reaction = - CeriaAmount / MeshElementVolume * ReductionEnthalpy * ReductionExtentRateOfChange ! usally a source term