OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sensor_vel.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23C=======================================================================
24!||====================================================================
25!|| sensor_vel ../engine/source/tools/sensor/sensor_vel.F
26!||--- called by ------------------------------------------------------
27!|| sensor_base ../engine/source/tools/sensor/sensor_base.F
28!||--- calls -----------------------------------------------------
29!|| butterworth ../engine/source/tools/univ/butterworth.F
30!||--- uses -----------------------------------------------------
31!|| sensor_mod ../common_source/modules/sensor_mod.F90
32!||====================================================================
33 SUBROUTINE sensor_vel(SENSOR ,V)
34C-----------------------------------------------
35C M o d u l e s
36C-----------------------------------------------
37 USE sensor_mod
38C-----------------------------------------------
39C I m p l i c i t T y p e s
40C-----------------------------------------------
41#include "implicit_f.inc"
42C-----------------------------------------------
43C C o m m o n B l o c k s
44C-----------------------------------------------
45#include "com04_c.inc"
46#include "com08_c.inc"
47#include "units_c.inc"
48#include "comlock.inc"
49#include "task_c.inc"
50C-----------------------------------------------
51C D u m m y A r g u m e n t s
52C-----------------------------------------------
53 my_real, DIMENSION(3,NUMNOD) :: v
54 TYPE (SENSOR_STR_) ,INTENT(INOUT) :: SENSOR
55C----------------------------------------------------------
56C Local Variables
57C----------------------------------------------------------
58 INTEGER NODE,ICRIT
59c
60 my_real :: vel,vx,vy,vz,vv,vvx,vvy,fvx,fvy,fv,freq,
61 . tmin,tstart,tdelay
62C=======================================================================
63 IF (sensor%STATUS == 1) RETURN ! already activated
64c
65 tstart = sensor%TSTART
66 tdelay = sensor%TDELAY
67 node = sensor%IPARAM(1)
68 vel = sensor%RPARAM(1)
69 freq = sensor%RPARAM(2)
70 tmin = zero
71 icrit = 0
72c
73 vx = v(1,node)
74 vy = v(2,node)
75 vz = v(3,node)
76 vv = sqrt(vx*vx+vy*vy+vz*vz)
77c
78 IF (freq > 0) THEN ! filtering (Butterworth)
79 vvx = sensor%VAR(1)
80 vvy = sensor%VAR(2)
81 fvx = sensor%VAR(3)
82 fvy = sensor%VAR(4)
83c
84 CALL butterworth(dt2,freq,vvy,vvx,vv,fvy,fvx,fv)
85c
86 sensor%VAR(1) = vv
87 sensor%VAR(2) = vvx
88 sensor%VAR(3) = fv
89 sensor%VAR(4) = fvx
90 vv = fv
91 ENDIF
92 IF (vv > vel) icrit = 1
93c----------------------------------------------------------------
94c check activation status
95c----------------------------------------------------------------
96 IF (sensor%TCRIT + tmin > tt) THEN
97 IF (icrit == 0) THEN
98 sensor%TCRIT = infinity
99 ELSE IF (sensor%TCRIT == infinity) THEN
100 sensor%TCRIT = tt
101 END IF
102 END IF
103 IF (sensor%TCRIT < infinity) tstart = sensor%TCRIT + tmin + tdelay
104 IF (tstart <= tt) THEN ! sensor activation
105 sensor%STATUS = 1
106 sensor%TSTART = tstart
107 END IF
108c-----------------------------------------------------------------------
109 IF (sensor%STATUS == 1 .and. ispmd == 0) THEN
110#include "lockon.inc"
111 WRITE (istdo,1100) sensor%SENS_ID,sensor%TSTART
112 WRITE (iout ,1100) sensor%SENS_ID,sensor%TSTART
113 WRITE (iout ,1200) vel,vv
114#include "lockoff.inc"
115 ENDIF
116c-----------------------------------------------------------------------
1171100 FORMAT(' SENSOR NUMBER ',i10,' ,ACTIVATED AT TIME ',1pe12.5)
1181200 FORMAT(' TARGET VELOCITY = ',1pe12.5,/
119 . ' CURRENT VELOCITY AFTER TDELAY = ',1pe12.5)
120c-----------------------------------------------------------------------
121 RETURN
122 END SUBROUTINE
subroutine butterworth(dt, freq, x2, x1, x, fx2, fx1, fx)
Definition butterworth.F:31
#define my_real
Definition cppsort.cpp:32
subroutine sensor_vel(sensor, v)
Definition sensor_vel.F:34