← Back to team overview

fenics team mailing list archive

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

 

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()


Follow ups