Dear everyone:
I want to carry out a hydrodynamic simulation of a lake. The lake only have one inlet, which is assigned as a water level boundary. However, the inlet has a gate and I want to simulate gate operation. The operation rule is simple: If the boundary water level is bigger than lake level, the gate is open, Else the gate is close. Therefore, i change the bord.f as follows:
ELSEIF(NCOTE.GT.0.OR.NOMIMP(1:1).NE.' ') THEN
N=NBOR(K)
IF(NCSIZE.GT.1) N=MESH%KNOLG%I(N)
Z = SL(IFRLIQ,N)
IF(H%R(NBOR(K))<=MAX( 0.D0 , Z-ZF(NBOR(K)) )) THEN
HBOR(K) = MAX( 0.D0 , Z-ZF(NBOR(K)) )
H%R(NBOR(K))=HBOR(K)
ELSE
ENDIF
However, the simulation collapsed. Could anyone tell me how to fix this problem.
The case file and fortran file are attached
Best wieshes.