OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sensor_temp.F File Reference
#include "implicit_f.inc"
#include "comlock.inc"
#include "units_c.inc"
#include "com04_c.inc"
#include "com08_c.inc"
#include "task_c.inc"
#include "lockon.inc"
#include "lockoff.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine sensor_temp (sensor, isens, igrnod)

Function/Subroutine Documentation

◆ sensor_temp()

subroutine sensor_temp ( type (sensor_str_) sensor,
integer isens,
type(group_), dimension(ngrnod), intent(in) igrnod )

Definition at line 31 of file sensor_temp.F.

32c-----------------------------------------------------------------------
33!$COMMENT
34! SENSOR_TEMP description
35! SENSOR_TEMP organization :
36! - sensor state modification
37!$ENDCOMMENT
38c-----------------------------------------------
39C M o d u l e s
40c-----------------------------------------------
41 USE groupdef_mod
42 USE sensor_mod
43C-----------------------------------------------
44C I m p l i c i t T y p e s
45C-----------------------------------------------
46#include "implicit_f.inc"
47#include "comlock.inc"
48C-----------------------------------------------
49C C o m m o n B l o c k s
50C-----------------------------------------------
51#include "units_c.inc"
52#include "com04_c.inc"
53#include "com08_c.inc"
54#include "task_c.inc"
55C-----------------------------------------------
56C D u m m y A r g u m e n t s
57C-----------------------------------------------
58 INTEGER :: ISENS
59 TYPE(GROUP_) ,DIMENSION(NGRNOD) ,INTENT(IN) :: IGRNOD
60 TYPE (SENSOR_STR_) :: SENSOR
61C----------------------------------------------------------
62C Local Variables
63C----------------------------------------------------------
64 INTEGER :: I,IGN,ICRIT,TFLAG
65 my_real :: tstart,tdelay,tmin,temp_max,temp_min,temp_avg,infinity
66 parameter(infinity = 1.0e20)
67c----------------------------------------------------------
68c SENSOR%VAR(1) = TEMP_MAX
69c SENSOR%VAR(2) = TEMP_MIN
70c SENSOR%VAR(3) = TEMP_AVG
71c
72c sensor status : ICRIT
73c = 0 : inactive, criterion not met
74c = 1 : criterium reached, testing duration time Tmin
75c = 2 : ready to activate after Tdelay
76c = 3 : activated at Time = TSTART
77C=======================================================================
78 IF (sensor%STATUS == 1) RETURN ! already activated
79c
80 IF (tt == zero) sensor%VAR(2) = ep20 ! initialize Temp min
81 tstart = sensor%TSTART
82 tdelay = sensor%TDELAY
83 tmin = sensor%TMIN
84 ign = sensor%IPARAM(1)
85 temp_max = sensor%VAR(1)
86 temp_min = sensor%VAR(2)
87 temp_avg = sensor%VAR(3)
88 icrit = 0
89 tflag = 0
90
91 IF (temp_avg > sensor%RPARAM(3)) THEN
92 icrit = 1
93 tflag = 3
94 ELSE IF (temp_max > sensor%RPARAM(1)) THEN
95 icrit = 1
96 tflag = 1
97 ELSE IF (temp_min < sensor%RPARAM(2)) THEN
98 icrit = 1
99 tflag = 2
100 END IF
101c----------------------------------------------------------------
102c check activation status
103c----------------------------------------------------------------
104 IF (sensor%TCRIT + tmin > tt) THEN
105 IF (icrit == 0) THEN
106 sensor%TCRIT = infinity
107 ELSE IF (sensor%TCRIT == infinity) THEN
108 sensor%TCRIT = tt
109 END IF
110 END IF
111 tstart = sensor%TCRIT + tmin + tdelay
112 IF (tstart <= tt) THEN ! sensor activation
113 sensor%STATUS = 1
114 sensor%TSTART = tstart
115 END IF
116c-----------------------------------------------------------------------
117 IF (sensor%STATUS == 1 .and. ispmd == 0) THEN
118#include "lockon.inc"
119 WRITE (istdo,1100 ) sensor%SENS_ID,sensor%TSTART
120 WRITE (iout ,1100 ) sensor%SENS_ID,sensor%TSTART
121 IF (tflag == 1) THEN
122 WRITE (iout ,1200) sensor%RPARAM(1),temp_max
123 ELSE IF (tflag == 2) THEN
124 WRITE (iout ,1300) sensor%RPARAM(2),temp_min
125 ELSE IF (tflag == 3) THEN
126 WRITE (iout ,1400) sensor%RPARAM(3),temp_avg
127 END IF
128#include "lockoff.inc"
129 ENDIF
130c-----------------------------------------------------------------------
1311100 FORMAT(' SENSOR TEMPERATURE NUMBER ',i10,' ACTIVATED AT TIME ',1pe12.5)
1321200 FORMAT(' TARGET MAX TEMPERATURE = ',1pe12.5,/
133 . ' CURRENT TEMPERATURE AFTER TMIN and TDELAY = ',1pe12.5)
1341300 FORMAT(' TARGET MIN TEMPERATURE = ',1pe12.5,/
135 . ' CURRENT TEMPERATURE AFTER TMIN and TDELAY = ',1pe12.5)
1361400 FORMAT(' TARGET AVG TEMPERATURE = ',1pe12.5,/
137 . ' current temperature after tmin and tdelay = ',1PE12.5)
138c----------------------------------------------------------
139 RETURN
#define my_real
Definition cppsort.cpp:32