OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
sensor_nic.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_nic ../engine/source/tools/sensor/sensor_nic.F
26!||--- called by ------------------------------------------------------
27!|| sensor_base ../engine/source/tools/sensor/sensor_base.F
28!||--- uses -----------------------------------------------------
29!|| groupdef_mod ../common_source/modules/groupdef_mod.F
30!|| sensor_mod ../common_source/modules/sensor_mod.F90
31!||====================================================================
32 SUBROUTINE sensor_nic(SENSOR)
33C-----------------------------------------------
34C M o d u l e s
35C-----------------------------------------------
36 USE groupdef_mod
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"
42#include "comlock.inc"
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "units_c.inc"
47#include "com08_c.inc"
48#include "task_c.inc"
49C-----------------------------------------------
50C D u m m y A r g u m e n t s
51C-----------------------------------------------
52 TYPE (SENSOR_STR_) :: SENSOR
53C----------------------------------------------------------
54C Local Variables
55C----------------------------------------------------------
56 INTEGER NPT,NPH,IADFX,IADFY,IADMX,IADMY,ICRIT
57 my_real :: for,mom,dt,time,nijmax,nic,alpha,beta,cfc,tmin,tdelay,
58 . wd,wa,wa2,wa3,a0,a1,a2,b1,b2,x0,x1,x2,y1,y2,yf,ym
59c-----------------------------------------------------------------------
60c Sensor state variables
61c SENSOR%VAR(1) : Current non filtered spring force
62c SENSOR%VAR(2) : Current non filtered spring moment
63c SENSOR%VAR(3) : flag spmd : =0 => spring not present in the domain
64c =1 => spring is present in the domain
65c free
66c SENSOR%VAR(6 -10) : non filtered force values
67c SENSOR%VAR(11-15) : filtered force values
68c SENSOR%VAR(16-20 : non filtered moment values
69c SENSOR%VAR(21-25) : filtered moment values
70C=======================================================================
71 IF (sensor%STATUS == 1) RETURN ! already activated
72 IF (sensor%VAR(3) == zero) RETURN ! spring is on different spmd domain
73c
74 tmin = sensor%TMIN
75 tdelay = sensor%TDELAY
76 nijmax = sensor%RPARAM(1)
77 alpha = sensor%RPARAM(6)
78 cfc = sensor%RPARAM(7)
79 time = tt
80 icrit = 0
81c
82c Parameters of SAE-J211 CFC filter
83 dt = dt2
84 wd = two*pi*cfc*alpha
85 beta = half * dt * wd
86 wa = tan(beta)
87 wa2 = wa**2
88 wa3 = one + sqr2*wa + wa2
89 a0 = wa2 / wa3
90 a1 = a0 * two
91 a2 = a0
92 b1 = -two*(wa2 - one) / wa3
93 b2 = (-one + sqr2*wa - wa2) / wa3
94c
95c current non filtered normalized spring force and moment
96 for = sensor%VAR(1)
97 mom = sensor%VAR(2)
98c
99 npt = 5
100 nph = 3
101 iadfx = 5
102 iadfy = iadfx + npt
103 iadmx = iadfy + npt
104 iadmy = iadmx + npt
105c
106 ! forward filter - forces
107c
108 x0 = for
109 x1 = sensor%VAR(iadfx+5)
110 x2 = sensor%VAR(iadfx+4)
111 y1 = sensor%VAR(iadfy+5)
112 y2 = sensor%VAR(iadfy+4)
113c
114 yf = a0*x0 + a1*x1 + a2*x2 + b1*y1 + b2*y2
115c
116 sensor%VAR(iadfx+1) = sensor%VAR(iadfx+2)
117 sensor%VAR(iadfx+2) = sensor%VAR(iadfx+3)
118 sensor%VAR(iadfx+3) = sensor%VAR(iadfx+4)
119 sensor%VAR(iadfx+4) = sensor%VAR(iadfx+5)
120 sensor%VAR(iadfx+5) = for
121c
122 sensor%VAR(iadfy+1) = sensor%VAR(iadfy+2)
123 sensor%VAR(iadfy+2) = sensor%VAR(iadfy+3)
124 sensor%VAR(iadfy+3) = sensor%VAR(iadfy+4)
125 sensor%VAR(iadfy+4) = sensor%VAR(iadfy+5)
126 sensor%VAR(iadfy+5) = yf
127c
128 ! backward filter - forces
129c
130 x0 = sensor%VAR(iadfx+nph)
131 x1 = sensor%VAR(iadfx+nph+1)
132 x2 = sensor%VAR(iadfx+nph+2)
133 y1 = sensor%VAR(iadfy+nph+1)
134 y2 = sensor%VAR(iadfy+nph+2)
135c
136 for = a0*x0 + a1*x1 + a2*x2 + b1*y1 + b2*y2
137c
138 ! forward filter - moments
139 x0 = mom
140 x1 = sensor%VAR(iadmx+5)
141 x2 = sensor%VAR(iadmx+4)
142 y1 = sensor%VAR(iadmy+5)
143 y2 = sensor%VAR(iadmy+4)
144c
145 ym = a0*x0 + a1*x1 + a2*x2 + b1*y1 + b2*y2
146c
147 sensor%VAR(iadmx+1) = sensor%VAR(iadmx+2)
148 sensor%VAR(iadmx+2) = sensor%VAR(iadmx+3)
149 sensor%VAR(iadmx+3) = sensor%VAR(iadmx+4)
150 sensor%VAR(iadmx+4) = sensor%VAR(iadmx+5)
151 sensor%VAR(iadmx+5) = mom
152
153 sensor%VAR(iadmy+1) = sensor%VAR(iadmy+2)
154 sensor%VAR(iadmy+2) = sensor%VAR(iadmy+3)
155 sensor%VAR(iadmy+3) = sensor%VAR(iadmy+4)
156 sensor%VAR(iadmy+4) = sensor%VAR(iadmy+5)
157 sensor%VAR(iadmy+5) = ym
158c
159 ! backward filter - moments
160c
161 x0 = sensor%VAR(iadmx+nph)
162 x1 = sensor%VAR(iadmx+nph+1)
163 x2 = sensor%VAR(iadmx+nph+2)
164 y1 = sensor%VAR(iadmy+nph+1)
165 y2 = sensor%VAR(iadmy+nph+2)
166 mom = a0*x0 + a1*x1 + a2*x2 + b1*y1 + b2*y2
167c
168 nic = for + mom
169 IF (nic >= nijmax) icrit = 1
170c-----------------------------------------
171c Check Sensor State
172c-----------------------------------------
173 IF (sensor%TCRIT + tmin > tt) THEN
174 IF (icrit == 0) THEN
175 sensor%TCRIT = infinity
176 ELSE IF (sensor%TCRIT == infinity) THEN
177 sensor%TCRIT = min(sensor%TCRIT, tt)
178 END IF
179 ELSE IF (sensor%TSTART == infinity) THEN
180 sensor%TSTART = sensor%TCRIT + tmin + tdelay
181 END IF
182 IF (sensor%TSTART <= tt) THEN ! sensor activation
183 sensor%STATUS = 1
184 END IF
185c-----------------------------------------------------------------------
186 IF (sensor%STATUS == 1 .and. ispmd == 0) THEN
187#include "lockon.inc"
188 WRITE (istdo,1100 ) sensor%SENS_ID,sensor%TSTART,nic
189 WRITE (iout ,1100 ) sensor%SENS_ID,sensor%TSTART,nic
190 WRITE (iout ,1200) nijmax,nic
191#include "lockoff.inc"
192 ENDIF
193c-----------------------------------------------------------------------
1941100 FORMAT(' SENSOR (RBODY) NUMBER ',i10,' ,ACTIVATED AT TIME ',1pe12.5)
1951200 FORMAT(' TARGET NIC VALUE = ',1pe12.5,/
196 . ' CURRENT NIC VALUE AFTER TMIN and TDELAY = ',1pe12.5)
197c-----------------------------------------------------------------------
198 RETURN
199 END SUBROUTINE
#define my_real
Definition cppsort.cpp:32
#define alpha
Definition eval.h:35
#define min(a, b)
Definition macros.h:20
for(i8=*sizetab-1;i8 >=0;i8--)
subroutine sensor_nic(sensor)
Definition sensor_nic.F:33