Skip to content

Commit

Permalink
Merge pull request #50 from ucns3d-team/adda2
Browse files Browse the repository at this point in the history
adda-ugrid-cwenoz
  • Loading branch information
TakisCFD authored May 22, 2023
2 parents aae73d6 + 3ff607a commit bec3e1f
Show file tree
Hide file tree
Showing 14 changed files with 2,132 additions and 107 deletions.
1,038 changes: 1,038 additions & 0 deletions src/boundf.f90

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions src/declarations.f90
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ MODULE DECLARATION
REAL::LAMZ !FLAGS TO BE USED FOR RESTARTING
REAL::ALPHA,BETA !FLAGS TO BE USED FOR RESTARTING
REAL::OUT_TIME !FINAL TIME TO WRITE OUTPUT FOR UNSTEADY SIMULATIONS
REAL::EVERY_TIME !FINAL TIME TO WRITE OUTPUT FOR UNSTEADY SIMULATIONS
REAL::EVERY_TIME,EK_TIME !FINAL TIME TO WRITE OUTPUT FOR UNSTEADY SIMULATIONS
REAL::XPER !PERIODICITY IN X AXIS
REAL::YPER !PERIODICITY IN Y AXIS
REAL::ZPER !PERIODICITY IN Z AXIS
Expand Down Expand Up @@ -334,7 +334,7 @@ MODULE DECLARATION
!$OMP THREADPRIVATE(sb,IBFC,x1c,y1c,z1c,h1c,number_of_dog,WEIGHT_T2,lscqm1,B1_imp,DU1,DU2,DUMMY12,xxder,yyder,zzder,C1_imp,DUR,DUL,DURR,DULR,DUT1,B1T,DUMMY12T,SOURCE_T,UTMIN,UTMAX,ax,ay,az,nx,ny,nz,nnx,nny,nnz,VVA,DETA,VVA1,VVr1,VVr2,VVr3,VVR4,VVwg,VVnpox,VVnpoy,VVnpoz,VVwpox,VVwpoy,VVwpoz,VVnxi,VVneta,VVnzeta,VVxi,VVeta,VVzeta,VVnallx,VVnally,VVnallz,VVB,VVC,VVD,VVE,VVF,vvjacobsurf,vvjacobvolume)

REAL,ALLOCATABLE,DIMENSION(:)::gamma_IN,MP_IE,MP_A,MP_AR,MP_R,MP_R_IN,MP_A_IN,MP_PINF !MULTIPHASE COMPONENTS
REAL,ALLOCATABLE,DIMENSION(:)::MODAL_FILTER,ADDA_FILTER_WEAK,ADDA_FILTER_STRONG
REAL,ALLOCATABLE,DIMENSION(:)::MODAL_FILTER,ADDA_FILTER_WEAK,ADDA_FILTER_STRONG,MODAL_FILTER_STRONG,MODAL_FILTER_WEAK
REAL,ALLOCATABLE,DIMENSION(:)::CLEFT,lamc !VALUE OF THE RECONSTRUCTED SOLUTION REFERING TO MY CELL (I) CONSERVED VARIABLE
REAL,ALLOCATABLE,DIMENSION(:)::CLEFT_ROT !VALUE OF THE RECONSTRUCTED SOLUTION REFERING TO MY CELL (I) ROTATED WITH RESPECT TO ITS FACE CONSERVED VARIABLE
REAL,ALLOCATABLE,DIMENSION(:)::CRIGHT !VALUE OF THE RECONSTRUCTED SOLUTION REFERING TO THE NEIGHBOUR OF MY CELL (I) CONSERVED VARIABLE
Expand Down Expand Up @@ -393,7 +393,7 @@ MODULE DECLARATION
REAL,ALLOCATABLE,DIMENSION(:)::LEFTV !LEFT STATE VARIABLES
REAL,ALLOCATABLE,DIMENSION(:,:)::LEFTV_DER
REAL,ALLOCATABLE,DIMENSION(:)::RIGHTV !RIGHT STATE VARIABLES
REAL,ALLOCATABLE,DIMENSION(:)::SOLUTION_INTEG2 !FOR DG AGAIN
REAL,ALLOCATABLE,DIMENSION(:)::SOLUTION_INTEG2,SOLUTION_INTEG_STRONG,SOLUTION_INTEG_WEAK !FOR DG AGAIN
REAL,ALLOCATABLE,DIMENSION(:)::VISCL !LAMINAR VISCOSITY ACCORDING TO SUTHERLAND
REAL,ALLOCATABLE,DIMENSION(:)::LAML !HEAT CONDUCTIVITY ACCORDING TO SUTHERLAND
REAL,ALLOCATABLE,DIMENSION(:)::ETVM !EDDY VISCOSITY
Expand Down Expand Up @@ -437,7 +437,7 @@ MODULE DECLARATION
REAL,ALLOCATABLE,DIMENSION(:,:)::NODES_LIST
REAL,ALLOCATABLE,DIMENSION(:,:,:)::ELEM_LISTD
real,allocatable,dimension(:,:)::totalmm,invmm
!$OMP THREADPRIVATE(TEMPFL,SRF_SPEED,srf_speedrot,lamc,totalmm,invmm,SRF,TEMPFR,FLSTAR,FRSTAR,ULSTAR,UrSTAR,LCVGRAD,RCVGRAD,LCVGRAD_T,RCVGRAD_T,TEMPUL,TEMPUR,FL,eddyfl,eddyfr,FR,RML,RMR,NODES_LIST,VEXT,ELTYPE,ELEM_DEC,ELEM_LISTD,DETERJACS,JACS,INVERSEJACS,SOLUTION_INTEG2,LEFTV,LEFTV_DER,RIGHTV,CORDS,VISCL,LAML,ETVM,TURBMV)
!$OMP THREADPRIVATE(TEMPFL,SRF_SPEED,srf_speedrot,lamc,totalmm,invmm,SRF,TEMPFR,FLSTAR,FRSTAR,ULSTAR,UrSTAR,LCVGRAD,RCVGRAD,LCVGRAD_T,RCVGRAD_T,TEMPUL,TEMPUR,FL,eddyfl,eddyfr,FR,RML,RMR,NODES_LIST,VEXT,ELTYPE,ELEM_DEC,ELEM_LISTD,DETERJACS,JACS,INVERSEJACS,SOLUTION_INTEG2,SOLUTION_INTEG_STRONG,SOLUTION_INTEG_WEAK,LEFTV,LEFTV_DER,RIGHTV,CORDS,VISCL,LAML,ETVM,TURBMV)
REAL,ALLOCATABLE,DIMENSION(:)::XCC,vgg
integer, allocatable,dimension(:)::cand,CANDS,CANDR
integer, allocatable,dimension(:,:)::CANDXR,candxS,CAND2S,CAND2rT
Expand Down Expand Up @@ -512,7 +512,7 @@ MODULE DECLARATION
END TYPE FACE_D

TYPE(U_CENTRE),ALLOCATABLE,DIMENSION(:)::U_C !1-D ARRAY FOR TYPE FOR SOLUTION OF MEAN FLOW EQUATIONS
TYPE(U_CENTRE),ALLOCATABLE,DIMENSION(:)::U_cx !1-D ARRAY FOR TYPE FOR SOLUTION OF MEAN FLOW EQUATIONS
TYPE(U_CENTRE),ALLOCATABLE,DIMENSION(:)::U_cx,U_CS,U_CW !1-D ARRAY FOR TYPE FOR SOLUTION OF MEAN FLOW EQUATIONS
TYPE(U_CENTRE),ALLOCATABLE,DIMENSION(:)::U_CT !1-D ARRAY FOR TYPE FOR SOLUTION OF TURBULENT EQUATIONS
TYPE(mass_matrix),ALLOCATABLE,DIMENSION(:)::m_1 !1-D ARRAY FOR TYPE FOR SOLUTION OF TURBULENT EQUATIONS

Expand Down Expand Up @@ -775,6 +775,7 @@ MODULE DECLARATION
INTEGER::nonodes !NUMBER OF NODES
INTEGER::walls !FLAG TO DECLARE IF THIS IS CELL BOUNDED BY A WALL
INTEGER::LUMP
INTEGER::FILTERED
INTEGER,ALLOCATABLE,DIMENSION(:)::NODES !NODES INDEX
INTEGER,ALLOCATABLE,DIMENSION(:)::TYPEs_FACES !TYPE OF EACH FACE (QUADRILATERAL, TRIANGLE)
INTEGER,ALLOCATABLE,DIMENSION(:)::REORIENT !CONSISTENCY ACROSS INTERFACE IN TERMS OF ORDERING OF QUADRATURE POINTS
Expand All @@ -788,15 +789,15 @@ MODULE DECLARATION
INTEGER,ALLOCATABLE,DIMENSION(:)::INEIGHB !NEIGHBOURS CPU INDEX
INTEGER,ALLOCATABLE,DIMENSION(:)::INEIGHN !NEIGHBOURS NUMBERING IN OTHER CPUS
REAL::TOTVOLUME !VOLUME OF ELEMENT
REAL::DTL !LOCAL TIME STEP SIZE
REAL::DTL,VISCX !LOCAL TIME STEP SIZE
REAL::MINEDGE !INSCRIBED SPHERE RADIUS
REAL::STENCIL_DIST !STENCIL DISTANCE FACTOR
REAL::WallDist !WALL DISTANCE
REAL::XXC,DXX,DYY,DZZ !CELL CENTRE COORDINATES IN X
REAL::YYC !CELL CENTRE COORDINATES IN Y
REAL::ZZC !CELL CENTRE COORDINATES IN Z
REAL::CONDITION
REAL::ER,er2,er1,ER2Dt,ER1DT,ER1ER2,lwcx2,DISS !ADDA COMPONENTS
REAL::ER,er2,er1,ER2Dt,ER1DT,ER1ER2,lwcx2,DISS,ERX !ADDA COMPONENTS
REAL,DIMENSION(1)::WCX
REAL,ALLOCATABLE,DIMENSION(:)::FACEANGLEX !FACEANGLE X,Y
REAL,ALLOCATABLE,DIMENSION(:)::FACEDISS
Expand Down
157 changes: 157 additions & 0 deletions src/dg_functions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,163 @@ FUNCTION DG_VOL_INTEGRAL2(N)
END FUNCTION DG_VOL_INTEGRAL2



FUNCTION DG_VOL_INTEGRAL_STRONG(N)
!> @brief
!> Calculates the volume integral term in the DG RHS for scalar linear advection with speed = 1
IMPLICIT NONE
INTEGER,INTENT(IN)::N
REAL,DIMENSION(1:NOF_VARIABLES)::DG_VOL_INTEGRAL_STRONG
INTEGER::I,J,K,NQP,I_QP,I_VAR
REAL::PH,INTEG
REAL,DIMENSION(1:NOF_VARIABLES)::DG_SOL2
REAL,DIMENSION(1:idegfree)::BASIS_TEMP


compwrt=-2


DO J=1,NOF_VARIABLES
do k=1,idegfree
U_CS(Iconsidered)%VALDG(1,J,K+1)=U_C(ICONSIDERED)%VALDG(1,J,K+1)*MODAL_FILTER_STRONG(k)
END DO
end do



NQP = ielem(n,iconsidered)%iTOTALPOINTS






NUMBER=IELEM(N,ICONSIDERED)%IORDER
NUMBER_OF_DOG = IELEM(N,ICONSIDERED)%IDEGFREE
DG_VOL_INTEGRAL_STRONG(:) = 0.0d0





DO I_QP = 1, NQP
X1=QP_ARRAY(ICONSIDERED)%X(I_QP)
Y1=QP_ARRAY(ICONSIDERED)%Y(I_QP)
if (dimensiona.eq.3)then
z1=QP_ARRAY(ICONSIDERED)%Z(I_QP)
end if




if (dimensiona.eq.2)then

BASIS_TEMP = BASIS_REC2D(N, X1, Y1, NUMBER, ICONSIDERED, NUMBER_OF_DOG)
else
BASIS_TEMP = BASIS_REC(N, X1, Y1, z1,NUMBER, ICONSIDERED, NUMBER_OF_DOG)

end if



DO I_VAR = 1, NOF_VARIABLES
DG_SOL2(I_VAR) = DOT_PRODUCT(BASIS_TEMP(1:NUMBER_OF_DOG), U_CS(ICONSIDERED)%VALDG(1,I_VAR,2:NUMBER_OF_DOG+1))
END DO



DG_VOL_INTEGRAL_STRONG= DG_VOL_INTEGRAL_STRONG+ (QP_ARRAY(ICONSIDERED)%QP_WEIGHT(I_QP) *DG_SOL2/IELEM(N,ICONSIDERED)%TOTVOLUME)


END DO


DG_VOL_INTEGRAL_STRONG(:) =U_C(ICONSIDERED)%VALDG(1,:,1)+DG_VOL_INTEGRAL_STRONG(:)

compwrt=0

END FUNCTION DG_VOL_INTEGRAL_STRONG



FUNCTION DG_VOL_INTEGRAL_WEAK(N)
!> @brief
!> Calculates the volume integral term in the DG RHS for scalar linear advection with speed = 1
IMPLICIT NONE
INTEGER,INTENT(IN)::N
REAL,DIMENSION(1:NOF_VARIABLES)::DG_VOL_INTEGRAL_WEAK
INTEGER::I,J,K,NQP,I_QP,I_VAR
REAL::PH,INTEG
REAL,DIMENSION(1:NOF_VARIABLES)::DG_SOL2
REAL,DIMENSION(1:idegfree)::BASIS_TEMP


compwrt=-2



DO J=1,NOF_VARIABLES
do k=1,idegfree
U_CW(Iconsidered)%VALDG(1,J,K+1)=U_C(ICONSIDERED)%VALDG(1,J,K+1)*MODAL_FILTER_WEAK(k)
END DO
end do


NQP = ielem(n,iconsidered)%iTOTALPOINTS






NUMBER=IELEM(N,ICONSIDERED)%IORDER
NUMBER_OF_DOG = IELEM(N,ICONSIDERED)%IDEGFREE
DG_VOL_INTEGRAL_WEAK(:) = 0.0d0





DO I_QP = 1, NQP
X1=QP_ARRAY(ICONSIDERED)%X(I_QP)
Y1=QP_ARRAY(ICONSIDERED)%Y(I_QP)
if (dimensiona.eq.3)then
z1=QP_ARRAY(ICONSIDERED)%Z(I_QP)
end if




if (dimensiona.eq.2)then

BASIS_TEMP = BASIS_REC2D(N, X1, Y1, NUMBER, ICONSIDERED, NUMBER_OF_DOG)
else
BASIS_TEMP = BASIS_REC(N, X1, Y1, z1,NUMBER, ICONSIDERED, NUMBER_OF_DOG)

end if



DO I_VAR = 1, NOF_VARIABLES
DG_SOL2(I_VAR) = DOT_PRODUCT(BASIS_TEMP(1:NUMBER_OF_DOG), U_CW(ICONSIDERED)%VALDG(1,I_VAR,2:NUMBER_OF_DOG+1))
END DO



DG_VOL_INTEGRAL_WEAK = DG_VOL_INTEGRAL_WEAK+ (QP_ARRAY(ICONSIDERED)%QP_WEIGHT(I_QP) *DG_SOL2/IELEM(N,ICONSIDERED)%TOTVOLUME)


END DO


DG_VOL_INTEGRAL_WEAK(:) =U_C(ICONSIDERED)%VALDG(1,:,1)+DG_VOL_INTEGRAL_WEAK(:)

compwrt=0

END FUNCTION DG_VOL_INTEGRAL_WEAK



SUBROUTINE RECONSTRUCT_DG(N)
IMPLICIT NONE
INTEGER,INTENT(IN)::N
Expand Down
20 changes: 20 additions & 0 deletions src/flux_p.f90
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ SUBROUTINE SOLUTION_INTEG

END SUBROUTINE SOLUTION_INTEG

SUBROUTINE SOLUTION_INTEG_S
IMPLICIT NONE

SOLUTION_INTEG_STRONG=DG_VOL_INTEGRAL_STRONG(N)


END SUBROUTINE SOLUTION_INTEG_S


SUBROUTINE SOLUTION_INTEG_W
IMPLICIT NONE

SOLUTION_INTEG_WEAK=DG_VOL_INTEGRAL_WEAK(N)


END SUBROUTINE SOLUTION_INTEG_W




SUBROUTINE CALCULATE_FLUXESHI(N)
!> @brief
!> This subroutine computes the fluxes for linear-advection equation
Expand Down
14 changes: 7 additions & 7 deletions src/grid_p.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6325,13 +6325,13 @@ SUBROUTINE DETERMINE_SIZE(N,IORDER,ISELEM,ISELEMT,IOVERST,IOVERTO,ILX,NUMNEIGHBO
CASE (1,2,3)
idegfree2=2
IORDER2=1
NUMNEIGHBOURS2=7
NUMNEIGHBOURS2=6


CASE(4,5,6,7)
idegfree2=2
IORDER2=1
NUMNEIGHBOURS2=7
NUMNEIGHBOURS2=6

END SELECT

Expand Down Expand Up @@ -6955,19 +6955,19 @@ SUBROUTINE ADAPT_CRITERION
KMAXE=XMPIELRANK(N)
DO I=1,KMAXE
FC=0
IF (IELEM(N,I)%YYC.LT.-0.3)THEN
IF (IELEM(N,I)%YYC.gt.0.244444)THEN
FC=1

END IF
IF (IELEM(N,I)%YYC.GT.0.4)THEN
IF (IELEM(N,I)%YYC.lt.-0.1)THEN

FC=1
END IF
IF (IELEM(N,I)%XXC.LT.-0.5)THEN
IF (IELEM(N,I)%XXC.LT.-0.05)THEN
FC=1

END IF
IF (IELEM(N,I)%XXC.GT.2.0)THEN
IF (IELEM(N,I)%XXC.GT.3.0)THEN

FC=1
END IF
Expand All @@ -6983,7 +6983,7 @@ SUBROUTINE ADAPT_CRITERION
! IF (FC.EQ.1)THEN
! IELEM(N,I)%HYBRID=1
!
! END IF
! END IF


IF (FC.EQ.1)THEN
Expand Down
Loading

0 comments on commit bec3e1f

Please sign in to comment.