1
$\begingroup$

Using this code I get an error like boundary condition in consistency. how to solve this issue and solve this nonlinear system. I am not sure about the B.C. AND I.C., in question it's given as u=v=0 at y=0 and u= constant if y= inf. How to construct boundary conditions when the question has only that conditions?

Clear[u, v, ν, pde1, pde2]
pde1 = D[u[x, y], x] + D[v[x, y], y] == 0;
pde2 = u[x, y]*D[u[x, y], x] + v[x, y]*D[u[x, y], y] == ν*D[u[x, y], {y, 2}];
ic = {u[x, 0] == 0, v[x, 0] == 0};
bc = {u[0, y] == 1, v[0, y] == 0};
ν = 1;
sol = NDSolve[{pde1, pde2, ic, bc}, {u, v}, {x, 0, 1}, {y, 0, 1}]
$\endgroup$
7
  • 4
    $\begingroup$ 1. NDsolve should be NDSolve. 2. v[x, 1000] = 0 should be v[x, 1000] == 0, remember to Clear[v] to remove the pollution. 3. You're setting option for NDSolve blindly, MethodOfLines is for time-dependent PDE. 4. When FEM is used, b.c. involving derivative cannot be used, see this post for more info: mathematica.stackexchange.com/q/224812/1871 $\endgroup$
    – xzczd
    Oct 29, 2022 at 4:15
  • $\begingroup$ 5. Your simplification for Navier-stokes equation looks unusual, is it from certain literature? If so, can you add the reference? $\endgroup$
    – xzczd
    Oct 29, 2022 at 5:07
  • 1
    $\begingroup$ No, because I don't think that'll help you learning Mathematica efficiently. (Nasser has provided quite a bit of code sample under your first question but your code are still full of simple mistakes, aren't you? ) Please settle down and first learn the basics of Mathematica. Coding blindly won't save your day. If you insist, at least first correct those simple mistakes mentioned in my previous comments and update your question, and answer the question in my last comment. $\endgroup$
    – xzczd
    Oct 29, 2022 at 6:13
  • $\begingroup$ I just corrected all mistakes. The code was running but some errors will be shown. (I'm new here so within the minimum time I wish to learn lots of things, so in the hurrying race I made some mistakes so sorry for that sir) Please help me like your student. $\endgroup$
    – FDMEM
    Oct 29, 2022 at 10:45
  • 3
    $\begingroup$ As asked above, your system looks unusual, it's a variant of 2D static Navier-stokes equation for incompressible flow (by removing the pressure term and modifying the viscosity term). Are you sure it's correct? (Creating PDE casually can easily lead to unsolvable problem. ) Is it from certain literature? If so, can you add the reference? $\endgroup$
    – xzczd
    Oct 29, 2022 at 11:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.