Discussion:
[ff3d-users] Problem with setting Boundary condition
Juzar Thingna
2010-04-16 03:43:20 UTC
Permalink
Hello Everyone,
Here is my input file:

vector n=(70,90,70);
vector a=(0,7,0);
vector b=(20,37,20);
scene S=pov("ferromagnet.pov");
mesh M=structured(n,a,b);
domain O =domain(S,inside(<1,0,0>));
function L=36;
function wb=0.37824;
solve(w) in O by M
krylov(type=bicg)
{
pde(w)
div(L*grad(w))-w=0;
dnu(w)= wb on M ymin;
w=0 on M ymax;
}
mesh Z = tetrahedrize (O,M);
save(medit,"w_fm",w,Z);
save(medit,"w_fm",Z);
save(raw,"w_fm.dat",w,M);

I want to set the derivative of w along the y-direction to be equal to wb at
ymin. I thought that setting dnu(w)=wb would do the trick, but apparently I
don't get the value of the slope at ymin = wb.
Please could someone guide me as in where I'm going wrong?

The foll is my geometry file:

box {<0,7,0>,<20,37,20> pigment{color rgb <1,0,0>}}

Regards,
Juzar Thingna
Center for Computation Science and Engineering
National University of Singapore
Juzar Thingna
2010-04-17 11:02:42 UTC
Permalink
Hi Thomas,
Thanks for your prompt reply. Yes M ymin is on O for the simple geometry I'm
using O and M are just the same.

I'm trying the same with freemfem++ in order to check if there is any
discrepancy in the result.

Cheers,
Juzar Thingna
Center for Computation Science and Engineering
National University of Singapore


On Sat, Apr 17, 2010 at 5:46 PM, Thomas Ward
could it be because you are solving in O but the BC is defined on M?
are you sure M ymin is on O
I am not very familiar with ff3d so don't place too much faith on my
suggestion.
good luck
Tom.
p.s. you may also try
getdp
freefem++ (from same group as ff3d)
fenics (python and c++, steeper learning curve)
they all have a similar philosophy to ff3d but development is more active
Post by Juzar Thingna
Hello Everyone,
vector n=(70,90,70);
vector a=(0,7,0);
vector b=(20,37,20);
scene S=pov("ferromagnet.pov");
mesh M=structured(n,a,b);
domain O =domain(S,inside(<1,0,0>));
function L=36;
function wb=0.37824;
solve(w) in O by M
krylov(type=bicg)
{
pde(w)
div(L*grad(w))-w=0;
dnu(w)= wb on M ymin;
w=0 on M ymax;
}
mesh Z = tetrahedrize (O,M);
save(medit,"w_fm",w,Z);
save(medit,"w_fm",Z);
save(raw,"w_fm.dat",w,M);
I want to set the derivative of w along the y-direction to be equal to wb
at
Post by Juzar Thingna
ymin. I thought that setting dnu(w)=wb would do the trick, but apparently
I
Post by Juzar Thingna
don't get the value of the slope at ymin = wb.
Please could someone guide me as in where I'm going wrong?
box {<0,7,0>,<20,37,20> pigment{color rgb <1,0,0>}}
Regards,
Juzar Thingna
Center for Computation Science and Engineering
National University of Singapore
Stephane Del Pino
2010-04-17 15:55:37 UTC
Permalink
Post by Juzar Thingna
I want to set the derivative of w along the y-direction to be equal to wb
at ymin. I thought that setting dnu(w)=wb would do the trick, but
apparently I don't get the value of the slope at ymin = wb.
Please could someone guide me as in where I'm going wrong?
box {<0,7,0>,<20,37,20> pigment{color rgb <1,0,0>}}
Regards,
Juzar Thingna
Center for Computation Science and Engineering
National University of Singapore
Hello.

dnu(u) is not the normal derivative of "u" but the co-normal derivative as
described in remark 14 of the user documentation (p50).
Your pde is
div(L*grad(w))-w=0
so the co-normal derivative is :
dnu(w) = -L*dn(u)
where I noted here dn(u) to be the normal derivative. So, to get
dn(w)=wb
you need to specify
dnu(w) = -wb/L

This is quite tricky ... To really understand how to set dnu(w) you need to
understand variational formulas ...

Best regards,
Stéphane.

Loading...