Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
CB-Lim authored Apr 24, 2024
1 parent 30acce3 commit cb5eaf1
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# IHSetDean

Miller and Dean (2004) proposed a simple model for shoreline evolution using several field datasets. The model is developed based on the observation that shoreline positions change as a function of an equilibrium position. The model includes three adjustable parameters that represent the baseline conditions under which shoreline displacement is calculated to minimize the error. This model is very efficient because it only represents the shoreline response to the process and only requires input of readily available storm surge and water level data.
Dean (1991) have proposed the concept of an equilibrium beach profile. Dean (1991) derived the equilibrium beach profile model with the wave energy dissipation similar to other previous works (e.g., Bruun, 1954). The equilibrium beach profile equation is very simple, but has been used by many researchers for coastal engineering.


## Installation and use
Expand Down
27 changes: 6 additions & 21 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,12 @@ Dean (1991) have proposed the concept of an equilibrium beach profile. Dean (199

## Model formula

Miller and Dean (2004) suggested a simple shoreline evolution model based on the imbalance of shoreline change between an equilibrium shoreline change and shoreline position as follows:
Dean (1991) suggested an equilibrium beach profile model based on the wave energy dissipation as follows:

```text
(∂S(t))/∂t=k(S_eq (t)-S(t))
h=Ay^(2/3)
S(t) : the shoreline position at time t
S_eq : the equilibrium shoreline position
k : the calibration parameter for the rate at which the shoreline approaches equilibrium (k; k=k_a H_b^2; k=k_a H_b^3; k=k_a Ω)
```

Miller and Dean (2004) proposed an equilibrium shoreline change owing to the change of sea level (Fig. 4 1):

```text
S_eq=-W^* (t)((0.068H_b+S)/(B+1.28H_b ))
H_b : the breaking wave height
S : the change in local water level
B : the berm wave height
W^* : the width of the active surf zone
```

![Definition sketch of shoreline evolution](_static/images/Imagen1.png)

Fig. 4 1. Definition sketch of shoreline evolution according the change of water level owing to storm surge and wave setup (Miller and Dean, 2004).
h : the water depth
y : the offshore distance
A : the beach scale factor
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ classifiers = [
]
dynamic = ["version", "description"]

dependencies = ["numpy", "pytest >=7", "scipy", "xarray", "matplotlib","pandas"]
dependencies = ["numpy", "pytest >=7", "scipy", "xarray", "matplotlib","pandas", "netCDF4"]


[project.optional-dependencies]
Expand Down
9 changes: 5 additions & 4 deletions src/IHSetDean/IHSetDean.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,25 @@ class cal_Dean(object):
This class reads input datasets, performs its calibration.
"""
def __init__(self, path_prof, path_wav, Switch_Calibrate, Switch_Cal_DoC, **kwargs):
def __init__(self, path_prof, path_wav, Switch_Plot_prof, Switch_Calibrate, Switch_Cal_DoC, **kwargs):
self.path_prof = path_prof
self.path_wav = path_wav
prof = pd.read_csv(path_prof)
self.D50 = kwargs['D50'] # D50 is not necesarry if Switch_Calibrate = 1
self.MSL = -kwargs['MSL']
self.xm = np.linspace(kwargs['Xm'][0], kwargs['Xm'][1], 1000).reshape(-1, 1)

self.Switch_Plot_prof = Switch_Plot_prof
self.Switch_Calibrate = Switch_Calibrate
# Calibrate Dean parameter using profile data [0: no without obs (using D50); 1: no with obs (using D50); 2: yes (using Obs)]
if Switch_Calibrate == 1 or Switch_Calibrate == 2:
if Switch_Plot_prof == 1:
self.xp = prof.iloc[:, 0]
self.zp = prof.iloc[:, 1]
self.zp = abs(self.zp)
xp_inx = self.xp[(self.zp >= self.MSL)]
self.xp = self.xp - min(xp_inx)

if Switch_Calibrate == 2:
if Switch_Calibrate == 1:
self.Zmin = kwargs['Zmin']
self.Zmax = kwargs['Zmax']

Expand All @@ -43,7 +44,7 @@ def __init__(self, path_prof, path_wav, Switch_Calibrate, Switch_Cal_DoC, **kwar

H12,T12 = Hs12Calc(Hs,Tp)
self.DoC = depthOfClosure(H12,T12)
# self.DoC = self.DoC[0]
self.DoC = self.DoC[0]

def calibrate(self):

Expand Down
Binary file modified src/IHSetDean/__pycache__/IHSetDean.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions src/IHSetDean/tests/test_dean.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from IHSetDean import IHSetDean
import os
import matplotlib.pyplot as plt
from IHSetDean import IHSetDean

wrkDir = os.getcwd()
model = IHSetDean.cal_Dean(wrkDir+'/data/prof.csv',wrkDir+'/data/wav.nc', 2, 1, Xm = [0, 500], Zmin = 0.0, Zmax = 1.0, D50 = 0.5, MSL = 0.0)
model = IHSetDean.cal_Dean(wrkDir+'/data/prof.csv',wrkDir+'/data/wav.nc', 1, 1, 1, Xm = [0, 500], Zmin = 0.0, Zmax = 1.0, D50 = 0.5, MSL = 0.0)
self = IHSetDean.Dean(model.calibrate())

plt.rcParams.update({'font.family': 'serif'})
Expand Down Expand Up @@ -38,10 +38,10 @@
plt.xlim([self.xm[0]-20,xm_DoC_fill[-1]+20])
plt.ylim([self.MSL-1,self.DoC+0.5])

if self.Switch_Calibrate == 2:
if self.Switch_Calibrate == 1:
plt.fill([min(self.xm), min(self.xm), max(self.xm), max(self.xm)],
[self.Zmin, self.Zmax, self.Zmax, self.Zmin], color=[0.5, 0.5, 0.5], alpha=0.25)
if self.Switch_Calibrate == 1 or self.Switch_Calibrate == 2:
[self.Zmin, self.Zmax, self.Zmax, self.Zmin], color=[0.5, 0.5, 0.5], alpha=0.25, label='Calibration')
if self.Switch_Plot_prof == 1:
plt.plot(self.xp, self.zp, '--k', linewidth=2, label='Observed profile')[0]
plt.plot([min(self.xm), max(self.xm)], [self.MSL, self.MSL], '--b', linewidth=2)[0]

Expand All @@ -50,5 +50,5 @@

plt.grid(True)
plt.gca().invert_yaxis()
plt.legend(loc='upper center', bbox_to_anchor=(0.5, 1.1), ncol=2)
plt.legend(loc='upper center', bbox_to_anchor=(0.5, 1.1), ncol=3)
plt.show()

0 comments on commit cb5eaf1

Please sign in to comment.