Hello,

I am currently doing a 1 dimensional linear stabiity solver (for fluid mechanics). To do so I solve an eigenvalue problem as AX = lambda BX where A and B are terms from the linearized Navier-Stokes equations and of the mean flow and X is the small perturbation that is unknown (u, v, w, p).

In these matrices A and B must be added boundary conditions, for some case only Neumann or Dirichlet boundary conditions need to be imposed (case m = 0 and m>1 in page 3). For these two cases, Freefem works perfectly well.However, for the case m=±1, the first perturbation u depends on the second perturbation v as 2u’(0)+mv’(0)=0.

Would there be a way to impose such kind of boundary condition if Freefem ? I have put the case that work for m = 0. In the code F stands for u, G for v, H for w and Pr for p.

real ymin = 0.;

real ymax = 1.;

border yline(t=ymin,ymax){x=0.;y=t;}

int np = 1000;

meshL Th=buildmeshL(yline(np));

fespace Xh(Th, P2);

fespace Mh(Th, P1);

Xh W=1-y^2, V=0, U=0, Re=100.0, Visco=1/Re, PrMean = 0.;

Xh alpha=10.0, m=0.0;

fespace Vh(Th, [P2, P2, P2, P1]);

Vh [F, G, H, Pr], [X1, X2, X3, X4];

varf opLHS([F, G, H, Pr], [X1, X2, X3, X4]) =

int1d(Th)( -(1i*y^2/Re) dy(F)dy(X1)-((1i/Re)((m^2+1)+y^2alpha^2))FX1+y^2*alpha

*W*F

*X1-(1i)*(y/Re)

*F*dy(X1)-(2

*1i*m/Re)

*G*X1+y^2

*Pr*dy(X1)

+(1i)

*(-(y^2/Re)*alpha

*dy(G)*alpha^2)*dy(X2))-((1i)/Re)*((m^2+1)+y^2*G*X2+y^2*W*G

*X2-(1i)*(y/Re)

*G*dy(X2)-(2

*m*(1i)/Re)

*F*X2+m

*y*Pr

*X2*

-(1i)(y^2/Re)

-(1i)

*dy(H)*alpha

*dy(X3)-(1i)*(y/Re)*H*dy(X3)+y^2*W*H

*X3-(1i/Re)*(m^2+alpha^2

*y^2)*dy(W)

*H*X3+y^2*F*X3+1i

*y^2*alpha

*Pr*X3

-X4*(F+m

*G+alpha*y

*H)+y*F*dy(X4)

)

+on(1, F=0, G=0)

+on(2, F=0, G=0, H=0);

// get the RHS function

varf opRHS([F, G, H, Pr], [X1, X2, X3, X4]) = int1d(Th)(y^2*F*X1 + y^2*G*X2 + y^2*H*X3)

+on(1, F=0, G=0)

+on(2, F=0, G=0, H=0);