xfdywy wrote

I try to implement the Navier-Stokes Equation by myself in the custom equation mode. But I find that I can only set Dirichlet or Neumann boundary condition for each boundary. And I must set one of the two types boundary condition for each boundary and each variable which is different from the case when I directly select the Navier-Stokes Equations in the "select physics".

Dirichlet (prescribed value) and Neumann (prescribed gradient/flux) are the two fundamental boundary conditions. The physics modes translate more "physical" boundary conditions to these, for example the "no slip" condition is equivalent to zero Dirichlet conditions for the velocities, and a "pressure/outlet" condition sets a Dirichlet condition for the pressure.

When entering your own custom equations the system cannot know what kind of physics you are trying to model, and therefore you also have to set your boundary conditions of Dirichlet/Neumann type.

xfdywy wrote

So, my question is how can I implement the correct boundary condition when I want to use the custom equation mode?

As you didn't define what you mean by "correct boundary condition" it is hard to give any suggestions, but as stated above there is nothing wrong with prescribing Dirichlet/Neumann conditions.