# RiverVortexTest

### From Gerris

Revision as of 01:43, 18 May 2011Gjrickard (Talk | contribs) (→River Tidal Turbine 2D Problem) ← Previous diff |
Revision as of 02:46, 18 May 2011Gjrickard (Talk | contribs) (→River Tidal Turbine 2D Problem) Next diff → |
||

Line 229: |
Line 229: | ||

|+ Comparison of 1D Heat Flux solutions. | |+ Comparison of 1D Heat Flux solutions. | ||

|- | |- | ||

- | | [[Image:Plot_1dhf.png|thumb|500px|center|Gerris]] | + | | [[Image:Default_3500_0.png|thumb|500px|center|Gerris]] |

|} | |} |

## Revision as of 02:46, 18 May 2011

Testing the River version of Gerris. In particular interested in the possibility of tidal turbine like simulations in support of Tim Divett's thesis.

The basic issue is that we note in both the Linear Free Surface and Nonlinear Free Surface versions of Gerris that vortices generated from wakes caused by localised regions of high bottom friction (mimicing the presence of a turbine, say) can sometimes become unstable, i.e., the vortex continues to spin up as it moves downstream leading to (presumably) unphysical magnitudes of flow and fluid height. In the linear free surface version, such vortices persist and can be seen moving with the background flow. In the nonlinear free surface version, these vortices become tighter and more intense, and eventually grind the simulation to a halt via excessive magnitudes of flow and amplitude.

This issue is also relevant to a whole series of linear free surface tidal simulations around headlands and bays around New Zealand. In these simulations an increase in spatial resolution reveals the generation of many eddies that appear to be shed in a physical way via interactions with the coastline. As above, these eddies persist in the background tidal flow. They do not appear to be unstable (ie the runs keep going), but the question remains about the fidelity and actuality of these eddies (and to test this we need more field observations, and perhaps some more thought about the model).

Both models have been tested against the cases present by Signell and Geyer (1991) and both seem to do a good job of reproducing many of the features seen. Thus the underlying schemes seem to be correct, at least for the scales of interest in these tests.

Perhaps it's not surprising that these features arise. After all the models in question here are solving shallow water variants of reality, so that the likely possibility of 3D processes in the water column influencing the vortex behaviour is absent. For the shallow water the only explicit damping is via a bottom friction term, and the only implicit damping is through truncation terms in the advection scheme; these may be missing important physics that allow for a more complete representation of the vortex behaviour.

So, here show some examples of the unstable vortex behaviour in the River code. This can perhaps lead to a better understanding of the limitations of the shallow water models, and how far we should be pushing them to look at the (presumably) complex tidal interactions with coastline and in-situ structures.

## River Tidal Turbine 2D Problem

A typical 2D run set up with constant bathymetry of 50 metres depth, with an increased region of bottom friction defined by TT(x,y) in the centre of the domain. M2U(t) drives the tidal flow at the boundary, anticipating a maximum input speed of 1 m/s.

The change of relevance here is the choice of advection scheme. The default (Minmod) produces a stable simulation, with a smooth wake behind the turbine. Change that to Sweby, and the wake becomes unstable, leading to vortices that then continue to deepen and amplify.

The question is which is "correct"?

Run out to around t=5000, taking about the same number of cpu seconds on 6 processor elements.

# run me using: gerris2D -m

Define RXMID1 (1.0)

Define RYMID1 (0.0)

Define rmag1(rx,ry) ( sqrt((rx-RXMID1)*(rx-RXMID1)+(ry-RYMID1)*(ry-RYMID1)) )

Define RBIT1V(rx,ry) (rmag1(rx,ry) > 0.0 && rmag1(rx,ry) < 0.15 ? 1 : 0.0)

Define RBIT2V(rx,ry) ( (fabs(ry) < 0.4 && rx > -0.4 && rx < 2.4) ? 1 : 0.0)

Define RBIT1S(rx,ry) ( exp(-rmag1(rx,ry)/0.01) )

Define RBIT0V(rx,ry) (rmag1(rx,ry) > 0.0 && rmag1(rx,ry) < 0.35 ? 1 : 0.0)

Define LEVMAX 8

Define LEVMID 8

Define LEVMIN 5

Define LEVBIG 9

Define LEVBIGGER 11

Define R2 (RBIT2V(rx,ry))

Define R3 (RBIT1V(rx,ry))

Define LEVEL1 ( R3 ? LEVMAX : LEVMIN )

Define LEVEL2 ( R2 ? LEVMAX+1 : LEVEL1)

# Turbine parameters, diameter is in y direction, width in x direction,

Define DIAMETER 20.

Define WIDTH 10.

Define Cdbig 12.

#Spacing distance between turbines

Define XSPACING DIAMETER*5.

Define YSPACING DIAMETER*1.5

# M2 tidal frequency. The period is 12h25 (44700 seconds) and M2 tidal elevation.

Define M2F (2.*M_PI/44700.)

Define M2(t) (0.0*cos (M2F*t)+0.01*sin (M2F*t))

# Variable U is velocity*depth here, hence set

# M2U to be velocity (a number) by depth (P)...

#

Define M2U(t) (1.0*(P)*sin (M2F*t))

# Define tau (-0.8e-4)

Define tau (0.0)

Define cd (3.e-3 + TT(x,y)*Cdbig)

Define theta (1.0)

Define onemth (1.0 - theta)

Define abfac (dt*cd*Velocity/P)

Define bffac (tau*dt)

Define onepa (1.+abfac)

Define bth (bffac*theta)

Define bonemt (bffac*onemth)

# Use the "GfsRiver" model

3 2 GfsRiver GfsBox GfsGEdge {} {

Global {

/* Dimensional initial potential temperature profile */

#define TT(x,y) (fabs(x) < WIDTH/2. && fabs(y) < DIAMETER/2. ? 1. : 0.0)

}

# Box size (metres)

PhysicalParams { L = 250.0 g = 9.81 }

# I want the centre of the 2nd box at x = 0 so translate by x = 1000

GfsMapTransform { tx = -250 ty = 0 tz = 0 }

# End the simulation

Time { end = 8640 dtmax = 10 }

# Use terrain module

GModule terrain

Refine LEVEL1

VariableTerrain Zb {

basename = bathy50Wide

path = /data01/marine-physics/rickard/FROMTIM/COSB:/data01/marine-physics/rickard/FROMTIM

} { reconstruct = 1 }

Init {} {

P = MAX (0., -Zb)

}

## remember the initial grid Level...

Init{} {MYMINL = Level

RSEE1V = RBIT1V(rx,ry)

RSEE2V = RBIT2V(rx,ry)

CTT = TT(x,y)

}

#AdvectionParams { cfl = 1.0 }

AdvectionParams { cfl = 0.5

# gradient = gfs_center_sweby_gradient

# gradient = gfs_center_superbee_gradient

# gradient = gfs_center_van_leer_gradient

}

ProjectionParams { tolerance = 1e-6 }

ApproxProjectionParams { tolerance = 1e-6 }

AdaptGradient { start=360 istep = 1 } {

cmax = 0.06

cfactor = 2

maxlevel = LEVEL2

minlevel = MYMINL

} (P < 1e-4 ? 0. : P + Zb)

# Bottom friction parameterisation semi-implict, plus

# plus Coriolis terms added with implicitness parameter theta...

#

Init { start=360 istep = 1 } {

U = ( P > 1e-6 ? (onepa*(U-bonemt*V)-bth*(V+bonemt*U))/(onepa*onepa + bth*bth) : 0.)

V = ( P > 1e-6 ? (onepa*(V+bonemt*U)+bth*(U-bonemt*V))/(onepa*onepa + bth*bth) : 0.)

}

# Try to construct a Vorticity by dividing fluxes by local

# depth and applying gradient operators...here in 2D of course...

#

Init { istep = 1 } {

RU = ( P < 1e-4 ? 0.0 : (U/P))

RV = ( P < 1e-4 ? 0.0 : (V/P))

VORT = (P < 1e-4 ? 0. : (dx("RV") - dy("RU")))

}

# Vorticity criterion

# Takes 1 m/s as normalising maximum velocity

AdaptFunction { start = 360 istep = 1 } {

cmax = 5e-2

cfactor= 2

maxlevel = LEVEL2

minlevel = MYMINL

} (fabs(VORT*dL/1.0))

EventBalance { istep = 10 } 0.1

OutputTime { istep = 100 } stdout

OutputSimulation { step = 100 } boi_wiki_3-%g.gfs

OutputSimulation { start = end } boi_wiki_3_end.gfs

}GfsBox {

left = Boundary {

BcDirichlet U M2U(t)

BcNeumann P 0

}

top = Boundary

bottom = Boundary

}

GfsBox { top = Boundary

bottom = Boundary

}

GfsBox {

right = Boundary {

BcDirichlet U M2U(t)

BcNeumann P 0

}

top = Boundary

bottom = Boundary

}

1 2 right

2 3 right

Top frame compares space-time solution from Gerris2D (the red dashes) and from the analytic Laplace transform solution.

Green crosses indicate x-positions of sampled output.

Lower frame plots changes in concentration as a function of time at the indicated x-positions. The dashed lines are from Gerris2D on top of the Laplace Transform solutions.