← Back to team overview

fenics team mailing list archive

Re: Noslip in x-direction of the hyperelastic cbc.twist case

 

I don't think this is possible with the existing interface of
CBC.Twist which assumes you want to set a Dirichlet boundary condition
for all components of the displacement. But it should be possible to
add a Dirichlet condition only for the x-displacement by modifying the
solver itself. It's fairly well documented so it should be possible to
figure out where it happens.

Use the V.sub(i) functionality for setting boundary conditions only
for a component of the full space (see demos for examples).

--
Anders


On Thu, Feb 14, 2013 at 06:23:03PM +0100, Roland Siegbert wrote:
> Dear Fenics-Userlist,
> I want to release the twisted cube from cbc.twist such that at
> x[0]==1.0 only movement in y,z-direction is possible.
> Does anyone have an idea? I don't see, how I should formulate the
> boundary condition using Expression() to fix only one value of the
> displacement-vector. The code below produces a pretty weird result...
> Best,
> Roland
> from cbc.twist import *
> class Release(Hyperelasticity):
>    def mesh(self):
>        n = 8
>        return UnitCube(n, n, n)
>    def end_time(self):
>        return 2.0
>    def time_step(self):
>        return 2.e-2
>    def is_dynamic(self):
>        return True
>    def time_stepping(self):
>        return "CG1"
>    def reference_density(self):
>        return 1.0
>    def initial_conditions(self):
>        """Return initial conditions for displacement field, u0, and
>        velocity field, v0"""
>        u0 = "twisty.txt"
>        v0 = Expression(("0.0", "0.0", "0.0"))
>        return u0, v0
>    def dirichlet_values(self):
>        clamp = Expression(("0.0", "0.0", "0.0"))
>        twist = Expression(("0.0", "x[1]", "x[2]"))
>        return [clamp, twist]
>        #return [clamp]
>    def dirichlet_boundaries(self):
>        return ["x[0] == 0.0", "x[0] == 1.0"]
>        #return ["x[0] == 0.0"]
>    def material_model(self):
>        mu    = 3.8461
>        lmbda = 5.76
>        material = StVenantKirchhoff([mu, lmbda])
>        return material
>    def __str__(self):
>        return "A prestrained hyperelastic cube being let go"
> # Setup and solve problem
> problem = Release()
> print problem
> problem.parameters["solver_parameters"]["save_solution"] = True
> problem.solve()
> interactive()
> _______________________________________________
> Mailing list: https://launchpad.net/~fenics
> Post to     : fenics@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~fenics
> More help   : https://help.launchpad.net/ListHelp


Follow ups

References