MFC icon indicating copy to clipboard operation
MFC copied to clipboard

Add velocity boundary condition for all coordinate directions

Open sbryngelson opened this issue 2 years ago • 10 comments

Like the inlet velocity boundary condition of @haochey and/or @anshgupta1234 , we should make it possible to set the boundary condition to have a velocity that isn't just into the domain, but also transverse to it. So setting the velocity to be a constant upwards, or u_y = constant for a boundary condition on the left or right boundary. This is related to issue #185 .

sbryngelson avatar Jul 17 '23 19:07 sbryngelson

I'm going to add this to my PR #189. It'll make testing the walls I added easier.

wilfonba avatar Jul 18 '23 21:07 wilfonba

Also, I'm not sure the this energy assignment makes sense. https://github.com/anshgupta1234/MFC/blob/767edf23607659008df76604e5d86a1b026d78bc/src/simulation/m_rhs.fpp#L1967-L1988 As velocity flows into the domain, the energy in the buffer region continues to increase every time the boundary condition is applied since the kinetic energy in the interior cell is most likely increasing at each time step. Would it make more sense to compute the internal energy using the EOS and the state in the buffer region and then add the kinetic energy due to the velocity source?

wilfonba avatar Jul 18 '23 21:07 wilfonba

Also, I'm not sure the this energy assignment makes sense. https://github.com/anshgupta1234/MFC/blob/767edf23607659008df76604e5d86a1b026d78bc/src/simulation/m_rhs.fpp#L1967-L1988 As velocity flows into the domain, the energy in the buffer region continues to increase every time the boundary condition is applied since the kinetic energy in the interior cell is most likely increasing at each time step. Would it make more sense to compute the internal energy using the EOS and the state in the buffer region and then add the kinetic energy due to the velocity source?

Hi @wilfonba, this could be fixed by subtracting the kinetic energy of the interior cells ((0.5q_cons_qp%vf(contxb)%sf(0,k,l)(v**2))) from its total energy and add the remaining to the kinetic energy assigned by the boundary condition.

haochey avatar Jul 18 '23 21:07 haochey

@haochey I think that's an easier fix. Thanks.

wilfonba avatar Jul 18 '23 22:07 wilfonba

I've added these to a lid-driven cavity PR that I'll be making eventually. Will merge after further testing.

To do:

  • [x] Validate 2D lid-driven cavity
  • [ ] Validate viscous channel flow in 2D
  • [ ] Validate viscous channel flow in 3D
  • [x] Add input file checks

wilfonba avatar Dec 25 '23 17:12 wilfonba

Thanks for keeping this up to date @wilfonba

sbryngelson avatar Dec 26 '23 02:12 sbryngelson

@wilfonba can you modify this issue to make clear what is/is not remaining?

sbryngelson avatar Feb 04 '24 19:02 sbryngelson

@sbryngelson This can be closed unless the additional boundary layer validation cases are necessary.

wilfonba avatar Feb 04 '24 19:02 wilfonba

Can you add an example boundary layer/channel flow case to examples/ in 2D and 3D?

sbryngelson avatar Feb 04 '24 20:02 sbryngelson

Yes

wilfonba avatar Feb 04 '24 21:02 wilfonba

@wilfonba is this issue closed?

sbryngelson avatar May 01 '24 16:05 sbryngelson

This was closed by #279.

wilfonba avatar May 01 '24 17:05 wilfonba

Closed by #279

sbryngelson avatar May 01 '24 17:05 sbryngelson