Skip to content

Commit

Permalink
mudança no caso paralelo comp_F
Browse files Browse the repository at this point in the history
  • Loading branch information
g7fernandes committed Jun 17, 2019
1 parent 22e5152 commit 5595556
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 332 deletions.
1 change: 0 additions & 1 deletion csv2vtk_particles.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
rs = np.array(rs)
sigma = np.array(sigma)
rs = rs + sigma*(2**(1/6))

a = os.listdir('temp')
no_out_files = nimpre
if len(a)/2 < nimpre:
Expand Down
323 changes: 78 additions & 245 deletions lennard.f90

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mod0.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module mod0
real(dp) :: sigma
real(dp) :: rs !raio sólido
real(dp) :: x_lockdelay ! só vai poder mudar de posição a partir de t = x_lockdelay
real(dp) :: fric_term
end type prop_grupo

! LSTR lista de transferência pro MPI
Expand Down
106 changes: 20 additions & 86 deletions settings.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
# PARAMETROS GLOBAIS
[global]
nimpre = 150 # quntidade de saidas
N = 1940 # número de partículas
N = 540 # número de partículas
Ntype = 3 # número de tipos de partícula
t_fim = 600 # tempo de execução
dt = 0.00001 # passo de tempo
t_fim = 500 # tempo de execução
dt = 0.0001 # passo de tempo
dimX = 1200 # Dimensões da região de cálculo
dimY = 400 #
mesh = 158 52 # malha(elementos)
dimY = 600 #
mesh = 150 52 # malha(elementos)
rcut = 2.5 # *sigma
wall = 'eeee' # condição Elastica ou Periodica nas paredes norte, sul, leste, oeste
Td = -1 # 2.897189213660259e+24 #temperatura desejada global constante (-1 = não aplicar) kb = 1.38064852E-23, Td = (2/(3*kb))*E
temp_Td = 0 600 100 # Tempo de velocity scaling [inicial, final, iterações_por_scaling]
cold_cells = 1 5 1 18 # [cellx_ini, cellx_fin, celly_ini, celly_fin]
hot_cells = 69 74 1 18 # [cellx_ini, cellx_fin, celly_ini, celly_fin]
temp_Td = 0 1000 100 # Tempo de velocity scaling [inicial, final, iterações_por_scaling]
cold_cells = 1 5 1 52 # [cellx_ini, cellx_fin, celly_ini, celly_fin]
hot_cells = 145 150 1 52 # [cellx_ini, cellx_fin, celly_ini, celly_fin]
Td_hot = 100e+23 # temperatura nas cold cells constante. Td_hot = -1 desliga termostato
Td_cold = 10e+23 # temperatura nas hot cells constante. Td_cold = -1 desliga termostato
vd = 1 1 # velocidade distribuida com Maxwell Boltzmann
fric_term = 0 # fricção artifical
NMPT = 1000 # Número máximo de partículas que poderá mudar de process. Se não souber estimar, usar -1 ou o valor de N.
vd = 0.1 0.1 # velocidade distribuida com Maxwell Boltzmann
NMPT = 500 # Número máximo de partículas que poderá mudar de process. Se não souber estimar, usar -1 ou o valor de N.
GField = 0 0 # Campo de força gravitacional que afeta todas as partículas

# PARTICLE PROPERTIES
[par_0]
x = 'grupo0.csv'
Expand All @@ -29,93 +27,29 @@
nome = 'g1'
sigma = 1 # Lennard Jones
epsilon = 1 # Lennard Jones
quantidade = 1900
quantidade = 500
x_lockdelay = 0 # só vai poder mudar de posição a partir de t = x_lockdelay
rs = 0 # raio sólido. Posição de partículas na superfície de um sólido de raio rs

fric_term = 0 # fricção artifical
[par_1]
x = 'p_g.csv'
v = 0 -100
x = 'p_p.csv'
v = 0 0
m = 20
nome = 'g2'
nome = 'g3'
sigma = 1 # Lennard Jones
epsilon = 1 # Lennard Jones
quantidade = 20
x_lockdelay = 200 # só vai poder mudar de posição a partir de t = x_lockdelay
rs = 5

fric_term = 0 # fricção artifical
[par_2]
x = 'p_p.csv'
v = 0 100
x = 'p_g.csv'
v = 0 0
m = 20
nome = 'g3'
nome = 'g2'
sigma = 1 # Lennard Jones
epsilon = 1 # Lennard Jones
quantidade = 20
x_lockdelay = 200 # só vai poder mudar de posição a partir de t = x_lockdelay
rs = 5

# Sobre NMPT. Pode-se estimar dividindo o tamanho da fronteira do domínio do processo por 2.5^(1/6) ou pelo raio. E multiplicar por
# um fator.

#[par_1]
# x = 'grupo2.csv'
# v = 0 0
# m = 1
# nome = 'g2'
# quantidade = 2
# sigma = 1 # Leonard Jones
# epsilon = 5 # Leonard Jones
#
#[par_2]
# x = 'grupo7.csv'
# v = -10 10
# m = 1
# nome = 'g3'
# quantidade = 8
#
#[par_3]
# x = 'grupo8.csv'
# v = 0 0
# m = 1
# nome = 'g4'
# quantidade = 8
#
#[par_0]
# x = 'grupo0.csv'
# v = 30 5
# m = 1
# nome = 'g1'
# quantidade = 2
# sigma = 1 # Leonard Jones
# epsilon = 5 # Leonard Jones

#nimpre = 150 # quantidade de saidas
#N = 1600 # número de partículas
#Ntype = 1 # número de tipos de partícula
#t_fim = 1 # tempo de execução
#dt = 0.00005 # passo de tempo
#dimX = 250 # Dimensões da região de cálculo
#dimY = 250 #
#mesh = 1 1 # malha(elementos)
#sigma = 1 # Leonard Jones
#epsilon = 5 # Leonard Jones
#rcut = 2.5 # *sigma
#wall = 'eeee' # condição Elastica ou Periodica nas paredes norte, sul, leste, oeste
#Td = -1
#fric_term = 0
#
#[par_0]
# x = 'grupo1.csv'
# v = 0 -10
# m = 1
# nome = 'g1'
# quantidade = 1600
#
#[par_1]
# x = 'grupo2.csv'
# v = 0 0
# m = 1
# nome = 'g2'
# quantidade = 6400

fric_term = 0 # fricção artifical
2 changes: 2 additions & 0 deletions velocity_and_distribution_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

subspaces = float(input("Enter in how many subspaces the region of calculus will be divided.\nThe \
subspaces should contain particles enough for the statistic.\n"))

print("The velocity and distribution of the particles will be calculated in one direction.\n")
#direction = input("Enter the direction x or y\n")
print('x-direction\n')
Expand Down Expand Up @@ -53,6 +54,7 @@
mean_Kenergy = (1/2)*velocity_map**2/concentration_map
mean_Kenergy[mean_Kenergy == np.inf] = 0
mean_Kenergy = np.nan_to_num(mean_Kenergy)

fig, ax1 = plt.subplots()
ax1.plot(np.linspace(0,dimx,subspaces),mean_Kenergy,'b')
ax1.set_xlabel("x - direction")
Expand Down
10 changes: 10 additions & 0 deletions verify_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
change = False
aux = True
config = configparser.ConfigParser()
config.optionxform=str

while (aux):
try:
Expand Down Expand Up @@ -69,6 +70,15 @@
print("Evtk module not found! You will not be able to convert the .CSV files to .VTU. Try:\n")
print("conda install -c e3sm evtk OR\npip install pyevtk")

with open('settings.ini','r') as file:
data = file.readlines()

for line in range(len(data)):
if data[line][0] != "[" and data[line][0] != "#" and data[line][0] != " ":
data[line] = '\t' + data[line]

with open('settings.ini','w') as file:
file.writelines(data)



Expand Down

0 comments on commit 5595556

Please sign in to comment.