Beispiel #1
0
from matplotlib import rc
import matplotlib.pyplot as plt
# import pandas as pd
import numpy as np

from read_data import ReadClass

plt.style.use('ggplot')
rc('text', usetex=True)
rc('font', family='serif')
figure_dir = './figure/'

setting_name = "setting"
beta = -19.56

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)
aspect = reader.read_aspect_ratio(ssh_flag=True)

free_energy = np.zeros(aspect.size)
for i in range(aspect.size):
    free_energy[i] = reader.set_free_energy(aspect=aspect[i], beta=beta)
enstrophy_constant = reader.set_enstrophy_constant(aspect=aspect[0], beta=beta)

exp_E = reader.read_exp_E(beta=beta)
exp_F = np.exp(-beta * (free_energy[:] - free_energy[0]) / enstrophy_constant)
e_array = exp_E - exp_F
import matplotlib.pyplot as plt
import pandas as pd
# import numpy as np

from read_data import ReadClass

plt.style.use('ggplot')
rc('text', usetex=True)
rc('font', family='serif')
figure_dir = './figure/'

setting_name = "setting"
xlim = [0, 200]
ylim = [0.44, 0.48]

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)

budget = reader.read_budget(number_time=420, ssh_flag=False)
columns = [
    'T', 'E', 'E-first', 'E-diag', 'E-lower', 'E-upper', 'Q2', 'Q2-first',
    'Q2-diag', 'Q2-lower', 'Q2-upper', 'PE'
]
df = pd.DataFrame(data=budget, columns=columns)
df = df.set_index('T')

for col in df.columns.tolist():
    df = df.rename(columns={col: reader.long_name(col)})
# -*- coding: utf-8 -*-
#
from matplotlib import rc
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np

from read_data import ReadClass

rc('text', usetex=True)
rc('font', family='serif')

setting_name = "setting"
figure_dir = './figure/'

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)

K_axis, L_axis = reader.set_axis()

c_level = 64

for time in range(0, 11):
    it = time * reader.interval_write_variable
    str_it = '{0:04d}'.format(it)
    spec = reader.read_E_ave(it)

    energy_all = np.sum(spec)
# -*- coding: utf-8 -*-
#
from matplotlib import rc
import matplotlib.pyplot as plt
import numpy as np

from read_data import ReadClass

plt.style.use('ggplot')
rc('text', usetex=True)
rc('font', family='serif')
figure_dir = './figure/'

setting_name = "setting"

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)
aspect = reader.read_aspect_ratio(ssh_flag=True)
beta = reader.beta
N = (reader.NK_truncate - 1) * (reader.NL_truncate - 1)

free_energy = np.zeros(aspect.size)
for i in range(aspect.size):
    free_energy[i] = reader.set_free_energy(aspect=aspect[i], beta=beta)
# enstrophy_constant = reader.set_enstrophy_constant(aspect=aspect[0],
#                                                    beta=beta)

exp_E = reader.read_exp_E(beta=beta, number_time=750, ssh_flag=False)
import matplotlib.pyplot as plt
import pandas as pd
# import numpy as np

from read_data import ReadClass

plt.style.use('ggplot')
rc('text', usetex=True)
rc('font', family='serif')
figure_dir = './figure/'

setting_name = "setting_2"
xlim = [0, 200]
ylim = [0.003, 0.0035]

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)

budget = reader.read_budget()
columns = [
    'T', 'E', 'E-diag', 'E-lower', 'E-upper', 'Q2', 'Q2-diag', 'Q2-lower',
    'Q2-upper', 'PE'
]
df = pd.DataFrame(data=budget, columns=columns)
df = df.set_index('T')

for col in df.columns.tolist():
    df = df.rename(columns={col: reader.long_name(col)})
Beispiel #6
0
import matplotlib.pyplot as plt
import pandas as pd
# import numpy as np

from read_data import ReadClass

plt.style.use('ggplot')
rc('text', usetex=True)
rc('font', family='serif')
figure_dir = './figure/'

setting_name = "setting_3"
xlim = [0, 200]
ylim = [0.0028, 0.003]

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)

budget = reader.read_budget(number_time=118, ssh_flag=True)
columns = ['T', 'E', 'E-diag', 'E-lower', 'E-upper',
           'Q2', 'Q2-diag', 'Q2-lower', 'Q2-upper', 'PE']
df = pd.DataFrame(data=budget, columns=columns)
df = df.set_index('T')

for col in df.columns.tolist():
    df = df.rename(columns={col: reader.long_name(col)})

df.plot(y=[reader.long_name('E')],
import matplotlib.pyplot as plt
import pandas as pd
# import numpy as np

from read_data import ReadClass

plt.style.use('ggplot')
rc('text', usetex=True)
rc('font', family='serif')
figure_dir = './figure/'

setting_name = "setting"
xlim = [0, 200]
ylim = [1, 1.1]

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)

budget = reader.read_budget(number_time=420, ssh_flag=True)
columns = [
    'T', 'E', 'E-first', 'E-diag', 'E-lower', 'E-upper', 'Q2', 'Q2-first',
    'Q2-diag', 'Q2-lower', 'Q2-upper', 'PE'
]
df = pd.DataFrame(data=budget, columns=columns)
df = df.set_index('T')

for col in df.columns.tolist():
    df = df.rename(columns={col: reader.long_name(col)})
Beispiel #8
0
#
from matplotlib import rc
import matplotlib.pyplot as plt
# import pandas as pd
import numpy as np

from read_data import ReadClass

plt.style.use('ggplot')
rc('text', usetex=True)
rc('font', family='serif')
figure_dir = './figure/'

setting_name = "setting"

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)
aspect = reader.read_aspect_ratio(ssh_flag=True)
beta = reader.beta

work = reader.read_work(beta=beta, number_time=201, ssh_flag=False)
work_mean = work.mean(axis=1)

time = np.zeros(work.shape)
process = np.arange(work.shape[1])
for i in range(time.shape[0]):
    time[i, :] = i * reader.time_write
import matplotlib.pyplot as plt
# import pandas as pd
import numpy as np

from read_data import ReadClass

plt.style.use('ggplot')
rc('text', usetex=True)
rc('font', family='serif')
figure_dir = './figure/'

setting_name = "setting_3"
# xlim = [0, 200]
# ylim = [0.0028, 0.003]

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)
aspect = reader.read_aspect_ratio(ssh_flag=True)
beta = reader.beta

work = reader.read_work(beta=beta, number_time=125, ssh_flag=False)
work_mean = work.mean(axis=1)

free_energy = np.zeros(aspect.size)
RDT_work = np.zeros(aspect.size)
for i in range(aspect.size):
    free_energy[i] = reader.set_free_energy(aspect=aspect[i], beta=beta)
    RDT_work[i] = reader.set_RDT_work(aspect_0=aspect[0], aspect=aspect[i],
from matplotlib import rc
import matplotlib.pyplot as plt
# import pandas as pd
import numpy as np

from read_data import ReadClass

plt.style.use('ggplot')
rc('text', usetex=True)
rc('font', family='serif')
figure_dir = './figure/'

setting_name = "setting"
beta = -19.56

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)
aspect = reader.read_aspect_ratio(ssh_flag=True)

N = (reader.NL_truncate-1) * (reader.NK_truncate-1)

energy = np.zeros(aspect.size)
Q2 = np.zeros([reader.NL_truncate, reader.NK_truncate, reader.N_process])
for j in range(reader.N_process):
    Q2[:, :, j] = reader.read_real(it=0, ip=j, var_name="Q")**2
    print('j =', j)

# t = 0
Beispiel #11
0
#
from matplotlib import rc
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
from scipy import fftpack

from read_data import ReadClass

rc('text', usetex=True)
rc('font', family='serif')

setting_name = "setting"
figure_dir = './figure/'

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)
aspect = reader.read_aspect_ratio(ssh_flag=True)

X, Y = reader.set_XY_axis()
K0, L0 = reader.set_axis()
K, L = np.meshgrid(K0, L0)

c_level = 64
var_dict = {'E': 'Energy spectrum', 'P': 'Stream function', 'Q': 'Vorticity'}

var = 'P'
# print(X, Y)
rc('text', usetex=True)
rc('font', family='serif')

Fr_str = '04'
# setting_name = "setting_Fr" + Fr_str
setting_name = "setting_restart_Fr" + Fr_str
# setting_name = "setting_restart"
figure_dir = './figure_Fr' + Fr_str + '/'
# setting_name = "setting"

# setting_name = "setting_Dossmann_Pr1_Re40000_restart"
# figure_dir = './figure_Dossmann_Pr1_Re40000/'
# setting_name = "setting_Dossmann_Pr1_Re40000"
# figure_dir = './figure_Dossmann_Pr1_Re40000/'

reader = ReadClass()
remote_data = reader.data_PID(setting_name)
reader.set_ssh(remote_data=remote_data)
reader.read_setting(setting_name)
reader.read_file_number(ssh_flag=True)

K_axis = np.linspace(0.0, reader.N_truncate, reader.N_truncate + 1)
M_axis = np.linspace(0.0, reader.N_truncate, reader.N_truncate + 1)
K, M = np.meshgrid(K_axis, M_axis)

# line of sigma = omega / 2
M_dispersion = K_axis[:]  \
    * np.sqrt(reader.buoyancy_frequency**2 - reader.wave_frequency**2)  \
    / reader.wave_frequency
M_dispersion_2 = K_axis[:]  \
    * np.sqrt(4 * reader.buoyancy_frequency**2 - reader.wave_frequency**2)  \