-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ancora non funzionano lo script Boundary_conditions.f90
- Loading branch information
Showing
13 changed files
with
3,484 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
module Boundary_conditions | ||
|
||
! Verifica delle condizioni al contorno da applicare | ||
|
||
use problema_vero | ||
|
||
use conversione | ||
|
||
implicit none | ||
|
||
contains | ||
|
||
subroutine BC_dx(stato_dx, BC) | ||
|
||
real(kind = 8), dimension(:), intent(in) :: stato_dx | ||
|
||
real(kind = 8), dimension(size(stato_dx), size(stato_dx)), intent(inout) :: BC | ||
|
||
real(kind = 8), dimension(size(stato_dx)) :: lambda | ||
|
||
real(kind = 8), dimension(size(stato_dx), size(stato_dx)) :: R, L | ||
|
||
real(kind = 8), dimension(size(stato_dx)) :: stato_ext,& ! stato_ext = [rho_ext, m_ext] | ||
delta_w,& ! incremento delle variabili conservative | ||
delta_v,& ! incremento variabili caratteristiche | ||
BC_cons ! BC in forma conservativa | ||
|
||
|
||
call eigenstructure(stato_dx, lambda, R, L) | ||
|
||
!write(*,*) " BC_fis(:, 2) prima di trasformazioni stato dx = ", BC(:, 2) | ||
|
||
call fis2cons(BC(:, 2), BC_cons) ! Calcolo la m all' uscita dell'estremo destro | ||
! BC = [ altezza , velocità ] | ||
|
||
delta_w = BC_cons - stato_dx | ||
|
||
delta_v = matmul(L, delta_w) ! passo alle variabili caratteristiche | ||
|
||
delta_v = delta_v * 0.5d0 * (1 - sign(1.d0, lambda)) ! controllo sul segno delle velocità di propagazione | ||
! applico condizioni al contorno solo se | ||
! è minore o uguale a 0 | ||
|
||
delta_w = matmul(R, delta_v) ! torno alle variabili conservative | ||
|
||
BC_cons = stato_dx + delta_w | ||
|
||
call cons2fis(BC_cons, BC(:, 2)) ! Torno alle variabili fisiche | ||
! per le condizioni al contorno | ||
! BC(1, 2) = h | ||
|
||
!write(*,*) " BC_fis(:, 2) dopo trasformazioni stato dx = ", BC(:, 2) | ||
|
||
|
||
endsubroutine BC_dx | ||
|
||
subroutine BC_sx(stato_sx, BC) | ||
|
||
real(kind = 8), dimension(:), intent(in) :: stato_sx | ||
|
||
real(kind = 8), dimension(size(stato_sx), size(stato_sx)), intent(inout) :: BC | ||
|
||
real(kind = 8), dimension(size(stato_sx)) :: lambda | ||
|
||
real(kind = 8), dimension(size(stato_sx), size(stato_sx)) :: R, L | ||
|
||
real(kind = 8), dimension(size(stato_sx)) :: stato_ext,& ! stato_ext = [rho_ext, m_ext] | ||
delta_w,& ! incremento delle variabili conservative | ||
delta_v,& ! incremento variabili caratteristiche | ||
BC_cons ! BC in forma conservativa | ||
|
||
|
||
call eigenstructure(stato_sx, lambda, R, L) | ||
|
||
write(*,*) " BC_fis(:, 1) prima di trasformazioni stato sx = ", BC(:, 1) | ||
|
||
|
||
call fis2cons(BC(:, 1), BC_cons) ! Calcolo la m all' uscita dell'estremo sinistro | ||
! BC = [ velocità, pressione ] | ||
|
||
delta_w = BC_cons - stato_sx | ||
|
||
!write(*,*) "R = ", R | ||
|
||
!write(*,*) "prima del checking lambda delta_w = ", delta_w | ||
|
||
delta_v = matmul(L, delta_w) ! passo alle variabili caratteristiche | ||
|
||
!write(*,*) "L = ", L | ||
|
||
!write(*,*) "stato_sx = ", stato_sx | ||
|
||
!write(*,*) "lambda_sx = ", lambda | ||
|
||
where (lambda <= 0) ! controllo sul segno delle velocità di propagazione | ||
|
||
delta_v = 0 ! applico condizioni al contorno solo se è minore o uguale a 0 | ||
|
||
endwhere | ||
|
||
delta_w = matmul(R, delta_v) ! torno alle variabili conservative | ||
|
||
BC_cons = stato_sx + delta_w | ||
|
||
!write(*,*) "delta_w = ", delta_w | ||
|
||
call cons2fis(BC_cons, BC(:, 1)) ! Torno alle variabili fisiche | ||
! per le condizioni al contorno | ||
! BC(1, 1) = u | ||
|
||
!write(*,*) " BC_fis(:, 1) dopo trasformazioni stato sx = ", BC(:, 1) | ||
|
||
|
||
endsubroutine BC_sx | ||
|
||
endmodule Boundary_conditions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
module LOGO | ||
|
||
implicit none | ||
|
||
contains | ||
subroutine disegna_logo() | ||
|
||
|
||
write(*,*) "------------------------------------BENVENUTI NEL FOTTUTISSIMO RI",& | ||
"SOLUTORE DELLE SW-EQUATIONS-----------------------------------" | ||
|
||
write(*,*) " ", & | ||
" ------------------------***---------------------------" | ||
write(*,*) " ", & | ||
" -------------------*************----------------------" | ||
write(*,*) " __ __ ___ ___ ___ _ _ _ _ __ __ ", & | ||
" ----------------********************------------------" | ||
write(*,*) "|__ | | | | | | | | |_ |_ | | | | | || | ", & | ||
" ------------**************************----------------" | ||
write(*,*) "| |__| | | |__| | | _| _| | | | |__||__| ", & | ||
" ---------*******************************--------------" | ||
write(*,*) " ", & | ||
" -- ________******************________*****------------" | ||
write(*,*) " ", & | ||
" --/ \****************/ \*****-----------" | ||
write(*,*) " ", & | ||
" -/ \**************/ \*****----------" | ||
write(*,*) " ", & | ||
" -| . |--------------| . |*****----------" | ||
write(*,*) " ", & | ||
" -\ /******/\******\ /*****----------" | ||
write(*,*) " ", & | ||
" --\________/******/++\******\________/******----------" | ||
write(*,*) " ", & | ||
" --***************/++++\*********************----------" | ||
write(*,*) " ", & | ||
" --**************/++++++|*******************-----------" | ||
write(*,*) " ", & | ||
" --*************/+++++++|*******************-----------" | ||
write(*,*) " ", & | ||
" --************( . )( . )******************------------" | ||
write(*,*) " ", & | ||
" --***********_____**********************--------------" | ||
write(*,*) " ", & | ||
" --**********/ \********************---------------" | ||
write(*,*) " ", & | ||
" ---********/ \******************----------------" | ||
write(*,*) " ", & | ||
" ---********| O |*****************-----------------" | ||
write(*,*) " ", & | ||
" ---********\ /***************-------------------" | ||
write(*,*) " ", & | ||
" ---*********\_____/**************---------------------" | ||
write(*,*) " ", & | ||
" ----***************************-----------------------" | ||
write(*,*) " ", & | ||
" ------********************----------------------------" | ||
write(*,*) " ", & | ||
" ----------*******-------------------------------------" | ||
|
||
endsubroutine disegna_logo | ||
|
||
endmodule LOGO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
############################################################ | ||
# MAKEFILE FOR F95 # | ||
############################################################ | ||
|
||
# Zero axiom: the file name of a makefile must be mandatorily | ||
# | ||
# makefile OR Makefile | ||
|
||
# To start the execution, type in terminal: make | ||
|
||
# The names (identifictars of variables) for aliases | ||
# are completely free! They are usually in CAPITALS. | ||
|
||
# FUNDAMENTAL WARNINGS | ||
# | ||
# The actions, typically $(CMP) and $(LNK), must be | ||
# NECESSARILY preceded by a DAMNED! TAB character | ||
# | ||
|
||
############################################################ | ||
# | ||
# Compiler and linker | ||
# | ||
# The following definitions are for Fortran 95 only, | ||
# but they can extended if another language is used, | ||
# or modified when other compilers are considered. | ||
|
||
# LNK alias to be used as $(LNK) to compile and link main files .f90 | ||
# CMP alias to be used as $(CMP) to compile the source files .f90 | ||
# OPT alias to be used as $(OPT) to select the compilation options | ||
|
||
# NAG Compiler | ||
# ============ | ||
# | ||
CMP = f95 -c | ||
LNK = f95 | ||
OPT = -g -mcmodel=large | ||
# OPT = -gline # Line number is indicated for errors | ||
# occurring in runtime (for debugging) | ||
# OPT = -O3 # Execution optimization | ||
|
||
|
||
# Intel Compiler | ||
# ============== | ||
# | ||
# CMP = ifort -c -heap-arrays 100 | ||
# LNK = ifort | ||
# OPT = | ||
# OPT = -g -DD -debug -traceback -fpe0 -check all | ||
# OPT = -fast | ||
# OPT = -O3 | ||
|
||
|
||
# GNU Fortran Compiler | ||
# =================== | ||
# | ||
# CMP = gfortran -c | ||
# LNK = gfortran | ||
# OPT = -fno-automatic -fbounds-check -ffpe-trap=invalid,zero,overflow -ggdb3 | ||
# OPT = -fno-automatic -O3 | ||
|
||
############################################################ | ||
# | ||
# Objects: list of all objects *.o | ||
|
||
OBJS = gnufor_mio.o LOGO.o conversione.o inversa.o problema_vero.o fluxes.o\ | ||
Boundary_conditions.o #fix_BC.o | ||
# OBJS alias to be used as $(OBJS) | ||
|
||
# Alternative way for line feed | ||
#OBJS = Riemann_solvers.o \ | ||
# polytropic_ideal_gas.o | ||
|
||
############################################################ | ||
# Executable generation by the linker / the effect of command | ||
# / make starts from here | ||
|
||
finale.exe: SW_completo.o $(OBJS) | ||
$(LNK) $(OPT) SW_completo.o $(OBJS) \ | ||
-o finale.exe # Name chosen for .exe | ||
|
||
############################################################ | ||
# Objects generation | ||
|
||
SW_completo.o: SW_completo.f90 $(OBJS) | ||
$(CMP) $(OPT) SW_completo.f90 | ||
|
||
gnufor_mio.o: gnufor_mio.f90 | ||
$(CMP) $(OPT) gnufor_mio.f90 | ||
|
||
LOGO.o: LOGO.f90 | ||
$(CMP) $(OPT) LOGO.f90 | ||
|
||
conversione.o: conversione.f90 | ||
$(CMP) $(OPT) conversione.f90 | ||
|
||
inversa.o: inversa.f90 | ||
$(CMP) $(OPT) inversa.f90 | ||
|
||
problema_vero.o: problema_vero.f90 inversa.o | ||
$(CMP) $(OPT) problema_vero.f90 | ||
|
||
Boundary_conditions.o: Boundary_conditions.f90 problema_vero.o conversione.o | ||
$(CMP) $(OPT) Boundary_conditions.f90 | ||
|
||
#fix_BC.o: fix_BC.f90 conversione.o | ||
# $(CMP) $(OPT) fix_BC.f90 | ||
|
||
fluxes.o: fluxes.f90 problema_vero.o conversione.o Boundary_conditions.o | ||
$(CMP) $(OPT) fluxes.f90 | ||
|
||
|
||
|
||
#plot.o: plot.f90 checking.o compl_Newton.o gnufor_mio.o | ||
# $(CMP) $(OPT) plot.f90 | ||
|
||
# | ||
# il carattere TAB c'e' ma non appare a causa di # | ||
# provare a fare return appena dopo # per credere | ||
# il TAB (con il suo fottutissimo doppio spazio) resuscita | ||
|
||
|
||
############################################################ | ||
# Cleaning command to remove all objects *.o, files *.mod and | ||
# the executables *.exe | ||
|
||
clean: | ||
@echo cleaning objects, modules, executables | ||
rm *.o *.mod *.exe | ||
|
||
cleanimages: | ||
@echo cleaning images files | ||
rm video/plot_video/* | ||
|
||
cleanvideo: | ||
@echo cleaning video files | ||
rm plot_video/* | ||
|
||
# The command "make clean" deletes all the indicated files | ||
|
||
############################################################ |
Oops, something went wrong.