Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #33

Open
wants to merge 42 commits into
base: wetdry-ahfc
Choose a base branch
from
Open

Dev #33

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
dc91219
Merge pull request #23 from IPH-ECO/dev
cayolopesbc Apr 29, 2020
9ef2aae
change
Apr 29, 2020
4c202e2
Outros connflitos oriundos do merge com a #dev
Apr 30, 2020
4a12275
Correção no mapeamento do eta inicial e coeficiente de condutividade(…
May 4, 2020
b36690d
Remover pasta .vs
May 4, 2020
a14f6d5
Correcoes no modulo velocitiesSUB e insercao do Flag subsurface no mo…
May 7, 2020
9cd8259
atualizacao da branch.
May 7, 2020
ff0eadc
correcao no flag subsurface no modulo hydro.
May 7, 2020
baf8f93
Outra correcao no hydro.
May 7, 2020
0cca555
Correcao na rotina Volume.
May 7, 2020
2019bd6
Correcao na definicao da Water Depth (HydroParam%H).
May 7, 2020
a6e1b36
Correcoes no calculo do LHS/RHS nos modulos Hydro e MatOp.
May 8, 2020
0d07e9d
revisão do código subsuperficial corrigino alguns erros de implementa…
HfCunha May 8, 2020
c4a479e
Merge pull request #27 from IPH-ECO/master
carlosruberto May 8, 2020
18808ef
Merge pull request #28 from IPH-ECO/dev
cayolopesbc May 8, 2020
6563330
Alteracao na definicao do LIMCAM. Considera o caso onde o usuário nao…
May 11, 2020
b2ebbde
Alteracao no mapeamento do Ze, para vizualizacao do subsurface no vtk…
May 11, 2020
190bdd6
changes em .suo
May 12, 2020
f5ad4b5
Changes in volume, mod_mesh e hydroIniCond.
May 12, 2020
d707078
Removendo .vs dir
May 12, 2020
afc0e8b
Removendo .vs dir
May 12, 2020
5326139
Removendo .vs dir
May 12, 2020
9a1a461
Mapeamento de DZh/DZj para auxiliar nas condicoes de separacao entre …
May 14, 2020
a7a1604
Adaptacao de camadas mistas baseadas em DZh e DZs. Alteracao no mapea…
May 15, 2020
99377ca
Código com alterações para o benchmark nos modulos mod_mesh (alteraçã…
Jun 9, 2020
2c6f76c
Adaptação do ELM para separar superficial e subsuperficial. A saída v…
Jun 27, 2020
f645cf4
remocao diretorio vtune
Jun 27, 2020
0563a67
Versão com sub estável com ELM desligado
Oct 4, 2020
c90b7eb
Versão com sub estável com ELM desligado - conflitos resolvidos
Oct 4, 2020
c84b3c5
Adaptação interpolação bilinear para subsuperficial acoplado (testes …
Oct 6, 2020
3fa82be
Atualizacao do quicksearch na rotina ELMConservative
Oct 6, 2020
1ebc27a
Inserção dos vetores de velocidade no tempo tn-1; Correcao RK ordem u…
Oct 20, 2020
a9b53f2
alteração do ELM na região de BC; testes com profundidade utilizando …
Oct 23, 2020
f14f06c
RK 4 ordem melhorou a precisão da trajetoria; Profundidade nas faces …
Oct 23, 2020
e610269
Correcoes na definicao dos etas, em condicoes de fluxo subsuperficial…
cayolopesbc Dec 15, 2020
6cd23e8
Alteracao na ordem do algoritmo em ReadHydroIniCond e Hydro; Implemen…
cayolopesbc Dec 15, 2020
6b4faf4
Altercao na ordem das rotinas ReadHydroIniCond e Hydro; Alteracao do …
cayolopesbc Dec 15, 2020
5db5611
Correcoes nas curvas de saturacao; novas correcoes nas definicioes da…
cayolopesbc Dec 15, 2020
68ab3ac
Correcoes na versao 3D; adaptacao do 3D para o subsuperficial; Modulo…
cayolopesbc Jan 8, 2021
1a488cd
Versão mais estável para bench 02 parte 1.
cayolopesbc Jan 14, 2021
793d201
Algoritmo de Newton-Casulli superficial ok
cayolopesbc Feb 24, 2021
65a0f01
Merge pull request #35 from IPH-ECO/subsurface-surface
carlosruberto Nov 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*.user
*.userosscache
*.sln.docstates
ubsubsurface.f90

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand All @@ -28,7 +29,7 @@ bld/
[Ll]og/

# Visual Studio 2015/2017 cache/options directory
.vs/
*.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

Expand Down
Binary file removed .vs/iph-eco-model/v16/.suo
Binary file not shown.
825 changes: 825 additions & 0 deletions AdvcConservativeScheme.f90

Large diffs are not rendered by default.

61 changes: 54 additions & 7 deletions AllocateHydroVars.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ Subroutine AllocateHydroVars(HydroParam,MeshParam)
Allocate(HydroParam%Fvu(MeshParam%Kmax,MeshParam%nEdge))
Allocate(HydroParam%Fuv(MeshParam%Kmax,MeshParam%nEdge))
Allocate(HydroParam%u(MeshParam%Kmax,MeshParam%nEdge))

Allocate(HydroParam%psij(MeshParam%Kmax,MeshParam%nEdge))
Allocate(HydroParam%rj(MeshParam%Kmax,MeshParam%nEdge))

Allocate(HydroParam%utang(MeshParam%Kmax,MeshParam%nEdge))
Allocate(HydroParam%Wu(MeshParam%Kmax,MeshParam%nEdge))
Allocate(HydroParam%uxyback(MeshParam%Kmax,2,MeshParam%nEdge))
Allocate(HydroParam%uArrow(MeshParam%Kmax,3,MeshParam%nEdge))
Allocate(HydroParam%ubBack(MeshParam%Kmax,3,MeshParam%nElem))
Allocate(HydroParam%uxy(MeshParam%Kmax,2,MeshParam%nEdge))
Allocate(HydroParam%uxyL(MeshParam%Kmax+1,2,MeshParam%nElem))
Expand All @@ -49,9 +54,20 @@ Subroutine AllocateHydroVars(HydroParam,MeshParam)
Allocate(HydroParam%psi_edge(MeshParam%Kmax,MeshParam%nEdge))
Allocate(HydroParam%psi_cell(MeshParam%Kmax,MeshParam%nElem))

Allocate (HydroParam%ugt(MeshParam%nEdge,MeshParam%kMax+1))
Allocate (HydroParam%vgt(MeshParam%nEdge,MeshParam%kMax+1))
Allocate (HydroParam%wgt(MeshParam%nEdge,MeshParam%kMax+1))
Allocate(HydroParam%ubt(MeshParam%Kmax,3,MeshParam%nElem))
Allocate(HydroParam%ubVt(MeshParam%Kmax,3,MeshParam%nNode))
Allocate(HydroParam%uxyt(MeshParam%Kmax,2,MeshParam%nEdge))
Allocate(HydroParam%uxyLt(MeshParam%Kmax+1,2,MeshParam%nElem))
Allocate(HydroParam%uNodet(MeshParam%Kmax+1,3,MeshParam%nNode))
Allocate(HydroParam%wfct(MeshParam%Kmax,MeshParam%nEdge))


! 2.2. Others Variables
Allocate(HydroParam%etaInf(MeshParam%nElem))
Allocate(HydroParam%etaInfn(MeshParam%nElem))
Allocate(HydroParam%etaplus(MeshParam%nElem))
Allocate(HydroParam%peta(MeshParam%nNode))
Allocate(HydroParam%petan(MeshParam%nNode))
Expand Down Expand Up @@ -116,25 +132,57 @@ Subroutine AllocateHydroVars(HydroParam,MeshParam)
!Allocate(HydroParam%Fq(MeshParam%Kmax,MeshParam%nElem))

Allocate(HydroParam%Vol(MeshParam%nElem)) !CAYO
Allocate(HydroParam%Hs(MeshParam%nEdge)) !CAYO

Allocate(MeshParam%ei(MeshParam%Kmax,MeshParam%nElem))!CAYO
Allocate(MeshParam%Ki(MeshParam%Kmax,MeshParam%nElem))!CAYO
Allocate(MeshParam%Ksat(MeshParam%Kmax,MeshParam%nElem))!CAYO
Allocate(MeshParam%nSoil(MeshParam%Kmax,MeshParam%nElem))!CAYO
Allocate(MeshParam%alpha(MeshParam%Kmax,MeshParam%nElem))!CAYO
Allocate(MeshParam%Kj(MeshParam%Kmax,MeshParam%nEdge))!CAYO

If(MeshParam%Kmax > 1) Then
Allocate(MeshParam%Si(MeshParam%Kmax,MeshParam%nElem))!CAYO
Allocate(HydroParam%SScalar(MeshParam%nElem*MeshParam%Kmax))
Else
Allocate(MeshParam%Si(MeshParam%subfactor+1,MeshParam%nElem))!CAYO
Allocate(HydroParam%SScalarSaturation(MeshParam%nElem*(MeshParam%subfactor+1)))
EndIf

Allocate(HydroParam%us(MeshParam%Kmax,MeshParam%nEdge)) !CAYO
Allocate(HydroParam%ust(MeshParam%Kmax,MeshParam%nEdge)) !CAYO
Allocate(HydroParam%ustang(MeshParam%Kmax,MeshParam%nEdge)) !CAYO
Allocate(HydroParam%um(MeshParam%Kmax,MeshParam%nEdge))!CAYO
Allocate(HydroParam%umt(MeshParam%Kmax,MeshParam%nEdge))!CAYO
Allocate(HydroParam%umtang(MeshParam%Kmax,MeshParam%nEdge))!CAYO
Allocate(HydroParam%wm(MeshParam%Kmax+1,MeshParam%nElem))
Allocate(HydroParam%wmt(MeshParam%Kmax+1,MeshParam%nElem))

Allocate(HydroParam%uxysub(MeshParam%Kmax,2,MeshParam%nEdge))
Allocate(HydroParam%ubsub(MeshParam%Kmax,3,MeshParam%nElem))

Allocate(HydroParam%DZsj(MeshParam%Kmax,MeshParam%nEdge)) !CAYO
Allocate(HydroParam%DZsjt(MeshParam%Kmax,MeshParam%nEdge)) !CAYO
Allocate(HydroParam%DZhj(MeshParam%Kmax,MeshParam%nEdge)) !CAYO
Allocate(HydroParam%DZhjt(MeshParam%Kmax,MeshParam%nEdge)) !CAYO

Allocate(HydroParam%DZsi(MeshParam%Kmax,MeshParam%nEdge)) !CAYO
Allocate(HydroParam%DZsit(MeshParam%Kmax,MeshParam%nEdge)) !CAYO
Allocate(HydroParam%DZhi(MeshParam%Kmax,MeshParam%nEdge)) !CAYO
Allocate(HydroParam%DZhit(MeshParam%Kmax,MeshParam%nEdge)) !CAYO
Allocate(HydroParam%DZsi(MeshParam%Kmax,MeshParam%nElem)) !CAYO
Allocate(HydroParam%DZsit(MeshParam%Kmax,MeshParam%nElem)) !CAYO
Allocate(HydroParam%DZhi(MeshParam%Kmax,MeshParam%nElem)) !CAYO
Allocate(HydroParam%DZhit(MeshParam%Kmax,MeshParam%nElem)) !CAYO
Allocate(HydroParam%PsiCrit(MeshParam%nElem)) !CAYO

Allocate(HydroParam%DZK(MeshParam%nEdge)) !Sediment Layer !CAYO
Allocate(HydroParam%Gusub(MeshParam%Kmax,MeshParam%nEdge))

Allocate(HydroParam%etak(MeshParam%nElem))
Allocate(HydroParam%etam(MeshParam%nElem))
Allocate(HydroParam%Qk(MeshParam%nElem))
Allocate(HydroParam%Ci(MeshParam%nElem))
Allocate(HydroParam%d(MeshParam%nElem))
Allocate(HydroParam%Vol2(MeshParam%nElem))
Allocate(HydroParam%Vol1(MeshParam%nElem))

Allocate(HydroParam%utangNodes(2,MeshParam%nEdge))

! 3. Hydrodynamic output variables (VTK)
Allocate(MeshParam%xPoint(MeshParam%nPoint*(MeshParam%Kmax+1)))
Expand All @@ -152,5 +200,4 @@ Subroutine AllocateHydroVars(HydroParam,MeshParam)
Allocate(HydroParam%IndexWaterLevelEdge(MeshParam%nEdge))


End Subroutine AllocateHydroVars

End Subroutine AllocateHydroVars
3 changes: 3 additions & 0 deletions CGOp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Subroutine CGOp(a,b,dt,HydroParam,MeshParam)
N = MeshParam%nElem
b = a ! Initial guess
Call MatOp(b,Ab,dt,HydroParam,MeshParam)
! b - Ab = %Deta - (P+T).eta(k,0)
r = b - Ab
pCG = r ! Steepest Descent Direction
alpha = Dot_Product(r,r) ! Square of the norm of r
Expand All @@ -41,6 +42,7 @@ Subroutine CGOp(a,b,dt,HydroParam,MeshParam)
!Print*, 'The system has been solved with: ',k, 'CGOp iterations'
Return
EndIf

Call MatOp(pCG,v,dt,HydroParam,MeshParam)

lambda = alpha/Dot_Product(pCG,v)
Expand All @@ -49,6 +51,7 @@ Subroutine CGOp(a,b,dt,HydroParam,MeshParam)
alphanew = Dot_Product(r,r)
pCG = r + alphanew/alpha*pCG
alpha = alphanew

EndDo

Return
Expand Down
60 changes: 60 additions & 0 deletions CGOpSub.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Subroutine CGOpSub(a,b,dt,HydroParam,MeshParam)

! Matrix Free Conjugate Gradient Method
! Input:
! a -> Input Matrix
! Output:
! b -> Solution

! List of Modifications:
! -> 10.03.2014: Routine Implementation (Rafael Cavalcanti)
! -> 10.03.2014: Fortran Sintax (Rafael Cavalcanti)
! Programmer: Michael Dumbser

Use MeshVars !, Only: nElem, Edge, Neighbor, EdgeLength, Cirdistance
Use Hydrodynamic
!Use SimulationModel, Only: dt,NearZero
Implicit None
Real:: alpha, tol, lambda, alphanew
Integer:: k, N
Integer:: iElem, iEdge, Pij, Face
Real:: Soma, Coef
Real:: NearZero = 1e-10
Real:: dt
type(MeshGridParam) :: MeshParam
type(HydrodynamicParam) :: HydroParam
Real, intent(in) :: a(MeshParam%nElem)
Real, intent(out) :: b(MeshParam%nElem)
Real:: r(MeshParam%nElem), Ab(MeshParam%nElem), pCG(MeshParam%nElem), v(MeshParam%nElem)

N = MeshParam%nElem
!%Deta = %F == residual k == V1(eta) + [T - Q(k-1)]eta - d(k-1) = Error in Water Volume
b = a ! Initial guess
!Ab == (P(k,l-1) + T - Q(k-1,l-1)).eta(k,l)
Call MatOp(HydroParam%eta,Ab,dt,HydroParam,MeshParam)
! b - Ab = V1(eta) + [T - Q(k-1)]eta - d(k-1) + P(k,l-1).eta(k,l-1)
r = b - Ab + HydroParam%P*HydroParam%eta
pCG = r ! Steepest Descent Direction
alpha = Dot_Product(r,r) ! Square of the norm of r
tol = 1e-14 ! Tolerance

Do k = 1,1000*N
If ( sqrt(alpha) < tol ) Then
! System has been solved
!Print*, 'The system has been solved with: ',k, 'CGOp iterations'
Return
EndIf

Call MatOp(pCG,v,dt,HydroParam,MeshParam)

lambda = alpha/Dot_Product(pCG,v)
b = b + lambda*pCG
r = r - lambda*v
alphanew = Dot_Product(r,r)
pCG = r + alphanew/alpha*pCG
alpha = alphanew

EndDo

Return
End Subroutine CGOpSub
35 changes: 35 additions & 0 deletions DestroyHydro.f90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,22 @@ Subroutine DestroyHydro(HydroParam)
Deallocate(HydroParam%ElSmallm)
Deallocate(HydroParam%ElCapitalM)

Deallocate(HydroParam%psij)
Deallocate(HydroParam%rj)

Deallocate(HydroParam%ubt)
Deallocate(HydroParam%uxyt)
Deallocate(HydroParam%uNodet)
Deallocate(HydroParam%ugt)
Deallocate(HydroParam%vgt)
Deallocate(HydroParam%wgt)
Deallocate(HydroParam%ubVt)
Deallocate(HydroParam%uxyLt)
Deallocate(HydroParam%wfct)


Deallocate(HydroParam%etaInf)
Deallocate(HydroParam%etaInfn)
Deallocate(HydroParam%etaplus)
Deallocate(HydroParam%peta)
Deallocate(HydroParam%petan)
Expand All @@ -34,6 +49,7 @@ Subroutine DestroyHydro(HydroParam)
Deallocate(HydroParam%u)
Deallocate(HydroParam%ut)
Deallocate(HydroParam%uxyback)
Deallocate(HydroParam%uArrow)
Deallocate(HydroParam%uNode)
Deallocate(HydroParam%uxy)
Deallocate(HydroParam%Wu)
Expand Down Expand Up @@ -93,6 +109,8 @@ Subroutine DestroyHydro(HydroParam)
Deallocate(HydroParam%ElSmallms)
Deallocate(HydroParam%ElCapitalMs)

Deallocate(HydroParam%etak)
Deallocate(HydroParam%etam)

Deallocate(HydroParam%DZsj) !CAYO
Deallocate(HydroParam%DZsjt)!CAYO
Expand All @@ -104,11 +122,28 @@ Subroutine DestroyHydro(HydroParam)
Deallocate(HydroParam%DZhit)!CAYO
Deallocate(HydroParam%Vol)!CAYO
Deallocate(HydroParam%DZK) !Sediment Layer
Deallocate(HydroParam%Gusub) !Sediment Layer
Deallocate(HydroParam%PsiCrit) !Sediment Layer

Deallocate(HydroParam%etak)
Deallocate(HydroParam%Qk)
Deallocate(HydroParam%Ci)
Deallocate(HydroParam%d)
Deallocate(HydroParam%Vol2)
Deallocate(HydroParam%Vol1)

Deallocate(HydroParam%us)!CAYO
Deallocate(HydroParam%ust)!CAYO
Deallocate(HydroParam%ustang)!CAYO
Deallocate(HydroParam%um)!CAYO
Deallocate(HydroParam%umt)!CAYO
Deallocate(HydroParam%umtang)!CAYO
Deallocate(HydroParam%wm)
Deallocate(HydroParam%wmt)
Deallocate(HydroParam%uxysub)
Deallocate(HydroParam%ubsub)

Deallocate(HydroParam%utangNodes)

Return
End Subroutine DestroyHydro
Expand Down
Loading