MATLAB: How to create internal boundary conditions using “IF” function to solve PDEs

2dcomputational fluid dynamicsfemlid driven cavityMATLAB

Hi guys, I am very new to Matlab and have a quick question for anybody willing to try and answer it. I am looking to create a 2 dimensional domain which is has an area lx*ly, lx = 4.6 and ly=3.3.I am discretizing using a staggered grid with U being the flow on the X plane and V being the flow on the Y plane. I want to apply a boundary conditon over the area inclosed by lx=0.45:1.47 and ly=0:2 to say there is no flow. I am essentially trying to cut out the area from the domain using the "IF" function. Is this possible to do and if so how would I go about doing it. I can set up the question with the IF function but the results do not change when I set Ue=0 and Ve=0.

Best Answer

If I understand you correctly, then I think that you have to change the geometry of your problem to have a hole.
It doesn't sound as if you are using PDE Toolbox, but if you are, then I do not understand your comment about using a staggered grid. So perhaps I do not understand you at all. But if you are using PDE Toolbox, then it is easy to change the geometry to exclude a rectangular hole; see the instructions for command-line work, or the PDE app approach.
Alan Weiss
MATLAB mathematical toolbox documentation
Related Question