Hello again,

Minor update on my wind-driven gyre problem.

I just put together a SW version of the code that solve the Linear Stommel problem.  You can find the code in the same github repo,

https://github.com/francispoulin/firedrakeQG/blob/master/linear_stommel_sw.py

To my surprise the solver does not complain, and it is exactly the same thing as in the QG version so maybe that part of it is ok.  Unfortunately, the solution seems to be zero.  So this code is at least giving me an answer, but a wrong one. 

Cheers, Francis


------------------
Francis Poulin                    
Associate Professor
Department of Applied Mathematics
University of Waterloo

email:           fpoulin@uwaterloo.ca
Web:            https://uwaterloo.ca/poulin-research-group/
Telephone:  +1 519 888 4567 x32637


From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Francis Poulin [fpoulin@uwaterloo.ca]
Sent: Saturday, November 26, 2016 7:36 AM
To: firedrake@imperial.ac.uk
Subject: Re: [firedrake] no normal flow Boundary Conditions

Hello,

Thank you Colin and everyone else for your responses.  That was very helpful. 

We are working on a bunch of problems right now, both QG and SW.   We have many different codes working in FEniCS but I am going to start translating them into Firedrake.  Maybe make a demo if people seem interested?

The first code is to solve the Linear Stommel problem in one-layer QG. I was able to translate most of it ok but I seem to be having problems with the solver for some reason.
If anyone had any advice on what I am doing wrong that would be greatly appreciated. You can find a link on github

 https://github.com/francispoulin/firedrakeQG/blob/master/linear_stommel_qg.py

After I get this working I will like to solve a variety of other problems.  One is the Munk problem, then look at non-linear gyre solutions, then find these solutions in SW. 

Cheers, Francis



------------------
Francis Poulin                    
Associate Professor
Department of Applied Mathematics
University of Waterloo

email:           fpoulin@uwaterloo.ca
Web:            https://uwaterloo.ca/poulin-research-group/
Telephone:  +1 519 888 4567 x32637


From: firedrake-bounces@imperial.ac.uk [firedrake-bounces@imperial.ac.uk] on behalf of Colin Cotter [colin.cotter@imperial.ac.uk]
Sent: Friday, November 25, 2016 4:15 AM
To: firedrake
Subject: Re: [firedrake] no normal flow Boundary Conditions

Hi Francis,
  That depends on the formulation of the equations. If you are using a streamfunction-vorticity formulation as for QG, then you need to set a zero boundary condition for the streamfunction, as a scalar. If you are using a velocity formulation based on H(div) spaces  (BDM, RT etc.) then there are only u.n DOFs on the boundary, so setting:
bcs = [DirichletBC(Z.sub(0), Constant((0, 0)), (blah,)), ...
actually only sets the normal component. That's one of the reasons that I like these spaces for GFD.

cheers
--cjc

On 25 November 2016 at 01:17, Francis Poulin <fpoulin@uwaterloo.ca> wrote:
Hello,

Sorry for the bother but I have a simple question to ask. 

I am currently developing some code to solve for wind-driven gyres and basin modes using QG and SW.  My question is how is it best to impose no-normal flow BCs,

$$\vec u \cdot \hat n = 0$$

for any boundary.  I found this in the Navier-Stokes example which says that we should impose zero on particular boundaries.  I guess that would work but if one had a more complicated geometry I imagine that would have it's problems.
bcs = [DirichletBC(Z.sub(0), Constant((1, 0)), (4,)),
       DirichletBC(Z.sub(0), Constant((0, 0)), (1, 2, 3))]

Any suggestions would be greatly appreciated.

Cheers,
Francis
------------------
Francis Poulin                    
Associate Professor
Department of Applied Mathematics
University of Waterloo

email:           fpoulin@uwaterloo.ca
Web:            https://uwaterloo.ca/poulin-research-group/
Telephone:  +1 519 888 4567 x32637




--