OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
alemuscl_upwind2.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!|| alemuscl_upwind2 ../engine/source/ale/alemuscl/alemuscl_upwind2.F
25!||--- called by ------------------------------------------------------
26!|| afluxt ../engine/source/ale/ale51/afluxt.F
27!||--- uses -----------------------------------------------------
28!|| ale_connectivity_mod ../common_source/modules/ale/ale_connectivity_mod.F
29!|| alemuscl_mod ../common_source/modules/ale/alemuscl_mod.F
30!|| i22bufbric_mod ../common_source/modules/interfaces/cut-cell-search_mod.f
31!|| i22tri_mod ../common_source/modules/interfaces/cut-cell-search_mod.F
32!|| segvar_mod ../engine/share/modules/segvar_mod.F
33!||====================================================================
34 SUBROUTINE alemuscl_upwind2(FLUX, ALE_CONNECT, X, IXQ, FLUX_VOIS,
35 . N4_VOIS, ITAB, NV46, ITRIMAT, SEGVAR)
36C-----------------------------------------------
37C D e s c r i p t i o n
38C This subroutines performs the following steps:
39C 1 - compute a gradient for volume fraction ALPH
40C (calls GRADIENT_RECONSTRUCTION)
41C 2 - reconstruct a value for volume fraction on each edge of the mesh
42C based on an affine approximation
43C 3 - upwind this value on the edge and store it in the flux
44C-----------------------------------------------
46 USE i22tri_mod
48 USE segvar_mod
50C-----------------------------------------------
51C I m p l i c i t T y p e s
52C-----------------------------------------------
53#include "implicit_f.inc"
54C-----------------------------------------------
55C C o m m o n B l o c k s
56C-----------------------------------------------
57#include "spmd_c.inc"
58#include "vect01_c.inc"
59#include "com04_c.inc"
60C-----------------------------------------------
61C D u m m y A r g u m e n t s
62C-----------------------------------------------
63 INTEGER, INTENT(IN) :: NV46
64 my_real, INTENT(OUT) :: flux(nv46, *)
65 my_real, INTENT(IN) :: x(3, numnod)
66 INTEGER, INTENT(IN) :: IXQ(NIXQ, NUMELQ)
67 my_real, INTENT(OUT) :: flux_vois(numelq+nqvois, nv46)
68 INTEGER, INTENT(OUT) :: N4_VOIS(NUMELQ+NQVOIS,8)
69 INTEGER, INTENT(IN) :: ITAB(NUMNOD)
70 INTEGER, INTENT(IN) :: ITRIMAT
71 TYPE(t_segvar),INTENT(IN) :: SEGVAR
72 TYPE(t_ale_connectivity), INTENT(IN) :: ALE_CONNECT
73C-----------------------------------------------
74C L o c a l V a r i a b l e s
75C-----------------------------------------------
76 INTEGER :: I, II, KK, JJ, IAD2, IAD3
77 INTEGER :: NEIGHBOOR_LIST(NV46), FACE_NEIGHBOOR(NV46)
78 my_real :: alphak
79 my_real :: yk, zk
80 my_real :: yf, zf
81 INTEGER :: FACE_TO_NODE_LOCAL_ID(4, 2), NODEID1, NODEID2
82C-----------------------------------------------
83C S o u r c e L i n e s
84C-----------------------------------------------
85!!! Once for all, associate node local id to a face number
86!!! Face 1
87 face_to_node_local_id(1, 1) = 1 ; face_to_node_local_id(1, 2) = 2
88!!! Face 2
89 face_to_node_local_id(2, 1) = 2 ; face_to_node_local_id(2, 2) = 3
90!!! Face 3
91 face_to_node_local_id(3, 1) = 3 ; face_to_node_local_id(3, 2) = 4
92!!! Face 4
93 face_to_node_local_id(4, 1) = 4 ; face_to_node_local_id(4, 2) = 1
94!!! First of all, compute gradient for alpha
95 DO i = lft, llt
96 ii = i + nft
97 iad2 = ale_connect%ee_connect%iad_connect(ii)
98 !!! Element centroid
99 yk = alemuscl_buffer%ELCENTER(ii,2) ;
100 zk = alemuscl_buffer%ELCENTER(ii,3)
101 !!! Neighbors
102 DO kk = 1, nv46
103 !!! Only for outgoing fluxes
104 IF (flux(kk, ii) > zero) THEN
105 !!! Storing neighbor indexes
106 neighboor_list(kk) = ale_connect%ee_connect%connected(iad2 + kk - 1)
107 face_neighboor(kk) = kk
108 IF (neighboor_list(kk) <= 0) THEN
109 IF(neighboor_list(kk)==0)neighboor_list(kk) = ii
110 !case <0 is for eBCS. -NEIGHBOR_LIST is then the segment number
111 ELSEIF (neighboor_list(kk) <= numelq) THEN
112 iad3 = ale_connect%ee_connect%iad_connect(neighboor_list(kk))
113 !!! Store the face number to which II and NEIGHBOR_LIST(KK) are adjacent
114 DO jj = 1, nv46
115 IF (ale_connect%ee_connect%connected(iad3 + jj - 1) == ii) THEN
116 face_neighboor(kk) = jj
117 ENDIF
118 ENDDO ! jj = 1, nv46
119 ENDIF
120
121 nodeid1 = ixq(1 + face_to_node_local_id(kk, 1), ii)
122 nodeid2 = ixq(1 + face_to_node_local_id(kk, 2), ii)
123
124 yf = half * (x(2, nodeid1) + x(2, nodeid2))
125 zf = half * (x(3, nodeid1) + x(3, nodeid2))
126
127 !!! Reconstruct second order value for ALPHA(II) on the face
128 alphak = alemuscl_buffer%VOLUME_FRACTION(ii,itrimat)
129 . + alemuscl_buffer%GRAD(ii,2,itrimat) * (yf - yk)
130 . + alemuscl_buffer%GRAD(ii,3,itrimat) * (zf - zk)
131
132 !!! Partial volume flux is then computed as:
133 flux(kk, ii) = alphak * flux(kk, ii)
134 IF (neighboor_list(kk) > 0)THEN
135 IF (neighboor_list(kk) <= numelq) THEN
136 !!! The opposite of the flux goes to the neighbor
137 flux(face_neighboor(kk), neighboor_list(kk)) = -flux(kk, ii)
138 ELSE
139 !!! cf. ALE51_ANTIDIFF3
140 flux_vois(ii, kk) = flux(kk, ii)
141 n4_vois(ii, 1) = itab(ixq(2, ii))
142 n4_vois(ii, 2) = itab(ixq(3, ii))
143 n4_vois(ii, 3) = itab(ixq(4, ii))
144 n4_vois(ii, 4) = itab(ixq(5, ii))
145 ENDIF
146 ENDIF
147 ENDIF ! (FLUX(KK, II) > ZERO)
148 ENDDO ! KK = 1, NV46
149 ENDDO ! I = LFT, LLT
150
151C-----------------------------------------------
152C flux entrant par EBCS
153C-----------------------------------------------
154 IF(nsegflu > 0)THEN
155 DO i = lft, llt
156 ii = i + nft
157 iad2 = ale_connect%ee_connect%iad_connect(ii)
158 DO kk=1,4
159 IF(flux(kk,ii) < zero .AND. ale_connect%ee_connect%connected(iad2 + kk - 1) < 0)THEN
160 flux(kk,ii) = segvar%PHASE_ALPHA(itrimat,-ale_connect%ee_connect%connected(iad2 + kk - 1))*flux(kk,ii)
161 ENDIF
162 ENDDO
163 ENDDO
164 ENDIF
165
166C-----------------------------------------------
167 END SUBROUTINE alemuscl_upwind2
subroutine alemuscl_upwind2(flux, ale_connect, x, ixq, flux_vois, n4_vois, itab, nv46, itrimat, segvar)
#define my_real
Definition cppsort.cpp:32
type(alemuscl_buffer_) alemuscl_buffer