Solving stokes flow use pde toolbox

25 次查看(过去 30 天)
I would like the solve a stokes flow equation using the matlab PDE-toolbox.
and
Using an inital guess for the pressure field, the first equation can be solved using the toolbox. This will then give a solution for u that in general does not fullfill the second equation.
I would like to implement a pressure correction to update the pressure field using the second equation and then solve again until the second equation is fullfilled as well. Can someone help me out on this?
Many thanks!!

回答(1 个)

Torsten
Torsten 2023-7-13
编辑:Torsten 2023-7-13
The (simplified) Navier-Stokes equations need a special numerical treatment and cannot be solved by a general-purpose code like the PDE toolbox.
COMSOL with the fluid dynamics package and ANSYS are the commercial code options, OPENFOAM is a non-commercial alternative.
  2 个评论
Dominique Gorissen
Dominique Gorissen 2023-7-17
编辑:Dominique Gorissen 2023-7-17
Hi Toristen,
I understand you answer, however I do think there is a way to implement it. I should have explained my question more clearly. My idea for implementing is as follows:
  1. make a Pressure array of size 1xNnodes. containing a guess for the pressure in each of the nodes. (this does not have to be the correct pressure just a first guess)
  2. make a function that as input takes: (Pressure array, location.x, location.y, Mesh.nodes) and returns. This function will become the "f" coefficient
  3. apply boundary conditions and parameters a=m=d=0 and c=viscosity
  4. Solve
  5. in each node compute using the "evaluateGradients" function. This should be zero, but since the first guess for the Pressure array is probably incorrect it will not be zero in all nodes. If <0 it means mass is flowing into the node and thus the pressure should be higher there compared to neigbouring nodes. If >0 it means mass is flowing out of the node and thus pressure is to high.
  6. based on results of 4 update the values of the Pressure array and repeat until convergence.
The part that I struggle with is how to implement step 5. I need an algorithm that updates the pressure based on the current values of Pressure and
Torsten
Torsten 2023-7-17
编辑:Torsten 2023-7-17
Did you read about the many existing pressure-velocity coupling schemes in the literature?
E.g. Chapter 7 of
My advice: Use an existing CFD code for your problem.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Computational Fluid Dynamics (CFD) 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by