# [aspect-devel] Is it possible to prescribe a function F(R_0, theta) and F (R_1, theta) as the boundary conditions on the two boundaries r = R_0 and r= R_1 of an annular domain?

Timo Heister heister at clemson.edu
Wed Nov 9 08:15:34 PST 2016

```Gerry,

of course this is possible. You can use atan2(y,x) which returns an
angle between -pi and pi and sqrt(x^2+y^2) to compute the radius. The
choice between inner and outer can be done using
if(sqrt(x^2+y^2)<(r0+r1)/2,r0,r1) or something similar.

At some point it might be easier to write a plugin and do this logic
inside a simple c++ function, though. You do this by defining and
registering a new boundary class. See
tests/prescribed_velocity_boundary.cc for an example.

On Wed, Nov 9, 2016 at 10:44 AM, Elbridge Gerry Puckett
<egpuckett at ucdavis.edu> wrote:
> Hi,
>
> We want to compute the solution of Stokes in the annular domain
>
> R_0 <= r <= R_1    and   0 <= theta <= 2 pi
>
> We would like to prescribe
>
> (u, v) = F(R_0, theta)  = ( f(R_0, theta),  g(R_0, theta) )   at r = R_0
>
> and
>
> (u, v) = F(R_1, theta) =  ( f(R_1, theta),  g(R_1, theta) )   at r = R_1
>
> Is this possible? Currently we know how to prescribe
>
> (u, v) = (-y,x) at both r = R_0 and r = R_1
>
> This is what we're currently doing ...
>
> ############### Parameters describing the model
>
> subsection Geometry model
>   set Model name = spherical shell
>
>   subsection Spherical shell
>     set Inner radius = .4
>     set Outer radius = 1
>     set Opening angle = 360
>
>    end
> end
>
> subsection Model settings
>
>
>   # Set to tangential velocity boundary conditions.
>   # Note that the function specified in "Boundary velocity model" has no
> influence unless the following line is uncommented
>   # and the parameter  "Tangential velocity boundary indicators" is reset.
>
>   set Prescribed velocity boundary indicators = 0: function, 1: function
>
>   #  set Prescribed velocity boundary indicators =
>
>   set Tangential velocity boundary indicators =
>   set Zero velocity boundary indicators       =
>
> end
>
>
> subsection Boundary velocity model
>   subsection Function
>     set Function constants   = pi=3.1415926
>     set Variable names        = x,y
>     set Function expression = -y;x
>   end
> end
>
> subsection Material model
>
>   set Model name = ...
>
>   subsection EGPHVL
>
>     # Do not change these set of parameters! EGP && HL
>
>       set Viscosity jump       = 1
>       set Reference density = 1
>    end
>
> end
>
> Thanks!
>
> - G
>
>
> _______________________________________________
> Aspect-devel mailing list
> Aspect-devel at geodynamics.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.geodynamics.org_cgi-2Dbin_mailman_listinfo_aspect-2Ddevel&d=CwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=R5lvg9JC99XvuTgScgbY_QFS80R7PEA2q0EPwDy7VQw&m=UxEweuniOSYML-OMWv5_ph03TZc_eyvDW4Y1WjnvWyI&s=Isbfz0YFq0MzOx27fWo_ZkXrIsjQXdpeTVlBJqLO_NU&e=

--
Timo Heister
http://www.math.clemson.edu/~heister/
```