(Deleted) Help with SUPG.


123
views
-5
8 months ago by


Dear all,
I have a problem with the follow implementation. Any help is appreciated. 

    V = VectorElement("CG", mesh.ufl_cell(), 2)       # Velocity vector field
    P = FiniteElement("CG", mesh.ufl_cell(), 1)       # Pressure field
    L = FiniteElement("CG", mesh.ufl_cell(), 2)       # Levelset field
    N = VectorFunctionSpace(mesh, "CG", 1, dim=2)     # Normal vector field 
    VP = MixedElement([V,P])
    Omega = FunctionSpace(mesh,VP)

    # Space definition for Level Set
    SL = FunctionSpace(mesh,L)
    l_ = TestFunction(SL)   
    (u,p) = split(w)
    
    # Level set FEM disctetization   
    unorm = sqrt(dot(u,u))
    h = CellSize(mesh)
    delta = h/(2.0*unorm)
    s = delta*(dot(u,grad(l_)))
    
    r = ((l-l0)/k)*l_ + 0.5*dot(grad(l-l0),u)
    
    F = inner((l-l0)/k,l_)*dx - 0.5*inner((l-l0)*u,grad(l_))*dx + s*inner((l-l0)/k,l_)*dx + (s*r)*dx
    
    J = derivative(F,l)
    bc = []
    problem=NonlinearVariationalProblem(F,l,bc,J)
    solver=NonlinearVariationalSolver(problem)
    prm = solver.parameters
    prm['nonlinear_solver'] = 'newton'
    prm['newton_solver']['absolute_tolerance'] = 1E-10
    prm['newton_solver']['relative_tolerance'] = 1E-10
    prm['newton_solver']['maximum_iterations'] = 20
    prm['newton_solver']['linear_solver'] = 'mumps'
    solver.solve()
Community: FEniCS Project
1
There is a very good introduction on FEniCS tutorial and FEniCS book that may help you. <https://fenicsproject.org/documentation/>
written 8 months ago by Nelson Tamashiro  
Please login to add an answer/comment or follow this question.
The thread is closed. No new answer/comment may be added.

Similar posts:
Search »
  • Nothing matches yet.