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,infinity
62 parameter(infinity = 1.0e20)
63C=======================================================================
64 IF (sensor%STATUS == 1) RETURN ! already activated
65c
66 tstart = sensor%TSTART
67 tdelay = sensor%TDELAY
68 node = sensor%IPARAM(1)
69 vel = sensor%RPARAM(1)
70 freq = sensor%RPARAM(2)
71 tmin = zero
72 icrit = 0
73c
74 vx = v(1,node)
75 vy = v(2,node)
76 vz = v(3,node)
77 vv = sqrt(vx*vx+vy*vy+vz*vz)
78c
79 IF (freq > 0) THEN ! filtering (Butterworth)
80 vvx = sensor%VAR(1)
81 vvy = sensor%VAR(2)
82 fvx = sensor%VAR(3)
83 fvy = sensor%VAR(4)
84c
85 CALL butterworth(dt2,freq,vvy,vvx,vv,fvy,fvx,fv)
86c
87 sensor%VAR(1) = vv
88 sensor%VAR(2) = vvx
89 sensor%VAR(3) = fv
90 sensor%VAR(4) = fvx
91 vv = fv
92 ENDIF
93 IF (vv > vel) icrit = 1
94c----------------------------------------------------------------
95c check activation status
96c----------------------------------------------------------------
97 IF (sensor%TCRIT + tmin > tt) THEN
98 IF (icrit == 0) THEN
99 sensor%TCRIT = infinity
100 ELSE IF (sensor%TCRIT == infinity) THEN
101 sensor%TCRIT = tt
102 END IF
103 END IF
104 IF (sensor%TCRIT < infinity) tstart = sensor%TCRIT + tmin + tdelay
105 IF (tstart <= tt) THEN ! sensor activation
106 sensor%STATUS = 1
107 sensor%TSTART = tstart
108 END IF
109c-----------------------------------------------------------------------
110 IF (sensor%STATUS == 1 .and. ispmd == 0) THEN
111#include "lockon.inc"
112 WRITE (istdo,1100) sensor%SENS_ID,sensor%TSTART
113 WRITE (iout ,1100) sensor%SENS_ID,sensor%TSTART
114 WRITE (iout ,1200) vel,vv
115#include "lockoff.inc"
116 ENDIF
117c-----------------------------------------------------------------------
1181100 FORMAT(' SENSOR NUMBER ',i10,' ,ACTIVATED AT TIME ',1pe12.5)
1191200 FORMAT(' TARGET VELOCITY = ',1pe12.5,/
120 . ' CURRENT VELOCITY AFTER TDELAY = ',1pe12.5)
121c-----------------------------------------------------------------------
122 RETURN
123 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