This file is indexed.

/usr/share/code_saturne/user_examples/cs_user_physical_properties-richards_sat.f90 is in code-saturne-data 4.3.3+repack-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
!-------------------------------------------------------------------------------

!                      Code_Saturne version 4.3.3
!                      --------------------------
! This file is part of Code_Saturne, a general-purpose CFD tool.
!
! Copyright (C) 1998-2016 EDF S.A.
!
! This program is free software; you can redistribute it and/or modify it under
! the terms of the GNU General Public License as published by the Free Software
! Foundation; either version 2 of the License, or (at your option) any later
! version.
!
! This program is distributed in the hope that it will be useful, but WITHOUT
! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
! FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
! details.
!
! You should have received a copy of the GNU General Public License along with
! this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
! Street, Fifth Floor, Boston, MA 02110-1301, USA.

!-------------------------------------------------------------------------------

!===============================================================================
! Purpose:
! -------

!> \file cs_user_physical_properties-richards_sat.f90
!>
!> \brief Definition of physical variable laws example.
!>
!> See \subpage physical_properties for examples.
!>
!-------------------------------------------------------------------------------

subroutine usphyv &
 ( nvar   , nscal  ,                                              &
   mbrom  ,                                                       &
   dt     )

use paramx
use pointe
use numvar
use optcal
use cstphy
use entsor
use parall
use period
use ppppar
use ppthch
use ppincl
use field
use mesh
use darcy_module

!===============================================================================

implicit none

! Arguments

integer          nvar   , nscal

integer          mbrom

double precision dt(ncelet)

! Local variables

double precision darcy_isotropic_dispersion, molecular_diffusion
double precision velocity_norm
integer          iel, ii, fid
integer          ncelt, icelt, ifcvsl
character*80     fname

integer, allocatable, dimension(:) :: lstcel
integer, allocatable, dimension(:) :: delay_id
double precision, dimension(:), pointer :: delay, capacity, permeability
double precision, dimension(:,:), pointer :: tensor_permeability
double precision, dimension(:), pointer :: cpro_vscalt, saturation
double precision, dimension(:,:), pointer :: vel
double precision, dimension(:), pointer :: cvar_pr

!===============================================================================
! Initialisation
!===============================================================================

! Initialisation of delay table for each solute
allocate(delay_id(nscal))
do ii = 1, nscal
  ! Name of the scalar ivar
  call field_get_name(ivarfl(isca(ii)), fname)
  ! Index of the corresponding field
  call field_get_id(trim(fname)//'_delay', delay_id(ii))
enddo

! Index field for the capacity table (C = grad(theta)/grad(h))
call field_get_val_s_by_name('capacity', capacity)

! Index field for the saturation table (theta)
call field_get_val_s_by_name('saturation', saturation)

! Index field for permeability for the flow part
if (darcy_anisotropic_permeability.eq.0) then
  call field_get_val_s_by_name('permeability', permeability)
else
  call field_get_id('permeability',fid)
  call field_get_val_v(fid, tensor_permeability)
endif

! Index for hydraulic head (H=h+z) and darcian velocity
call field_get_val_s(ivarfl(ipr), cvar_pr)
call field_get_val_v(ivarfl(iu), vel)

!===============================================================================
! Example of the physical properties definition of two fully saturated soils
!===============================================================================
! Flow part
!==========

allocate(lstcel(ncel))

!< [richards_flow_soils]
! Set parameters for soil 1
call getcel('SOIL1', ncelt, lstcel)

! Loop on cell of the list
do icelt = 1, ncelt

  ! Cell number
  iel = lstcel(icelt)

  ! Set saturation and capacity (0 if saturated)
  saturation(iel) = 0.6d0
  capacity(iel) = 0.d0

  ! Set permeability
  if (darcy_anisotropic_permeability.eq.0) then
    permeability(iel) = 1.d-1
  else
    tensor_permeability(1,iel) = 1.d-1
    tensor_permeability(2,iel) = 1.d-1
    tensor_permeability(3,iel) = 1.d-2
    tensor_permeability(4:6,iel) = 0.d0
  endif

enddo

! Set parameters for soil 2
call getcel('SOIL2', ncelt, lstcel)

! Loop on cell of the list
do icelt = 1, ncelt

  ! Cell number
  iel = lstcel(icelt)

  ! Set saturation and capacity (0 if saturated)
  saturation(iel) = 0.4d0
  capacity(iel) = 0.d0

  ! Set permeability
  if (darcy_anisotropic_permeability.eq.0) then
    permeability(iel) = 5.d-1
  else
    tensor_permeability(1,iel) = 5.d-1
    tensor_permeability(2,iel) = 5.d-1
    tensor_permeability(3,iel) = 5.d-2
    tensor_permeability(4:6,iel) = 0.d0
  endif

enddo
!< [richards_flow_soils]

!===============
! Transport part
!===============

! Loop on solute
do ii = 1, nscal

  ! Index field for delay
  call field_get_val_s(delay_id(ii), delay)

  ! Index field for diffusion (dispersion and molecular diffusion) for the transport part
  call field_get_key_int(ivarfl(isca(ii)), kivisl, ifcvsl)
  if (ifcvsl.ge.0) then
    call field_get_val_s(ifcvsl, cpro_vscalt)
  else
    cpro_vscalt => NULL()
  endif

  !< [richards_flow_solut]
  ! Definition of the isotropic diffusion (dispersion and moleculer diffusion)
  call getcel ('SOIL1', ncelt, lstcel)
  darcy_isotropic_dispersion = 1.d0
  molecular_diffusion = 1.d-6
  do icelt = 1, ncelt
    iel = lstcel(icelt)
    if (ifcvsl.ge.0) then
      velocity_norm = sqrt(vel(1,iel)**2+vel(2,iel)**2+vel(3,iel)**2)
      cpro_vscalt(iel) = darcy_isotropic_dispersion * velocity_norm + &
                         saturation(iel) * molecular_diffusion
    endif
  enddo

  ! Definition of the isotropic diffusion (dispersion and moleculer diffusion)
  call getcel ('SOIL2', ncelt, lstcel)
  darcy_isotropic_dispersion = 0.2d0
  molecular_diffusion = 1.d-8
  do icelt = 1, ncelt
    iel = lstcel(icelt)
    if (ifcvsl.ge.0) then
      velocity_norm = sqrt(vel(1,iel)**2+vel(2,iel)**2+vel(3,iel)**2)
      cpro_vscalt(iel) = darcy_isotropic_dispersion * velocity_norm + &
                         saturation(iel) * molecular_diffusion
    endif
  enddo

  ! No delay for both soils
  do iel = 1, ncel
    delay(iel) = 1.d0
  enddo
  !< [richards_flow_solut]

enddo

deallocate(delay_id)

!===============================================================================

return
end subroutine usphyv