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

Galerkin projection

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 5, 2011, 11:57
Default Galerkin projection
  #1
New Member
 
sara
Join Date: Mar 2011
Posts: 7
Rep Power: 0
sara2115 is on a distinguished road
Hi every one.
thank you for reading my thread.
I am working on galerkin projection to make a reduced order model by proper orthogonal modes, but i don't understand why my galerkin projection dosen't work properly. I've used general coordinates to calculate spatial derivatives.
I have checked all the steps but I don't understand why it doesn't work.
here is my code ... every term is a part of projection...
ns= number of modes
nn=number of grids in direction
mm=number of grids in direction
vm=mean velocity in y direction
um=mean velocity in x direction
Q = temporal coefficients for ROM
thank you.



!------------------------------------------
!================================ CONVECTION TERM ===========================
!================================ THE FIRST TERM ===========================
DO K=1,NS
DO I=1,MM
DO J=1,NN
T1 =PHI_U(I,J,K)*(UM(I,J)*UM_DX(I,J)+VM(I,J)*UM_DY(I, J))&
+PHI_V(I,J,K)*(UM(I,J)*VM_DX(I,J)+VM(I,J)*VM_DY(I, J))
TERM_1(k)=T1+TERM_1(k)
END DO
END DO
END DO
!================================== THE SECOND TERM ==========================
DO K=1,NS
DO M=1,NS
DO I=1,MM
DO J=1,NN
T2 =PHI_U(I,J,K)*(UM(I,J)*PHI_UDX(I,J,M)+VM(I,J)*PHI_ UDY(I,J,M))&
+PHI_V(I,J,K)*(UM(I,J)*PHI_VDX(I,J,M)+VM(I,J)*PHI_ VDY(I,J,M))
TERM_2(k,M)=TERM_2(K,M)+T2
END DO
END DO
END DO
END DO
!=================================== THE THIRD TERM ==========================
DO K=1,NS
DO M=1,NS
DO I=1,MM
DO J=1,NN
T3 =PHI_U(I,J,K)*(PHI_U(I,J,M)*UM_DX(I,J)+PHI_V(I,J,M )*UM_DY(I,J))&
+PHI_V(I,J,K)*(PHI_U(I,J,M)*VM_DX(I,J)+PHI_V(I,J,M )*VM_DY(I,J))
TERM_3(K,M)=TERM_3(K,M)+T3
END DO
END DO
END DO
END DO
!=================================== THE FORTH TERM ==========================
!=================================== FORTHE-FIRST ===========================
DO K=1,NS
DO M=1,NS
DO N=1,NS
DO I=1,MM
DO J=1,NN
T4_1 =PHI_U(I,J,K)*(PHI_U(I,J,N)*PHI_UDX(I,J,M)+PHI_V(I ,J,N)*PHI_UDY(I,J,M))
TERM4_1(K,M,N)=TERM4_1(K,M,N)+T4_1
END DO
END DO
END DO
END DO
END DO
!=================================== FORTHE-SECOND ============================
DO K=1,NS
DO M=1,NS
DO N=1,NS
DO I=1,MM
DO J=1,NN
T4_2 =PHI_V(I,J,K)*(PHI_U(I,J,N)*PHI_VDX(I,J,M)+PHI_V(I ,J,N)*PHI_VDY(I,J,M))
TERM4_2(K,M,N)=TERM4_2(K,M,N)+T4_2
END DO
END DO
END DO
END DO
END DO
!==================== SUM OF FIRST TERM AND THE SECOND ONE ====================
DO K=1,NS
DO M=1,NS
DO N=1,NS TERM_4(K,M,N)=TERM4_1(K,M,N)+TERM4_2(K,M,N) !*Q1(M)*Q1(N)
END DO
END DO
END DO
!================================================= =============================
! THE PRESSURE TERM IS ZERO AND IT HAS NO CORPORATION TO THE SET OF ODES
!================================================= =============================
!================================== THE DIFFUSION TERM ============================
DO K=1,NS
DO I=1,MM
DO J=1,NN
TERM5_1(K)=TERM5_1(K)+PHI_U(I,J,K)*(UM_DX2(I,J)+UM _DY2(I,J))+PHI_V(I,J,K)*(VM_DX2(I,J)+VM_DY2(I,J))
END DO
END DO
END DO
!==================================== FIFTH-SECOND =============================
DO K=1,NS
DO M=1,NS
DO I=1,MM
DO J=1,NN
T5_2=PHI_U(I,J,K)*(PHI_UDX2(I,J,M)+PHI_UDY2(I,J,M) )+PHI_V(I,J,K)*(PHI_VDX2(I,J,M)+PHI_VDY2(I,J,M))
TERM5_2(K,M)=TERM5_2(K,M)+T5_2
END DO
END DO
END DO
END DO
!================================================= =============================
!===========
!===========
!===========
DO K=1,NS
A(K) =-TERM_1(K)+TERM5_1(K)/RE
END DO
!
DO K=1,NS
DO M=1,NS
B(K,M) =-TERM_2(K,M)-TERM_3(K,M)+TERM5_2(K,M)/RE
END DO
END DO
!
DO K=1,NS
DO M=1,NS
DO N=1,NS
C(K,M,N)=-TERM_4(K,M,N)
END DO
END DO
END DO
!================================================= =============================
!======================
!======================
!======================
DO K=1,NS
DO M=1,NS
BB(K)=BB(K)+B(K,M)*Q1(M)
END DO
END DO
!===============
DO K=1,NS
DO M=1,NS
DO N=1,NS
CC(K)=CC(K)+C(K,M,N)*Q1(M)*Q1(N)
END DO
END DO
END DO
!===============
DO K=1,NS
F(K)=(A(K)+BB(K)+CC(K))
END DO
!===============
!===============
!===============
Q=Q*DT+F
sara2115 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
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 08:36
projection method sudhakar Main CFD Forum 4 December 8, 2007 02:25
how to caculate the Galerkin projection ztdep Main CFD Forum 5 March 16, 2006 01:49
free surface flow and projection methods sylvain Main CFD Forum 2 April 26, 2002 10:45
A Second-Order Projection Method for Incompressibl Ivan Main CFD Forum 5 April 29, 2001 08:27


All times are GMT -4. The time now is 00:48.