check_flag = check_flag + 1

# second test: solve log(u)=int(t*exp(-z/d)*cos(t-z/d))dt from 0 to 2pi
#print('\nTest 2:\n')

# only works for T in radians. Why? omg*timed is the same either way, the problem arises in the time stepper.
T = 2. * np.pi  # s, period
omg = 2. * np.pi / T
nu = 1e-6
Re = 400.
dS = np.sqrt(2. * nu / omg)  # Stokes' 2nd problem BL thickness
#print(T,omg,dS)
U = Re * (nu / dS)
Hd = 350. * dS  # m, dimensional domain height (arbitrary choice)
Nz = 100  # number of grid points
z, dz = fn.grid_choice('cosine', Nz, 1.)  # non-dimensional grid
#print('non-dimensional grid min/max: ',np.amin(z*Hd/dS),np.amax(z*Hd/dS))
#print(z[3]*Hd/dS)
#print()
grid_flag = 'cosine'  # 'uniform'
wall_flag = 'moving'
params = {
    'nu': nu,
    'omg': omg,
    'T': T,
    'Td': T,
    'U': U,
    'Hd': Hd,
    'Nz': Nz,
    'Re': Re,
    'dS': dS,
Example #2
0
dS = np.sqrt(2. * nu / omg)  # Stokes' 2nd problem BL thickness

Rej = np.array([600.])
ai = np.array([0.1])
#Rej = np.linspace(1300.,1400.,num=4,endpoint=True)
#ai = np.linspace(0.025,0.5,num=20,endpoint=True)

# grid
grid_flag = 'uniform'  #'hybrid cosine' #'  'cosine' # #
wall_BC_flag = 'BC'
plot_freq = 0
Nz = 100  #
H = 32.  # = Hd/dS, non-dimensional grid height
CFL = 2.  #
Hd = H * dS  # m, dimensional domain height (arbitrary choice)
z, dz = fn.grid_choice(grid_flag, Nz, H)  # non-dimensional grid

# pre-constructed matrices:
grid_params_dzz = {
    'H': H,
    'Hd': Hd,
    'z': z,
    'dz': dz,
    'Nz': Nz,
    'wall_BC_flag': wall_BC_flag
}
grid_params_inv = {
    'H': H,
    'Hd': Hd,
    'z': z,
    'dz': dz,
Example #3
0
Pr = 1.  # Prandtl number
kap = nu / Pr  # m^2/s, thermometric diffusivity
omg = 2.0 * np.pi / Td  # rads/s
f = 0.  #1e-4 # 1/s, inertial frequency
N = 1e-3  # 1/s, buoyancy frequency
C = 1. / 4.  # N^2*sin(tht)/omg, slope ``criticality''
U = 0.01  # m/s, oscillation velocity amplitude
L = U / omg  # m, excursion length (here we've assumed L>>H)
thtc = ma.asin(omg / N)  # radians
tht = C * thtc  # radians
Re = omg * L**2. / nu  # Reynolds number
dS = np.sqrt(2. * nu / omg)  # Stokes' 2nd problem BL thickness
ReS = np.sqrt(2. * Re)  # Stokes' 2nd problem Reynolds number
H = 1.
Hd = 100. * dS  # m, dimensional domain height
z, dz = fn.grid_choice(grid_flag, Nz, H)

Nt = 100  # number of time steps
dt = T / (Nt - 1)  # non-dimensional dt

params = {
    'nu': nu,
    'kap': kap,
    'omg': omg,
    'L': L,
    'T': T,
    'Td': Td,
    'U': U,
    'H': H,
    'Hd': Hd,
    'N': N,