- Author
- Christophe Prud'homme
- Date
- 2013-05-01
Theory
We are interested in solving
in curl-curl formulation in 2D.
First we introduce the following notations:
The curl of a vectorial field
The curl of a scalar field $
Implementation
int main(int argc, char**argv )
{
Environment env( _argc=argc, _argv=argv,
_desc=feel_options(),
_about=about(_name="stokes_curl",
_author="Feel++ Consortium",
_email="feelpp-devel@feelpp.org"));
auto mesh = loadMesh(_mesh=new Mesh<Simplex< 2 > > );
auto Vh = THch<2>( mesh );
auto U = Vh->element();
auto u = U.element<0>();
auto p = U.element<1>();
auto a = form2( _trial=Vh, _test=Vh );
_expr=curlxt(u)*curlx(u) + divt(u)*div(u) );
_expr=-div(u)*idt(p)-divt(u)*id(p));
_expr=( curlxt(u)*cross(id(u),N()) +
curlx(u)*cross(idt(u),N()) +
30*cross(id(u),N())*cross(idt(u),N())/hFace() ) );
_expr=( curlxt(u)*cross(id(u),N()) +
curlx(u)*cross(idt(u),N()) +
30*cross(id(u),N())*cross(idt(u),N())/hFace() ) );
auto l = form1( _test=Vh );
_expr=2*trans(id(u))*N() );
_expr=1*trans(id(u))*N() );
a+=on(_range=
markedfaces(mesh,
"wall"), _rhs=l, _element=u,
_expr=vec(cst(0.),cst(0.)));
a.solve(_rhs=l,_solution=U);
auto e = exporter( _mesh=mesh );
e->add( "u", u );
e->add( "p", p );
e->save();
}