Fem-fenics: Difference between revisions

Jump to navigation Jump to search
9 bytes added ,  5 October 2013
Line 719: Line 719:
#  eq = (1/k)*inner(u - u0, v)*dx + inner(grad(u0)*u0, v)*dx \
#  eq = (1/k)*inner(u - u0, v)*dx + inner(grad(u0)*u0, v)*dx \
#      + nu*inner(grad(u), grad(v))*dx - inner(f, v)*dx
#      + nu*inner(grad(u), grad(v))*dx - inner(f, v)*dx
a1 = BilinearForm ('TentativeVelocity', V, k);
a1 = BilinearForm ('TentativeVelocity', V, V, k);




Line 725: Line 725:
#  a = inner(grad(p), grad(q))*dx
#  a = inner(grad(p), grad(q))*dx
#  L = -(1/k)*div(u1)*q*dx
#  L = -(1/k)*div(u1)*q*dx
a2 = BilinearForm ('PressureUpdate', Q);
a2 = BilinearForm ('PressureUpdate', Q, Q);


# Velocity update
# Velocity update
#  a = inner(u, v)*dx
#  a = inner(u, v)*dx
#  L = inner(u1, v)*dx - k*inner(grad(p1), v)*dx
#  L = inner(u1, v)*dx - k*inner(grad(p1), v)*dx
a3 = BilinearForm ('VelocityUpdate', V);
a3 = BilinearForm ('VelocityUpdate', V, V);


# Assemble matrices
# Assemble matrices
60

edits

Navigation menu