OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
multi_update_global.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/.
23!||====================================================================
24!|| multi_update_global ../engine/source/multifluid/multi_update_global.F
25!||--- called by ------------------------------------------------------
26!|| multi_timeevolution ../engine/source/multifluid/multi_timeevolution.F
27!||--- calls -----------------------------------------------------
28!|| multi_bilan ../engine/source/multifluid/multi_bilan.F
29!||--- uses -----------------------------------------------------
30!|| elbufdef_mod ../common_source/modules/mat_elem/elbufdef_mod.F90
31!|| initbuf_mod ../engine/share/resol/initbuf.F
32!|| multi_fvm_mod ../common_source/modules/ale/multi_fvm_mod.F90
33!||====================================================================
34 SUBROUTINE multi_update_global(NG, ELBUF_TAB, IPARG, ITASK, MULTI_FVM,
35 . PARTSAV, IPARTS, GRESAV, IGRTH, GRTH, VOLNEW, PRED, TIMESTEP)
36C-----------------------------------------------
37C M o d u l e s
38C-----------------------------------------------
39 USE initbuf_mod
40 USE elbufdef_mod
41 USE multi_fvm_mod
42C-----------------------------------------------
43C I m p l i c i t T y p e s
44C-----------------------------------------------
45#include "implicit_f.inc"
46C-----------------------------------------------
47C C o m m o n B l o c k s
48C-----------------------------------------------
49#include "com01_c.inc"
50#include "param_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER, INTENT(IN) :: NG
55 TYPE(elbuf_struct_), TARGET, DIMENSION(NGROUP) :: ELBUF_TAB
56 INTEGER, INTENT(IN) :: IPARG(NPARG, *)
57 INTEGER, INTENT(IN) :: ITASK ! SMP TASK
58 TYPE(multi_fvm_struct), INTENT(INOUT) :: MULTI_FVM
59 my_real, INTENT(INOUT) :: partsav(*), gresav(*)
60 INTEGER, INTENT(IN) :: IPARTS(*), IGRTH(*), GRTH(*)
61 my_real, INTENT(IN) :: volnew(*),timestep
62 LOGICAL, INTENT(IN) :: PRED
63C-----------------------------------------------
64C L o c a l V a r i a b l e s
65C-----------------------------------------------
66 TYPE(g_bufel_), POINTER :: GBUF
67 INTEGER :: II, I
68 my_real :: rho, etot, vel2, vol, sumflux(5)
69 my_real :: vii(5)
70 INTEGER :: NEL, NFT
71C-----------------------------------------------
72C B e g i n n i n g o f s u b r o u t i n e
73C-----------------------------------------------
74 gbuf => elbuf_tab(ng)%GBUF
75 nel = iparg(2, ng)
76 nft = iparg(3, ng)
77
78C Update global quantities
79 DO ii = 1, nel
80 i = ii + nft
81 vii(1) = multi_fvm%RHO(i)
82 vii(2) = multi_fvm%VEL(1, i)
83 vii(3) = multi_fvm%VEL(2, i)
84 vii(4) = multi_fvm%VEL(3, i)
85 vii(5) = multi_fvm%EINT(i)
86 ! Divide vy new volume
87 vii(1:5) = vii(1:5) / volnew(ii)
88! RHO
89 multi_fvm%RHO(i) = vii(1)
90! Velocity
91 multi_fvm%VEL(1, i) = vii(2) / vii(1)
92 multi_fvm%VEL(2, i) = vii(3) / vii(1)
93 multi_fvm%VEL(3, i) = vii(4) / vii(1)
94! Square norm of the velocity
95 vel2 = multi_fvm%VEL(1, i)**2 + multi_fvm%VEL(2, i)**2 + multi_fvm%VEL(3, i)**2
96! Internal energy
97 multi_fvm%EINT(i) = vii(5) - half * vel2 * vii(1)
98 ENDDO
99C Balance for output
100 IF (.NOT. pred) THEN
101 CALL multi_bilan(partsav, volnew, multi_fvm,
102 . nel, nft, iparts(1 + nft), gresav, igrth, grth)
103 IF(ALLOCATED(multi_fvm%ACC))THEN
104 DO ii = 1, nel
105 i = ii + nft
106 !derivative of velocity increment
107 ! (%ACC contains previous velocity)
108 multi_fvm%ACC(1,i) = (multi_fvm%VEL(1,i)-multi_fvm%ACC(1,i))/timestep
109 multi_fvm%ACC(2,i) = (multi_fvm%VEL(2,i)-multi_fvm%ACC(2,i))/timestep
110 multi_fvm%ACC(3,i) = (multi_fvm%VEL(3,i)-multi_fvm%ACC(3,i))/timestep
111 ENDDO
112 ENDIF
113 ENDIF
114C-----------------------------------------------
115C E n d o f s u b r o u t i n e
116C-----------------------------------------------
117 END SUBROUTINE multi_update_global
#define my_real
Definition cppsort.cpp:32
subroutine multi_bilan(partsav, vol, multi_fvm, nel, nft, iparts, gresav, igrth, grth)
Definition multi_bilan.F:33
subroutine multi_update_global(ng, elbuf_tab, iparg, itask, multi_fvm, partsav, iparts, gresav, igrth, grth, volnew, pred, timestep)