CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Periodic boundary conditions for compressible Euler equations

Register Blogs Community New Posts Updated Threads Search

Like Tree11Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 25, 2017, 10:31
Default
  #21
Senior Member
 
Join Date: Oct 2011
Posts: 242
Rep Power: 16
naffrancois is on a distinguished road
Hello,

A possible problem may arise from the sub-steps of the runge kutta integrator. Indeed, you apply periodicity on Q, compute the fluxes and update Q1 as Q1=Q+dt*RHS. However this update overrides the ghost cells of Q1 (Q1(0,:,: ) , etc) but you reuse Q1 in the next step for RHS evaluation. Same holds for Q2.

Each conservative vector argument of your function RHS should be applied periodicity as you did it for Q. e.g.:

Q1=Q+dt*RHS
Q1(0:,:, )=Q1(nx,:,: )
... etc
Then RHS(Q1)

Q2=...
Q2(0:,:,: )=Q2(nx,:,: )
... etc
Then RHS(Q2)

If I were you, for debugging purposes, I would switch to a simple Euler time integrator. For 1st order spatial discretization is ok.

The second point to check is the vector RHS. RHS(1), RHS(nx) and RHS(ny) are not defined, but you said indices 1, nx, ny are physical cells.

You should carefully revise your indices, I believe several errors are still there. Ex: Mxp(nx) is not defined because Mxch(nx) is not filled in any value.

Also be careful in your evaluation of dt. It should be inside the temporal loop as your eigenvalues will vary in time.
FMDenaro and selig5576 like this.
naffrancois is offline   Reply With Quote

Old   April 25, 2017, 11:05
Default Boundary Cond
  #22
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Hi,

Thank you very much for that remark. Upon looking at my code more closely I that there are terms that do not have any value at 1, nx, and ny. I have tow thoughts:

1. Extend my arrays so I have (0:nx+2,0:ny+2), so I still have ghost points and do not have to subtract nx-1 so maintain a symmetric array

2. Should I apply boundary conditions at the points of nx, ny, and 1? I'm inclined to do the first option, however would be interested to see your perspective.

Thanks!
selig5576 is offline   Reply With Quote

Old   April 25, 2017, 11:11
Default
  #23
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,777
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by selig5576 View Post
Hi,

Thank you very much for that remark. Upon looking at my code more closely I that there are terms that do not have any value at 1, nx, and ny. I have tow thoughts:

1. Extend my arrays so I have (0:nx+2,0:ny+2), so I still have ghost points and do not have to subtract nx-1 so maintain a symmetric array

2. Should I apply boundary conditions at the points of nx, ny, and 1? I'm inclined to do the first option, however would be interested to see your perspective.

Thanks!

Are you using the Fortran compiler with the array bounds check flag?
naffrancois and selig5576 like this.
FMDenaro is offline   Reply With Quote

Old   April 25, 2017, 11:28
Default Fortran compiler
  #24
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Hi Denaro,

I am using the G95 compiler. It will pop up messages if I am trying to access arrays outside the dimension of the array.
selig5576 is offline   Reply With Quote

Old   April 25, 2017, 16:43
Default
  #25
Senior Member
 
Join Date: Oct 2011
Posts: 242
Rep Power: 16
naffrancois is on a distinguished road
I do not know compiler options for g95, but I agree, always make sure in development that you use all available checks your compiler offers you, it can save you much much time.

I attached a possible index notation, although you may use whatever you want, the important here is to evaluate quantities where they should be.
Attached Images
File Type: jpg computational_domain.jpg (125.1 KB, 16 views)
FMDenaro and selig5576 like this.
naffrancois is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centrifugal fan j0hnny CFX 13 October 1, 2019 13:55
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20
Problem with SIMPLEC-like finite volume channel flow boundary conditions ghobold Main CFD Forum 3 June 15, 2015 11:14
PEMFC module + multiple periodic boundary conditions vkrastev FLUENT 2 December 22, 2014 04:15
periodic boundary conditions fro pressure Salem Main CFD Forum 21 April 10, 2013 00:44


All times are GMT -4. The time now is 11:46.