ElmerFoamFSI  2.0
ElmerFoamFSI is fluid-solid interaction simulation application built up from OpenFOAM CFD and Elmer CSM coupled through the IMPACT multiphysics software integration infrastructure.
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Macros Groups Pages
LoadFunctionLibrary.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
5 !-------------------------------------------------------------------------------
6 FUNCTION loadxdirection(Model, inindex, Tvalue) RESULT(load)
7 
8  USE defutils
9  USE generalmodule
10 
11  IMPLICIT None
12 
13  TYPE(model_t) :: model
14  INTEGER :: inindex, funci
15  REAL(KIND=dp) :: tvalue, load, diff
16 
17  model%UDFUsed = .true.
18 
19  load = model%NodeLoadsPass(1,model%ElmerToMyNodes(inindex))
20  !WRITE(*,*) load
21 
22  IF (myverbosity > 3) WRITE(6,*)'Inside [LoadFunctionLibrary]...[LoadXDirection]'
23 
24  !Calculate diff for testing purposes
25  IF (tvalue < 8.001) THEN
26  diff = float(model%ElmerToMyNodes(inindex)-1)*3.0d0
27  diff = diff*tvalue/8.0d0
28  If (dabs(load - diff) > 1e-12) model%GetTestLoads = .false.
29  ELSE
30  diff = float(model%ElmerToMyNodes(inindex)-1)*3.0d0
31  WRITE(*,*) 'diff = ',diff
32  diff = diff + (tvalue- 8.0d0)/92.0d0
33  WRITE(*,*) 'diff = ',diff
34  If (dabs(load - diff) > 1e-12) model%GetTestLoads = .false.
35  END IF
36 
37  IF (myverbosity > 3) THEN
38  WRITE(6,*) 'inindex = ', inindex
39  WRITE(*,*) 'Load 1 for node:', &
40  model%NodeLoadsPass(1,model%ElmerToMyNodes(inindex))
41  WRITE(*,*) 'Time = ', tvalue
42  WRITE(*,*) 'diff = ',diff
43  END IF
44 
45 END FUNCTION loadxdirection
46 
47 FUNCTION loadydirection(Model, inindex, Tvalue) RESULT(load)
48 
49  USE defutils
50  USE generalmodule
51 
52  IMPLICIT None
53 
54  TYPE(model_t) :: model
55  INTEGER :: inindex, funci
56  REAL(KIND=dp) :: tvalue, load, diff
57 
58  ! M.S. Added
59  !WRITE (*,*) 'THIS COMMENT IS ADDED BY MASOUD'
60  ! M.S. Ended
61 
62  model%UDFUsed = .true.
63 
64  load = model%NodeLoadsPass(2,model%ElmerToMyNodes(inindex))
65 
66  IF (myverbosity > 3) WRITE(6,*)'Inside [LoadFunctionLibrary]...[LoadYDirection]'
67 
68  !Calculate diff for testing purposes
69  IF (tvalue < 8.001) THEN
70  diff = float(model%ElmerToMyNodes(inindex)-1)*3.0d0 + 1.0d0
71  diff = diff*tvalue/8.0d0
72  If (dabs(load - diff) > 1e-12) model%GetTestLoads = .false.
73  ELSE
74  diff = float(model%ElmerToMyNodes(inindex)-1)*3.0d0 + 1.0d0
75  WRITE(*,*) 'diff = ',diff
76  diff = diff + (tvalue-8.0d0)/92.0d0
77  WRITE(*,*) 'diff = ',diff
78  If (dabs(load - diff) > 1e-12) model%GetTestLoads = .false.
79  END IF
80 
81  IF (myverbosity > 3) THEN
82  WRITE(6,*) 'inindex = ', inindex
83  WRITE(*,*) 'Load 2 for node:', &
84  model%NodeLoadsPass(2,model%ElmerToMyNodes(inindex))
85  WRITE(*,*) 'Time = ', tvalue
86  WRITE(*,*) 'diff = ',diff
87  END IF
88 
89 
90 END FUNCTION loadydirection
91 
92 FUNCTION loadzdirection(Model, inindex, Tvalue) RESULT(load)
93 
94  USE defutils
95  USE generalmodule
96 
97  IMPLICIT None
98 
99  TYPE(model_t) :: model
100  INTEGER :: inindex, funci
101  REAL(KIND=dp) :: tvalue, load, diff
102 
103  model%UDFUsed = .true.
104 
105  load = model%NodeLoadsPass(3,model%ElmerToMyNodes(inindex))
106 
107  IF (myverbosity > 3) WRITE(6,*)'Inside [LoadFunctionLibrary]...[LoadZDirection]'
108 
109  !Calculate diff for testing purposes
110  IF (tvalue < 8.001) THEN
111  diff = float(model%ElmerToMyNodes(inindex)-1)*3.0d0 + 2.0d0
112  diff = diff*tvalue/8.0d0
113  If (dabs(load - diff) > 1e-12) model%GetTestLoads = .false.
114  ELSE
115  diff = float(model%ElmerToMyNodes(inindex)-1)*3.0d0 + 2.0d0
116  WRITE(*,*) 'diff = ',diff
117  diff = diff + (tvalue- 8.0d0)/92.0d0
118  WRITE(*,*) 'diff = ',diff
119  If (dabs(load - diff) > 1e-12) model%GetTestLoads = .false.
120  END IF
121 
122  IF (myverbosity > 3) THEN
123  WRITE(6,*) 'inindex = ', inindex
124  WRITE(*,*) 'Load 3 for node:', &
125  model%NodeLoadsPass(3,model%ElmerToMyNodes(inindex))
126  WRITE(*,*) 'Time = ', tvalue
127  WRITE(*,*) 'diff = ',diff
128  END IF
129 
130 END FUNCTION loadzdirection
131 
real(kind=dp) function loadzdirection(Model, inindex, Tvalue)
real(kind=dp) function loadydirection(Model, inindex, Tvalue)
real(kind=dp) function loadxdirection(Model, inindex, Tvalue)
File: LoadFunctionLibrary.F90 Written by: ML, 5 May 2010 Modified by: Jessica Kress.
ElmerLib Elmer library routines