# Boundary Conditions for The Navier-Stokes Equations

5 messages
Open this post in threaded view
|

## Boundary Conditions for The Navier-Stokes Equations

 Hi, I try to solve 3D Navier-Stokes Equations. I set the model using the FEATool and export it as m-files on MATLAB. I want to change the symmetry/slip boundary conditions on m-files. I tried to change the symmetry/slip boundary condition, but the solutions did not change. How can change the boundary conditions on m-files? Thanks.
Open this post in threaded view
|

## Re: Boundary Conditions for The Navier-Stokes Equations

 Administrator b> Ozgulilhan wrote How can change the boundary conditions on m-files? In general I would first suggest to change it in the GUI, and save as m-file. Then you can compare and see the syntax (what has changed). However, in this case you need to specifically change fea.phys.ns.bdr.selfea.phys.ns.bdr.sel = [ 1, 1, 5, 1 ]; so that fea.phys.ns.bdr.sel(index_to_boundary) = boundary_condition_type here boundaries 1, 2, and 4 are of boundary type 1 (no-slip), and bound 3 is slip (type 5). The boundary type is as given here https://www.featool.com/doc/physics#phys_ns__bc and in the dropdown box in the GUI.
Open this post in threaded view
|

## Re: Boundary Conditions for The Navier-Stokes Equations

 Thank you for your fast reply. I don't want to use no-slip, Symmetry/Slip, outflow, neutral outflow and inlet boundary conditions. How can I describe a new boundary condition in the GUI? I tried to describe a new boundary condition in the m-files. Firstly, I set  fea.phys.ns.bdr.sel  as follows, fea.phys.ns.bdr.sel = [ 1, 5, 1, 1, 2, 1, 4, 1, 1, 1 ]; and then for the second boundary I used symmetry/slip boundary condition, so that I get now for second boundary, 'bs_ns', 'n&.u = 0, -n.(-pI + mu(grad u+grad uT)).t = 0', 'Symmetry/slip', [], { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;                          0, 0, 0, 0, 0, 0, 0, 0, 0, 0;                          0, 0, 0, 0, 0, 0, 0, 0, 0, 0;                          0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, [], { 'solve_hook_bdrslip', 'solve_hook_bdrslip', 'solve_hook_bdrslip', 'solve_hook_bdrslip', 'solve_hook_bdrslip', 'solve_hook_bdrslip', 'solve_hook_bdrslip', 'solve_hook_bdrslip', 'solve_hook_bdrslip', 'solve_hook_bdrslip';                          0, 0, 0, 0, 0, 0, 0, 0, 0, 0;                          0, 0, 0, 0, 0, 0, 0, 0, 0, 0;                          0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } };   The boundary condition I want to describe is similar to the symmetry boundary condition. When I changed the " -n.(-pI + mu(grad u+grad uT)).t = 0", the solutions did not change. What can I do? Thanks..
 Administrator Ozgulilhan wrote Thank you for your fast reply. I don't want to use no-slip, Symmetry/Slip, outflow, neutral outflow and inlet boundary conditions. How can I describe a new boundary condition in the GUI? Unfortunately, there currently is no functionality to re-define or change boundary conditions in the GUI. Ozgulilhan wrote I tried to describe a new boundary condition in the m-files. Firstly, I set  fea.phys.ns.bdr.sel  as follows ... It is also not possible to re-define boundary conditions using the physics modes (you can only use the defined ones). The physics modes (here the Navier-Stokes physics mode defined in "fea.phys.ns") are used by the "parsephys" function to calculate the global (monolithic) weak equation and boundary contributions, that is the "fea.eqn" and "fea.bdr" are determined from the physics modes with the parsephys call. fea.phys.ns = ... % select eqations coefficents and boundary conditions fea = parsephys(fea); % > defines fea.eqn.(...) / fea.bdr.(...) from fea.phys.(...) % assemble and solve using definitions in fea.eqn./fea.bdr So if you want to define custom boundary conditions (or equations) you would change/modify the fea.bdr (or fea.eqn). For boundary conditions fea.bdr.d prescribes dirichlet coefficients and fea.bdr.n the Neumann/flux condition (if a Dirichlet condition is not prescribed). See the following page for definition of the boundary struct https://www.featool.com/doc/feastruct#bdr_struct