Could you help me to solve this problem below?
Now I am trying pressure-driven flow for 2-dimentional room, as can be seen in here: Other boundary is set as wall coniditon, and symmetry condition is used for z-direction boundary as following:
Becasue pressure inlet condition cannot be set by GUI, I used user-subroutine as following:
Code: Select all
call getfbr('inlet_extruded', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
itypfb(ifac) = ientre
!Dirichlet B.C for pressure:
icodcl(ifac,ipr) = 1
rcodcl(ifac,ipr,1) = 101325.633
!Dirichlet B.C for pressure:
icodcl(ifac,iu)= 3
icodcl(ifac,iv)= 3
icodcl(ifac,iw)= 3
enddo
call getfbr('outlet_extruded', nlelt, lstelt)
do ilelt = 1, nlelt
ifac = lstelt(ilelt)
itypfb(ifac) = ientre
!Dirichlet B.C for pressure:
icodcl(ifac,ipr) = 1
rcodcl(ifac,ipr,1) = 101325.0
!Dirichlet B.C for pressure:
icodcl(ifac,iu)= 3
icodcl(ifac,iv)= 3
icodcl(ifac,iw)= 3
enddo
However, this simulation became divergent eventually like this: Even this picture, Dirichlet pressure values, which is set by subroutine, are imposed correctly.
Followings are other computional setting.
-As a turbulence model, I used k-omega SST.
-Time step and mesh size are enough for stable computation.
-k and omega are set by GUI.
Could anyone give me tips for this divergent problem?
Is my subroutine code correct? (In the subroutine code, I want to impose Dirichlet condition for pressure and Neumann condition for velocity at both inlet and outlet.)
As far as I understand, if I impose pressure inlet for imcompressible flow, a velocity at inlet can be calculated by Bernoulli's principle. For example, a velocity at inlet can be calculated by both using P at inlet and P0 at outlet by Bernoulli's equation. Then, this velocity is imposed at inlet as "like velociry inlet".
Therefore, I think, even though pressure inlet condition is used, this condition is actually same to imposing velocity inlet.
This theory is clearly explained by this:https://www.youtube.com/watch?v=Er2j5Kq17as
I tried many many times by changing some condtions e.g. delta time step, mesh size and other boundary condition.
If I put velocity inlet condition, simulation can be done well.
In addition, for simple 2-dimentional channel flow without turbulence model, I succeeded pressure driven flow by above subroutine code, in which divergence did not occur.
Could someone help me or sugget tips and check wether my subroutine is correct or not?
Sincerely,
Tsubasa