Hello,
To stop a analysis respect to your condition you can use sensor functionality and UAMP or VUAMP subroutine depend what solver you are using (Standard or Explicit).
In the subroutine you can set two variables:
1. lFlagsDefine(iConcludeStep) - if set to 1 stop current step and start next, if last step stop analysis
2. lFlagsDefine(iStopAnalysis) - if set to 1 stop analysis with error message
It can look like this:
1) inputdeck:
...
** define sensor to read temperature for selected node in model data
*NSET, NSET = temp_exit_analysis-NSET
1000,
** define amplitude with user type, we don't have to use it but we need it to execute subroutine for each increament
*AMPLITUDE, NAME=temp-XY, DEFINITION=USER, VARIABLES=1
**
** define sensor output in history data
*OUTPUT, HISTORY, SENSOR, NAME=TEMP-SENSOR, FREQUENCY=1
*NODE OUTPUT, NSET=temp_exit_analysis-NSET
NT,
...
2) subroutine
...
Subroutine vuamp(
C passed in for information and state variables
* ampName, time, ampValueOld, dt, nSvars, svars, lFlagsInfo,
* nSensor, sensorValues, sensorNames, jSensorLookUpTable,
C to be defined
* ampValueNew,
* lFlagsDefine,
* AmpDerivative, AmpSecDerivative, AmpIncIntegral)
include 'vaba_param.inc'
C svars - additional state variables, similar to (V)UEL
dimension sensorValues(nSensor), svars(nSvars)
character*80 sensorNames(nSensor)
character*80 ampName
C time indices
parameter (iStepTime = 1,
* iTotalTime = 2,
* nTime = 2)
C flags passed in for information
parameter (iInitialization = 1,
* iRegularInc = 2,
* nFlagsInfo = 2)
C optional flags to be defined
parameter (iComputeDeriv = 1,
* iComputeSecDeriv = 2,
* iComputeInteg = 3,
* iStopAnalysis = 4,
* iConcludeStep = 5,
* nFlagsDefine = 5)
dimension time(nTime), lFlagsInfo(nFlagsInfo),
* lFlagsDefine(nFlagsDefine)
dimension jSensorLookUpTable(*)
c
c Get the sensor value
iR_TEMP = ivGetSensorID('TEMP-SENSOR',jSensorLookUpTable)
temp_sensor = sensorValues(iR_TEMP)
if (lFlagsInfo(iInitialization) .eq. 1) then
ampValueNew = 0.0
lFlagsDefine(iConcludeStep) = 0
else
c check temp value, if grater then 300.0 stop analysis
if (temp_sensor .gt. 300.0) then
lFlagsDefine(iConcludeStep) = 1
end if
end if
return
end
c
...
I have tested it with displacement and it works fine.
Best Regards,
Bartosz