THank you. I will try them out. In the mean time, I was googling for additional information and I came across one of your presentation slides. I am wondering whether I can use SaveScalar to evaluate the maximum temperature (because this is basically my threshold) and then use MATC in my Boundary Condition section to prescribe my BC. In other words, I will have:
Code: Select all
!***************************************************************************************!
Solver 1
!***************************************************************************************!
Equation = SaveScalars
Procedure = "SaveData" "SaveScalars"
Operator 1 = max
Variable 1 = Temperature
Procedure = "SaveData" "SaveScalars"
Target Variable 1 = string maxTemp
Exec Solver = before timestep
Filename = File "scalar_data.txt"
!***************************************************************************************!
End
!***************************************************************************************!
Code: Select all
!***************************************************************************************!
Boundary Condition 2
!***************************************************************************************!
Target Boundaries(12) = 5 6 7 8 9 11 12 13 14 15 16 17
Name = "ZeroFlux"
Heat Flux BC = True
Heat Flux = 0.0
Potential = Variable maxTemp
Real MATC "if (tx > 373) Potential = 30; else Potential = 25"
Save Scalars = Logical True
!***************************************************************************************!
End
!***************************************************************************************!
It seems simpler but I am still not able to run. First of all, I get Model Input: Unlisted keyword: [target variable 1] .... [solver 1] and
ERROR: ListGetReal: Can't find INDEPENDENT variable: [maxTemp] for dependent variable: [potential].
One of the thread (viewtopic.php?f=7&t=2014&start=10) seems to talk about this and the problem can be avoided by using "Initialize Dirichlet Conditions = False" in the Simulation Section. While this is true, when the solver finishes assembling, I get the error: Fortran runtime error: End of file
Does this mean that in the Boundary Condition section, the MATC is reading the maxTemp variable from the file saved in SaveScalars? Is there a way to make the variable from the SaveScalars accessible globally (I doubt this is possible based on previous threads but maybe revised version can do it?). The runtime error seems to tell me that the file is saved in an incorrect format for fortran to read. Am I correct? How can I rectify this?
Best wishes,
EH