Discussion:
[ff3d-users] how define boundary condition ?
oka
2009-04-28 00:30:30 UTC
Permalink
Hi,

I am wondering how to define boundary condition on
arbitrary area of target volume.
Attached is simple case of sphere.
Sphere mesh file is given as "sphere.msh".
Boundary condition are's mesh file is
"meshpart.msh" or "meshpart.pov".

mesh M = read(gmsh,"sphere.msh")
mesh M1 = read(gmsh,"meshpart.msh");

solve (u) in M
{
test(w) =
-------
u = 1 onn M1;
}

is wrong.

I also get ready of pov-ray file, meshpart.pov.
How define such boundary conditions ?

Bounday condition is applied on surface and volume
areas.

Best regards,

Oka
DELPINO Stephane
2009-04-28 08:53:29 UTC
Permalink
Dear Oka.

You can impose your Dirichlet condition using penalty:


double P=1E3; // example of penalty coefficient
function g = sin(x); // example of Dirichlet RHS

solve (u) in M
{
test(v)
int(grad(u)*grad(v)
+int(P*u*v*one(M1)) // penalty in mesh M1
=
int(P*g*v*one(M1)); // penalty in mesh M2
}

This might be costly since 'one(M1)' need to check if any quadrature
vertex of M is inside M1. Localizing in a 3D mesh can be expensive ...
You may prefer to use POV description
Then you replace 'one(M1)' by 'one(<1,0,0>)' if your object in the POV
file has color <1,0,0>
You can also define an analytic function:
function sphere=one((x-x0)^2+(y-y0)^2+(z-z0)^2<r0^2);

Best regards,
Stephane.

Loading...