OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
gradient_limitation2.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!|| gradient_limitation2 ../engine/source/ale/alemuscl/gradient_limitation2.F
25!||--- called by ------------------------------------------------------
26!|| ale51_gradient_reconstruction2 ../engine/source/ale/alemuscl/ale51_gradient_reconstruction2.F
27!||--- uses -----------------------------------------------------
28!|| alemuscl_mod ../common_source/modules/ale/alemuscl_mod.F
29!|| element_mod ../common_source/modules/elements/element_mod.F90
30!||====================================================================
31 SUBROUTINE gradient_limitation2(IXQ, X, TRIMAT)
32C-----------------------------------------------
33C D e s c r i p t i o n
34C limits the amplitude of this gradient in such a way that
35C extrapolated values on the nodes of the element lie between
36C local minimum and maximum values from the neighboring elements
37C -> maximum principle purpose
38C-----------------------------------------------
39C M o d u l e s
40C-----------------------------------------------
41 USE alemuscl_mod
42 use element_mod , only :nixq
43C-----------------------------------------------
44C I m p l i c i t T y p e s
45C-----------------------------------------------
46#include "implicit_f.inc"
47C-----------------------------------------------
48C C o m m o n B l o c k s
49C-----------------------------------------------
50#include "vect01_c.inc"
51#include "com04_c.inc"
52C-----------------------------------------------
53C D u m m y A r g u m e n t s
54C-----------------------------------------------
55 INTEGER, INTENT(IN) :: IXQ(NIXQ, NUMELQ), TRIMAT
56 my_real, INTENT(IN) :: x(3,numnod)
57C-----------------------------------------------
58C L o c a l V a r i a b l e s
59C-----------------------------------------------
60 INTEGER :: I, II, JJ
61 INTEGER :: NODE_ID
62 my_real :: reduc_factor(trimat), nodal_reduc_factor, yn, zn, valnode
63 INTEGER :: ITRIMAT
64 INTEGER :: NNUM
65 my_real :: yk, zk
66C-----------------------------------------------
67C S o u r c e L i n e s
68C-----------------------------------------------
69 !!! Limiting process for the computed gradient -> maximum principle
70 !!! and stability purposes
71 DO i = lft, llt
72 ii = i + nft
73 !!!centroid element
74 yk = alemuscl_buffer%ELCENTER(ii,2) ; zk = alemuscl_buffer%ELCENTER(ii,3)
75 reduc_factor = ep30
76 nnum = 0
77 DO itrimat = 1, trimat
78 IF(abs(alemuscl_buffer%GRAD(ii,2,itrimat)) +
79 . abs(alemuscl_buffer%GRAD(ii,3,itrimat)) > zero) THEN
80 nnum = nnum + 1
81 !!! Check the nodes of the element
82 DO jj = 1, 4
83 node_id = ixq(jj+1, ii)
84 !!! Get the node coordinates
85 yn = x(2, node_id) ; zn = x(3, node_id)
86 !!! Interpolate the function at the node
87 valnode = alemuscl_buffer%VOLUME_FRACTION(ii,itrimat)
88 . + alemuscl_buffer%GRAD(ii,2,itrimat) * (yn - yk)
89 . + alemuscl_buffer%GRAD(ii,3,itrimat) * (zn - zk)
90 nodal_reduc_factor = one
91 IF (valnode - alemuscl_buffer%VOLUME_FRACTION(ii,itrimat) > zero) THEN
92 nodal_reduc_factor =
93 . min((alemuscl_buffer%NODE_MAX_VALUE(node_id,itrimat) - alemuscl_buffer%VOLUME_FRACTION(ii,itrimat))
94 . / (valnode - alemuscl_buffer%VOLUME_FRACTION(ii,itrimat)), alemuscl_param%BETA)
95 ELSE IF (valnode - alemuscl_buffer%VOLUME_FRACTION(ii,itrimat) < zero) THEN
96 nodal_reduc_factor =
97 . min((alemuscl_buffer%NODE_MIN_VALUE(node_id,itrimat) - alemuscl_buffer%VOLUME_FRACTION(ii,itrimat))
98 . / (valnode - alemuscl_buffer%VOLUME_FRACTION(ii,itrimat)), alemuscl_param%BETA)
99 ENDIF
100 reduc_factor(itrimat) = min(reduc_factor(itrimat), nodal_reduc_factor)
101 ENDDO ! JJ = 1, 8
102 ELSE
103 reduc_factor(itrimat) = zero
104 ENDIF
105 ENDDO ! ITRIMAT = 1, TRIMAT
106
107 DO itrimat = 1, trimat
108 IF(abs(alemuscl_buffer%GRAD(ii,2,itrimat)) + abs(alemuscl_buffer%GRAD(ii,3,itrimat)) > zero) THEN
109 !!! Limitation of the gradient
110 alemuscl_buffer%GRAD(ii,2,itrimat) = reduc_factor(itrimat) * alemuscl_buffer%GRAD(ii,2,itrimat)
111 alemuscl_buffer%GRAD(ii,3,itrimat) = reduc_factor(itrimat) * alemuscl_buffer%GRAD(ii,3,itrimat)
112 ENDIF
113 ENDDO
114 ENDDO ! I = LFT, LLT
115C-----------------------------------------------
116 END SUBROUTINE gradient_limitation2
#define my_real
Definition cppsort.cpp:32
subroutine gradient_limitation2(ixq, x, trimat)
#define min(a, b)
Definition macros.h:20
type(alemuscl_param_) alemuscl_param
type(alemuscl_buffer_) alemuscl_buffer