diff --git a/Dependencies.txt b/Dependencies.md similarity index 100% rename from Dependencies.txt rename to Dependencies.md diff --git a/src/elliptic_mod.f90 b/dependencies/elliptic/elliptic_mod.f90 similarity index 100% rename from src/elliptic_mod.f90 rename to dependencies/elliptic/elliptic_mod.f90 diff --git a/src/incomplete_gamma_mod.f90 b/dependencies/incomplete_gamma/incomplete_gamma_mod.f90 similarity index 100% rename from src/incomplete_gamma_mod.f90 rename to dependencies/incomplete_gamma/incomplete_gamma_mod.f90 diff --git a/src/random.f b/dependencies/random/random.f similarity index 100% rename from src/random.f rename to dependencies/random/random.f diff --git a/src/random.h b/dependencies/random/random.h similarity index 100% rename from src/random.h rename to dependencies/random/random.h diff --git a/src/random_mod.f90 b/dependencies/random/random_mod.f90 similarity index 100% rename from src/random_mod.f90 rename to dependencies/random/random_mod.f90 diff --git a/src/randother.f b/dependencies/random/randother.f similarity index 100% rename from src/randother.f rename to dependencies/random/randother.f diff --git a/src/.depend b/src/.depend index 0b5c432..724392a 100644 --- a/src/.depend +++ b/src/.depend @@ -1,100 +1,60 @@ -advance_state__genmod.o : advance_state__genmod.f90 -antithetic_get__genmod.o : antithetic_get__genmod.f90 -antithetic_memory__genmod.o : antithetic_memory__genmod.f90 -antithetic_set__genmod.o : antithetic_set__genmod.f90 -auxval.o : auxval.f90 random_mod.o beam_mod.o fields_mod.o basic_mod.o constants.o -auxval__genmod.o : auxval__genmod.f90 -basic_mod.o : basic_mod.f90 random_mod.o mpihelper_mod.o constants.o +../dependencies/elliptic/elliptic_mod.o : ../dependencies/elliptic/elliptic_mod.f90 +../dependencies/incomplete_gamma/incomplete_gamma_mod.o : ../dependencies/incomplete_gamma/incomplete_gamma_mod.f90 +../dependencies/random/random_mod.o : ../dependencies/random/random_mod.f90 +auxval.o : auxval.f90 ../dependencies/random/random_mod.o beam_mod.o fields_mod.o basic_mod.o constants.o +basic_mod.o : basic_mod.f90 ../dependencies/random/random_mod.o mpihelper_mod.o constants.o beam_mod.o : beam_mod.f90 ion_induced_mod.o geometry_mod.o weighttypes_mod.o particletypes_mod.o distrib_mod.o basic_mod.o mpihelper_mod.o constants.o celldiag_mod.o : celldiag_mod.f90 beam_mod.o basic_mod.o mpihelper_mod.o constants.o chkrst.o : chkrst.f90 mv2bk.o psupply_mod.o constants.o fields_mod.o beam_mod.o basic_mod.o -chkrst__genmod.o : chkrst__genmod.f90 constants.o : constants.f90 -cp2bk__genmod.o : cp2bk__genmod.f90 decimal_to_seed__genmod.o : decimal_to_seed__genmod.f90 -diagnose.o : diagnose.f90 mv2bk.o psupply_mod.o weighttypes_mod.o splinebound_mod.o geometry_mod.o celldiag_mod.o fields_mod.o xg_mod.o beam_mod.o neutcol_mod.o maxwsrce_mod.o basic_mod.o -diagnose__genmod.o : diagnose__genmod.f90 -distrib_mod.o : distrib_mod.f90 random_mod.o constants.o -elliptic_mod.o : elliptic_mod.f90 +diagnose.o : diagnose.f90 magnet_mod.o mv2bk.o psupply_mod.o weighttypes_mod.o splinebound_mod.o geometry_mod.o celldiag_mod.o fields_mod.o xg_mod.o beam_mod.o neutcol_mod.o maxwsrce_mod.o basic_mod.o +distrib_mod.o : distrib_mod.f90 ../dependencies/random/random_mod.o constants.o endrun.o : endrun.f90 fields_mod.o beam_mod.o basic_mod.o -endrun__genmod.o : endrun__genmod.f90 energies.o : energies.f90 basic_mod.o fields_mod.o : fields_mod.f90 splinebound_mod.o geometry_mod.o magnet_mod.o particletypes_mod.o mpihelper_mod.o beam_mod.o basic_mod.o constants.o geometry_mod.o : geometry_mod.f90 basic_mod.o weighttypes_mod.o splinebound_mod.o constants.o -get_state__genmod.o : get_state__genmod.f90 -i4_uni__genmod.o : i4_uni__genmod.f90 -ig_get__genmod.o : ig_get__genmod.f90 -ig_memory__genmod.o : ig_memory__genmod.f90 -ig_set__genmod.o : ig_set__genmod.f90 -incomplete_gamma_mod.o : incomplete_gamma_mod.f90 inital.o : inital.f90 splinebound_mod.o neutcol_mod.o geometry_mod.o maxwsrce_mod.o mpihelper_mod.o fields_mod.o beam_mod.o basic_mod.o -inital__genmod.o : inital__genmod.f90 -init_generator__genmod.o : init_generator__genmod.f90 -initialized_get__genmod.o : initialized_get__genmod.f90 -initialized_memory__genmod.o : initialized_memory__genmod.f90 -initialized_set__genmod.o : initialized_set__genmod.f90 -initialize__genmod.o : initialize__genmod.f90 inputvariables_mod.o : inputvariables_mod.f90 -ion_induced_mod.o : ion_induced_mod.f90 incomplete_gamma_mod.o random_mod.o geometry_mod.o materials_mod.o basic_mod.o constants.o particletypes_mod.o -lg_get__genmod.o : lg_get__genmod.f90 -lg_memory__genmod.o : lg_memory__genmod.f90 -lg_set__genmod.o : lg_set__genmod.f90 -magnet_mod.o : magnet_mod.f90 elliptic_mod.o basic_mod.o constants.o +ion_induced_mod.o : ion_induced_mod.f90 ../dependencies/incomplete_gamma/incomplete_gamma_mod.o ../dependencies/random/random_mod.o geometry_mod.o materials_mod.o basic_mod.o constants.o particletypes_mod.o +magnet_mod.o : magnet_mod.f90 ../dependencies/elliptic/elliptic_mod.o basic_mod.o constants.o main.o : main.f90 basic_mod.o materials_mod.o : materials_mod.f90 constants.o maxwsrce_mod.o : maxwsrce_mod.f90 distrib_mod.o beam_mod.o basic_mod.o mpihelper_mod.o constants.o mpihelper_mod.o : mpihelper_mod.f90 particletypes_mod.o constants.o -multmod__genmod.o : multmod__genmod.f90 mv2bk.o : mv2bk.f90 -mv2bk__genmod.o : mv2bk__genmod.f90 -neutcol_mod.o : neutcol_mod.f90 distrib_mod.o random_mod.o beam_mod.o basic_mod.o constants.o +neutcol_mod.o : neutcol_mod.f90 distrib_mod.o ../dependencies/random/random_mod.o beam_mod.o basic_mod.o constants.o newrun.o : newrun.f90 -newrun__genmod.o : newrun__genmod.f90 next_seed3__genmod.o : next_seed3__genmod.f90 next_seed__genmod.o : next_seed__genmod.f90 particletypes_mod.o : particletypes_mod.f90 constants.o psupply_mod.o : psupply_mod.f90 mpihelper_mod.o particletypes_mod.o fields_mod.o weighttypes_mod.o geometry_mod.o basic_mod.o splinebound_mod.o constants.o -r4_uni_01__genmod.o : r4_uni_01__genmod.f90 -r8_uni_01__genmod.o : r8_uni_01__genmod.f90 rand_axc__genmod.o : rand_axc__genmod.f90 rand_batch__genmod.o : rand_batch__genmod.f90 rand_next_seed__genmod.o : rand_next_seed__genmod.f90 random_array__genmod.o : random_array__genmod.f90 random_cosdist__genmod.o : random_cosdist__genmod.f90 random_gauss__genmod.o : random_gauss__genmod.f90 -random__genmod.o : random__genmod.f90 random_init__genmod.o : random_init__genmod.f90 random_isodist__genmod.o : random_isodist__genmod.f90 -random_mod.o : random_mod.f90 random.h random_one__genmod.o : random_one__genmod.f90 -randomone__genmod.o : randomone__genmod.f90 restart.o : restart.f90 -restart__genmod.o : restart__genmod.f90 resume.o : resume.f90 neutcol_mod.o geometry_mod.o maxwsrce_mod.o sort_mod.o fields_mod.o basic_mod.o beam_mod.o -resume__genmod.o : resume__genmod.f90 rnglib.o : rnglib.f90 seed_to_decimal__genmod.o : seed_to_decimal__genmod.f90 -set_initial_seed__genmod.o : set_initial_seed__genmod.f90 set_random_seed__genmod.o : set_random_seed__genmod.f90 -set_seed__genmod.o : set_seed__genmod.f90 -sncndn__genmod.o : sncndn__genmod.f90 sort_mod.o : sort_mod.f90 basic_mod.o constants.o beam_mod.o splinebound_mod.o : splinebound_mod.f90 distrib_mod.o basic_mod.o constants.o srandom_array__genmod.o : srandom_array__genmod.f90 srandom_cosdist__genmod.o : srandom_cosdist__genmod.f90 srandom_gauss__genmod.o : srandom_gauss__genmod.f90 srandom__genmod.o : srandom__genmod.f90 srandom_isodist__genmod.o : srandom_isodist__genmod.f90 -srandom_one__genmod.o : srandom_one__genmod.f90 -srandomone__genmod.o : srandomone__genmod.f90 start.o : start.f90 psupply_mod.o fields_mod.o beam_mod.o neutcol_mod.o geometry_mod.o maxwsrce_mod.o basic_mod.o -start__genmod.o : start__genmod.f90 stepon.o : stepon.f90 beam_mod.o psupply_mod.o sort_mod.o neutcol_mod.o celldiag_mod.o maxwsrce_mod.o fields_mod.o constants.o basic_mod.o -stepon__genmod.o : stepon__genmod.f90 string_to_seed__genmod.o : string_to_seed__genmod.f90 surfsrce_mod.o : surfsrce_mod.f90 distrib_mod.o beam_mod.o basic_mod.o mpihelper_mod.o constants.o tesend.o : tesend.f90 basic_mod.o -tesend__genmod.o : tesend__genmod.f90 -timestamp__genmod.o : timestamp__genmod.f90 weighttypes_mod.o : weighttypes_mod.f90 basic_mod.o splinebound_mod.o constants.o xg_mod.o : xg_mod.f90 fields_mod.o beam_mod.o basic_mod.o constants.o +extra.o : extra.c diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 42e15fb..7ab91b5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,78 +1,83 @@ project(fennecs_src Fortran C) add_executable(fennecs) set(SRCS main.f90 basic_mod.f90 newrun.f90 restart.f90 auxval.f90 inital.f90 resume.f90 start.f90 diagnose.f90 stepon.f90 tesend.f90 endrun.f90 chkrst.f90 mv2bk.f90 constants.f90 fields_mod.f90 beam_mod.f90 mpihelper_mod.f90 sort_mod.f90 distrib_mod.f90 maxwsrce_mod.f90 celldiag_mod.f90 geometry_mod.f90 random_mod.f90 neutcol_mod.f90 particletypes_mod.f90 splinebound_mod.f90 weighttypes_mod.f90 psupply_mod.f90 ion_induced_mod.f90 incomplete_gamma_mod.f90 materials_mod.f90 extra.c random.f randother.f elliptic_mod.f90 magnet_mod.f90 +../dependencies/random/random_mod.f90 +../dependencies/random/random.f +../dependencies/random/randother.f +../dependencies/incomplete_gamma/incomplete_gamma_mod.f90 +../dependencies/elliptic/elliptic_mod.f90 ) target_sources(fennecs PRIVATE ${SRCS}) set_property(SOURCE ${SRCS} APPEND PROPERTY COMPILE_OPTIONS -cpp -fpp -qopenmp ) include_directories(SYSTEM ${MPI_INCLUDE_PATH} ${forSISL_INCLUDE_DIR} ${bsplines_INCLUDES} ${futils_INCLUDES}) if(MKL_Fortran_FLAGS) separate_arguments(MKL_Fortran_FLAGS) target_compile_options(fennecs PUBLIC ${MKL_Fortran_FLAGS}) target_link_options(fennecs PUBLIC ${MKL_Fortran_FLAGS}) endif() add_custom_command(TARGET fennecs POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/fennecs ${CMAKE_CURRENT_BINARY_DIR}/../fennecs) target_include_directories(fennecs PRIVATE $ futils) target_link_libraries(fennecs PUBLIC futils bsplines MPI::MPI_Fortran OpenMP::OpenMP_Fortran ${BLAS_LIBRARIES} ${MUMPS_LIBRARIES} ${LAPACK_LIBRARIES} ${forSISL_LIBRARY} ${sisl_LIBRARY} ${futils_LIBRARY} ${bsplines_LIBRARY} ) diff --git a/src/Makefile b/src/Makefile index 892e0f1..0ffe764 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,125 +1,120 @@ .DEFAULT_GOAL := all ifeq ($(PLATFORM),) $(error Please specify the env variable PLATFORM (mac, intel)) else $(info *** Using $(PLATFORM).mk ***) include $(PLATFORM).mk endif include .depend PROG = fennecs SRCS = main.f90 basic_mod.f90 newrun.f90 restart.f90 \ auxval.f90 inital.f90 resume.f90 start.f90 diagnose.f90 \ stepon.f90 tesend.f90 endrun.f90 chkrst.f90 mv2bk.f90 \ constants.f90 fields_mod.f90 beam_mod.f90 \ mpihelper_mod.f90 sort_mod.f90 distrib_mod.f90 \ maxwsrce_mod.f90 celldiag_mod.f90 geometry_mod.f90 \ - random_mod.f90 neutcol_mod.f90 particletypes_mod.f90 \ + ../dependencies/random/random_mod.f90 neutcol_mod.f90 particletypes_mod.f90 \ splinebound_mod.f90 weighttypes_mod.f90 psupply_mod.f90 \ - ion_induced_mod.f90 materials_mod.f90 incomplete_gamma_mod.f90 \ - magnet_mod.f90 elliptic_mod.f90 + ion_induced_mod.f90 materials_mod.f90 ../dependencies/incomplete_gamma/incomplete_gamma_mod.f90 \ + magnet_mod.f90 ../dependencies/elliptic/elliptic_mod.f90 SRCS_C = extra.c -SRCS_F = random.f randother.f +SRCS_F = ../dependencies/random/random.f ../dependencies/random/randother.f MKDIR_P = mkdir -p OUT_DIR = release F90FLAGS += -I$(BSPLINES)/include -I$(FUTILS)/include \ - -I$(MUMPS)/include -I../ + -I$(MUMPS)/include -I../ -I../dependencies/**/ CCFLAGS += -O3 LDFLAGS += -L$(BSPLINES)/lib -L$(FUTILS)/lib -L${HDF5}/lib -L${HDF5}/lib \ - -L$(MUMPS)/lib -L$(PARMETIS)/lib + -L$(MUMPS)/lib -L$(PARMETIS)/lib -L../dependencies/extlibs/ LIBS += -lbsplines -lpppack -lfutils -lhdf5_fortran -lhdf5 -lz $(MUMPSLIBS) -lpputils2 ifeq ($(USE_X),) F90FLAGS+=-DUSE_X=0 else $(info *** Using Xgrafix ***) LIBS+=-lXGF -lXGC -lX11 -lSWIG LDFLAGS+=-L/usr/local/xgrafix_1.2/src-double F90FLAGS+=-DUSE_X=1 SRCS+=xg_mod.f90 endif OBJS =${SRCS_F:.f=.o} ${SRCS:.f90=.o} ${SRCS_F90:.F90=.o} ${SRCS_C:.c=.o} FPP =${SRCS:.f90=.i90} -OBJS_ =$(addprefix ./$(OUT_DIR)/,$(OBJS)) +#OBJS_ =$(addprefix ./$(OUT_DIR)/,$(OBJS)) debug: F90FLAGS += $(DEBUGFLAGS) debug: OUT_DIR=debug debug: $(OUT_DIR) all profile: F90FLAGS+=$(PROFILEFLAGS) profile: LDFLAGS+= $(PROFILEFLAGS) profile: OUT_DIR=profile profile: $(OUT_DIR) all $(info *** Using $(OBJS) ***) .PHONY: directories clean debug profile all: directories $(PROG) $(PROG): $(OBJS) - $(F90) $(LDFLAGS) $(F90FLAGS) -o $@ $(OBJS_) $(LIBS) + $(F90) $(LDFLAGS) $(F90FLAGS) -o $@ $(OBJS) $(LIBS) tags: etags *.f90 clean: - rm -f $(OBJS_) *.mod $(FPP) + rm -f $(OBJS) *.mod $(FPP) *_genmod* distclean: clean rm -f $(PROG) *~ a.out *.o TAGS extra.o: extra.c ifeq ($(USE_X),) -./$(OUT_DIR)/diagnose.o : diagnose.f90 fields_mod.o beam_mod.o basic_mod.o +diagnose.o : diagnose.f90 fields_mod.o beam_mod.o basic_mod.o else -./$(OUT_DIR)/diagnose.o : diagnose.f90 fields_mod.o xg_mod.o beam_mod.o basic_mod.o +diagnose.o : diagnose.f90 fields_mod.o xg_mod.o beam_mod.o basic_mod.o endif directories: ${OUT_DIR} ${OUT_DIR}: ${MKDIR_P} ${OUT_DIR} .SUFFIXES: $(SUFFIXES) .f .f90 .c -./$(OUT_DIR)/%.o: %.f - ${MKDIR_P} ${OUT_DIR} +%.o: %.f $(F90) $(F90FLAGS) -MD -c -o $@ $< -./$(OUT_DIR)/%.o: %.f90 - ${MKDIR_P} ${OUT_DIR} +%.o: %.f90 $(F90) $(F90FLAGS) -MD -c -o $@ $< -./$(OUT_DIR)/%.o: %.c +%.o: %.c $(CC) $(CCFLAGS) -c -o $@ $< -%.o: %.f - $(F90) $(F90FLAGS) -c -o ./$(OUT_DIR)/$@ $< - -%.o: %.c - $(CC) $(CCFLAGS) -c -o ./$(OUT_DIR)/$@ $< +#%.o: %.f +# $(F90) $(F90FLAGS) -c -o $@ $< -%.o: %.f90 - $(F90) $(F90FLAGS) -c -o ./$(OUT_DIR)/$@ $< +#%.o: %.f90 +# $(F90) $(F90FLAGS) -c -o $@ $< depend .depend .depend_rel .depend_deb : - makedepf90 *.[fF]90 > .depend + makedepf90 ../dependencies/**/*.[fF]90 *.[fF]90 *.c > .depend diff --git a/wk/T-REX/DNP_magnet.txt b/wk/T-REX/DNP_magnet.txt new file mode 100644 index 0000000..aaa51b1 --- /dev/null +++ b/wk/T-REX/DNP_magnet.txt @@ -0,0 +1,14 @@ +! Coils configurations of the 10T DNP magnet +-0.1445 0.1445 0.052592 0.060069 1670 20 10 100.0 +-0.1445 0.1445 0.060069 0.066051 2117 20 10 100.0 +-0.1495 0.1495 0.076919 0.082502 2960 80 80 100.0 +-0.1495 0.1495 0.082502 0.090129 4995 80 80 100.0 +-0.1495 0.1495 0.090129 0.103638 12793 80 80 100.0 +-0.1495 -0.112661 0.103638 0.104187 59 20 10 100.0 +-0.1495 -0.113658 0.104187 0.104735 57 20 10 100.0 +-0.1495 -0.114655 0.104735 0.105283 56 20 10 100.0 +-0.1495 -0.115652 0.105283 0.105832 54 20 10 100.0 + 0.112661 0.1495 0.103638 0.104190 59 20 10 100.0 + 0.113658 0.1495 0.104187 0.104735 57 20 10 100.0 + 0.114655 0.1495 0.104735 0.105283 56 20 10 100.0 + 0.115652 0.1495 0.105283 0.105832 54 20 10 100.0 \ No newline at end of file diff --git a/wk/T-REX/job.in b/wk/T-REX/job.in index 1d0b147..417d73f 100644 --- a/wk/T-REX/job.in +++ b/wk/T-REX/job.in @@ -1,117 +1,123 @@ General input parameters for the FENNECS code ========================================= T.M. Tran SPC/EPFL G. Le Bars SPC/EPFL &BASIC job_time=3600.0, ! FENNECS run time in [s] extra_time=200.0, ! time to save to file and tidy up at the end of the simulatio [s] - nrun=100000, !# of steps + nrun=50, !# of steps nlres=f, ! Resume from existing simulation newres=f, ! Overwrite the result file in resume dt=1E-12 ! Time step in [s] ! Mesh and Poisson parameters femorder=3,3, ! degree of the b-spline polynomia in z and r direction ngauss=6,6, ! number of points for the gauss integration in z and r direction nlppform=.TRUE. ! evaluate the electrostatic potential in ppform instead of spline form - nz=480, ! # of intervals in z - lz=0.3,0.481, ! axial dimensions of the mesh - radii=0, 0.008, 0.019, 0.033,0.038,0.0505 ! Limits of the subregions of mesh in radial direction [m] - nnr=20,60,130,35,40 ! Number of grid cell in r direction for each radii sub-region + nnz=480,55 ! # of intervals in z + lz=0.304,0.481,0.536, ! axial dimensions of the mesh + radii=0, 0.008, 0.019, 0.033,0.038,0.0602 ! Limits of the subregions of mesh in radial direction [m] + nnr=20,60,130,35,80 ! Number of grid cell in r direction for each radii sub-region ! Diagnostic variables nlxg=f, ! Display graphical interface (need compilation with xgrafix) it0d=10, ! # of time steps between each save of scalar variables - it2d=100, ! # of time steps between each save of grid variables + it2d=5, ! # of time steps between each save of grid variables ittext=100, ! # of time steps between each write of the simulation status to standard output itparts=50000,! # of time steps between each save of the particles position and velocity - ittracer=100, ! # of time steps between each save of the particles position and velocity if they have is_test=t + ittracer=1000, ! # of time steps between each save of the particles position and velocity if they have is_test=t itgraph=100, ! # of time steps between each update of the graphical interface nbcelldiag=0, ! # of cells being diagnosed with celldiag (see &celldiagparams) itcelldiag=20,! # of time steps between each save of the cell diagnostics - resfile='result.h5' ! result file filename + resfile='result_mag.h5' ! result file filename rstfile='restart.h5' ! restart file filename containing only the last time-step status ! Particles properties and loading partperiodic=f ! Set periodic boundary conditions in z for the particles nlclassical=t, ! Solve classical equations of motion or relativistic nbspecies=1, ! # of species to load using particle files partfile='electrons_gauss.in','electron_tracers.in','ion_tracers.in', ! Name of the particle files to load distribtype=7 ! Type of distribution function for particle loading ! 1: uniform RZ gaussian in V, 2: stable eq 4.85 from Davidson,... 7: use partfile ! see beam_mod.f90 for more details nplasma=2116800, ! # of particles to load in case of loading with distribtype != 7 n0=-3e17 ! density of plasma in [m-3] in case of loading with distribtype != 7 ! Other modules parameters nlmaxwellsource=t, ! use an ad-hoc source defined in &maxwellparams ! Geometry configuration, combined with &geomparams and &spldomain nlPhis=t, ! if false deactivate calculation of space-charge effects and onsider only external field potinn=-0000, ! potential at inner wall [V] potout=0, ! potential at outer wall [V] ! Magnetic field configuration B0=0.28, ! Normalization variable for magnetic field [T] ! and maximum magnetic field amplitude if bscaling!=0 magnetfile='10T_DNPW.h5' ! .h5 filename of the magnetic field configuration takes precedence over R and ! such a file can be created using matlab/savemagtoh5.m bscaling=0, ! rescaling of the magnetic field amplitude imported from magnetfile ! -1 rescale before evaluation to the grid, 0 no rescaling, 1 rescaling after evaluation to the grid points / &maxwellsourceparams ! see maxwellsrce_mod.f90 for more information frequency=5E11, ! # of macro particles genereated per s [Hz] temperature=22000, ! temperature of the maxwellian source [K] rlimits=0.01,0.027,! radial limits of the source [m] zlimits=0.35,0.4 ! axial limits of the source [m] time_start=-1.0, ! time at which the source starts [s] radialtype=2 ! type of radial distribution time_end=-1.0 ! time at which the source stops [s] / &celldiagparams ! set-up of cell diagnostics specieid=1, ! id of specie to save rindex=112, ! radial index of the cell to save zindex=117, ! axial index of the cell to save / &geomparams ! parameters defining the system geometry in case of analytical Rvachev weight functions ! Type of geometric weight to use negative values use a test source term for Poisson ! to test if the resolution of the grid is sufficient walltype=9 ! 9: use a spline domain defined in &spldomain ! More walltypes are defined in weighttypes_mod.f90 nlweb=t ! use web-splines ( should always be true) testkr=10 ! in case of negative walltype, set the electrostatic test function radial wave vector testkz=10 ! in case of negative walltype, set the electrostatic test function axial wave vector / &spldomain ! set the parameters for a geometry defined from spline curves boundaries dist_extent=5e-3, ! distance to the boundary over which the geometric weight goes to 1 [m] h5fname='exp_outer_with_vessel_geom.h5', ! name of the h5 file containing the geometry ! such a file can be created using matlab/savegeomtoh5.m Dvals=0,-20000,0,0 ! Potential set on the surface of each spline curve [V] / &neutcolparams ! Defines the parameters for collisions with neutrals see neutcol_mod.f90 neutdens=2.5e20, ! density of the neutrals ! Here Neon parameters are used Eion=21.56, ! Ionisation energy of [eV] scatter_fac=24.2, ! parameter defining the energy splitting between scattered and released electrons [eV] ! see Opal 1971 https://doi.org/10.1063/1.1676707 nlcol=t, ! activate the collisions io_cross_sec_file='../Ne_io_cross_sec.in', ! file containing the tables for ionisation cross-sections ela_cross_sec_file='../Ne_ela_cross_sec.in', ! file containing the tables for elastic collision cross-sections for momentum exchange -/ \ No newline at end of file +/ + +&magnetparams +magnetfile='DNP_magnet.txt', +magfiletype=1, +/ + diff --git a/wk/T-REX/run.sh b/wk/T-REX/run.sh index 39968b5..9fa839d 100644 --- a/wk/T-REX/run.sh +++ b/wk/T-REX/run.sh @@ -1,146 +1,150 @@ #!/bin/bash -l #SBATCH --job-name=fennecs #SBATCH --time=1:00:00 #SBATCH -n 1 #SBATCH -c 36 #SBATCH --mem=144G #SBATCH -q serial #module purge #module restore fennecs-jed espicsrc="${HOME}/fennecs/build" espicwk="${HOME}/fennecs/wk" res_folder="/scratch/${USER}/experiment/upper_electrode_ellipse/" mkdir -p $res_folder cat > job.in << EOM General input parameters for the FENNECS code ========================================= T.M. Tran SPC/EPFL G. Le Bars SPC/EPFL &BASIC job_time=3600.0, ! FENNECS run time in [s] extra_time=200.0, ! time to save to file and tidy up at the end of the simulatio [s] nrun=100, !# of steps nlres=f, ! Resume from existing simulation newres=f, ! Overwrite the result file in resume dt=1E-12 ! Time step in [s] ! Mesh and Poisson parameters femorder=3,3, ! degree of the b-spline polynomia in z and r direction ngauss=6,6, ! number of points for the gauss integration in z and r direction nlppform=.TRUE. ! evaluate the electrostatic potential in ppform instead of spline form nz=480, ! # of intervals in z lz=0.3,0.481, ! axial dimensions of the mesh radii=0, 0.008, 0.019, 0.033,0.038,0.0505 ! Limits of the subregions of mesh in radial direction [m] nnr=20,60,130,35,40 ! Number of grid cell in r direction for each radii sub-region ! Diagnostic variables nlxg=f, ! Display graphical interface (need compilation with xgrafix) it0d=10, ! # of time steps between each save of scalar variables it2d=100, ! # of time steps between each save of grid variables ittext=100, ! # of time steps between each write of the simulation status to standard output itparts=50000,! # of time steps between each save of the particles position and velocity ittracer=10, ! # of time steps between each save of the particles position and velocity if they have is_test=t itgraph=100, ! # of time steps between each update of the graphical interface nbcelldiag=0, ! # of cells being diagnosed with celldiag (see &celldiagparams) itcelldiag=20,! # of time steps between each save of the cell diagnostics resfile='${res_folder}resultfast.h5' ! result file filename rstfile='${res_folder}restartfast.h5' ! restart file filename containing only the last time-step status ! Particles properties and loading partperiodic=f ! Set periodic boundary conditions in z for the particles nlclassical=t, ! Solve classical equations of motion or relativistic nbspecies=3, ! # of species to load using particle files partfile='electrons_gauss.in','electron_tracers.in','ion_tracers.in', ! Name of the particle files to load distribtype=7 ! Type of distribution function for particle loading ! 1: uniform RZ gaussian in V, 2: stable eq 4.85 from Davidson,... 7: use partfile ! see beam_mod.f90 for more details nplasma=2116800, ! # of particles to load in case of loading with distribtype != 7 n0=-3e17 ! density of plasma in [m-3] in case of loading with distribtype != 7 ! Other modules parameters nlmaxwellsource=t, ! use an ad-hoc source defined in &maxwellparams ! Geometry configuration, combined with &geomparams and &spldomain nlPhis=t, ! if false deactivate calculation of space-charge effects and onsider only external field potinn=-0000, ! potential at inner wall [V] potout=0, ! potential at outer wall [V] ! Magnetic field configuration B0=0.28, ! Normalization variable for magnetic field [T] ! and maximum magnetic field amplitude if bscaling!=0 magnetfile='10T_DNPW.h5' ! .h5 filename of the magnetic field configuration takes precedence over R and ! such a file can be created using matlab/savemagtoh5.m bscaling=0, ! rescaling of the magnetic field amplitude imported from magnetfile ! -1 rescale before evaluation to the grid, 0 no rescaling, 1 rescaling after evaluation to the grid points / &maxwellsourceparams ! see maxwellsrce_mod.f90 for more information frequency=5E11, ! # of macro particles genereated per s [Hz] temperature=22000, ! temperature of the maxwellian source [K] rlimits=0.01,0.027,! radial limits of the source [m] zlimits=0.35,0.4 ! axial limits of the source [m] time_start=-1.0, ! time at which the source starts [s] radialtype=2 ! type of radial distribution time_end=-1.0 ! time at which the source stops [s] / &celldiagparams ! set-up of cell diagnostics specieid=1, ! id of specie to save rindex=112, ! radial index of the cell to save zindex=117, ! axial index of the cell to save / &geomparams ! parameters defining the system geometry in case of analytical Rvachev weight functions r_a=0.01 r_bLeft=0.02358 alpha=0.1745 z_0=0.375 r_0=0.028 z_r=0.025 r_r=0.005 r_b=0.028 r_bRight=0.0375 above2=-1 above1=1 interior=-1 ! Type of geometric weight to use negative values use a test source term for Poisson ! to test if the resolution of the grid is sufficient walltype=9 ! 9: use a spline domain defined in &spldomain ! More walltypes are defined in weighttypes_mod.f90 nlweb=t ! use web-splines ( should always be true) testkr=10 ! in case of negative walltype, set the electrostatic test function radial wave vector testkz=10 ! in case of negative walltype, set the electrostatic test function axial wave vector / &spldomain ! set the parameters for a geometry defined from spline curves boundaries dist_extent=5e-3, ! distance to the boundary over which the geometric weight goes to 1 [m] h5fname='exp_outer_with_vessel_geom.h5', ! name of the h5 file containing the geometry ! such a file can be created using matlab/savegeomtoh5.m Dvals=0,-20000,0,0 ! Potential set on the surface of each spline curve [V] / &neutcolparams ! Defines the parameters for collisions with neutrals see neutcol_mod.f90 neutdens=2.5e20, ! density of the neutrals ! Here Neon parameters are used Eion=21.56, ! Ionisation energy of [eV] scatter_fac=24.2, ! parameter defining the energy splitting between scattered and released electrons [eV] ! see Opal 1971 https://doi.org/10.1063/1.1676707 nlcol=t, ! activate the collisions io_cross_sec_file='${espicwk}/Ne_io_cross_sec.in', ! file containing the tables for ionisation cross-sections ela_cross_sec_file='${espicwk}/Ne_ela_cross_sec.in', ! file containing the tables for elastic collision cross-sections for momentum exchange / +&magnetparams +magnetfile='DNP_magnet.txt', +magfiletype=1, +/ EOM export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK srun $espicsrc/fennecs job.in