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

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 9, 2017, 23:49
Default Periodic boundary conditions for compressible Euler equations
  #1
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
Hi,

I am currently building up a 2D hydrodynamics code. Specifically, I am numerically solving the 2D Euler equations in order to simulate Kelvin-Helmholtz instability. The boundary conditions are periodic, however I am running into issues when enforcing such conditions.

Given the governing equations

\frac{\partial \rho}{\partial t} =- \frac{\partial \rho u}{\partial x} - \frac{\partial \rho v}{\partial y}\\
\frac{\partial \rho u}{\partial t} =- \frac{\partial \rho u^{2}+p}{\partial x} - \frac{\partial \rho u v}{\partial y}\\
\frac{\partial \rho v}{\partial t} =-\frac{\partial \rho u v}{\partial x} - \frac{\partial \rho v^{2} +p}{\partial y}\\
\frac{\partial E}{\partial t} =- \frac{\partial u(E+p)}{\partial x} - \frac{\partial v(E+p)}{\partial y}

I define Q to be the left-hand side of the system of PDEs. As such in discrete form its a (nx,ny,4) array. Given we have periodic boundary conditions I set

Q(1,1:ny,1:4) = Q(nx,1:ny,1:4) (Q(1) = Q(n) in x)
Q(1:nx,1,1:4) = Q(1:nx,ny,1:4) (Q(1) = Q(n) in y)

With this implementation I am not getting the desired effects of the Kelvin-Helmholtz. I conclude the error is at the boundary due to the plot. I start my arrays at 1 so my boundaries are at 1 and nx.

Code:
subroutine BC (Q_out)
	implicit none
	real, dimension(nx,ny,4), intent(inout) :: Q_out
    
	Q_out(1,:,:) = Q_out(nx,:,:)
	Q_out(:,1,:) = Q_out(:,ny,:)
 	return
end subroutine
I am assuming a uniform grid and am using the Rusanov (Local Lax Friedrichs) flux discretization, so there shouldnt be any special treatment of ghost points needed. I have done periodic boundary conditions for non-systems of PDEs and the implementation is straight forward however, I am suspecting that I way of doing PBCs is not correct given I have a system.

NOTE 1: I can post my Fortran code if it will help.
NOTE 2: I have tested this code on various 2D Riemann problems and I get correct results.
selig5576 is offline   Reply With Quote

 


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 17:59.