Skip to content
Snippets Groups Projects
Commit 322a1627 authored by Andreas Weissenbrunner's avatar Andreas Weissenbrunner
Browse files

added a script that plots profiles for the paper

parent aa221258
No related branches found
No related tags found
No related merge requests found
...@@ -34,4 +34,4 @@ def get_fully_SA(r): ...@@ -34,4 +34,4 @@ def get_fully_SA(r):
# plt.plot(r_fully_o,u_fully_o) # plt.plot(r_fully_o,u_fully_o)
# plt.plot(r,f_fully(r)) # plt.plot(r,f_fully(r))
return np.nan_to_num(f_fully(r)) return np.nan_to_num(f_fully(r))
# -------------------------------------------------------------- # --------------------------------------------------------------
\ No newline at end of file
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 17 18:09:39 2023
@author: weisse02
plot 2D profiles for paper
"""
#
import wx
import matplotlib
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.figure import Figure
import matplotlib.colors as mcolors
import numpy as np
from matplotlib.ticker import MaxNLocator
import os
import scipy.interpolate as interpol
import matplotlib.pyplot as plt
import json
from math import pi
import sys
#
sys.path.append('./HelpingFunctions')
sys.path.append('./FlowProfiles')
sys.path.append('./')
from FlowMeter import FlowMeter
from Flow_class import Elbow_profile
#sys.path.append('../../FlowProfiles')
# import gh-class from global directory
#from class_flowprofiles import flowprofiles
#sys.path.append('E:/NextCloud/GlobalPyFunc/')
from niceplot import *
#from Integrate2D import Tri_Int
#from get_fully_SA import get_fully_SA
#from GetElbowProfile import GetElbowProfile
#import Integrate2D
import Integrate2D as int2d
# python debugger
import pandas as pd
# sys.path.append('E:/NextCloud/GlobalPyFunc/')
def get_fully_SA(r):
# --------------------------------------------------------------
R = 0.1/2
uvol = 0.4
# get fully developed flow profile from Spalart-Allmaras Simulation
fullyfile = os.path.abspath("./HelpingFunctions/ProfileLine_SA.csv")
fullydata = pd.read_csv(fullyfile)
fullydata = fullydata.rename(columns={"U:0": "U_0", "U:1": "U_1" , "U:2": "U_2","Points:0": "x","Points:1": "y","Points:2": "z"})
u_fully_o = fullydata.U_2 / uvol
r_fully_o = fullydata.y /R
#r_fully_o = np.append(r_fully_o, 1)
#print(r_fully_o)
#u_fully_o[-1] = 0
# a function that can be evaluated at any r by (linear) interpolation
#f_fully = interpol.interp1d(r_fully_o,u_fully_o,fill_value=0)
#print(u_fully_o)
f_fully = interpol.Akima1DInterpolator(r_fully_o,u_fully_o)
#f_fully = np.nan_to_num(f_fully)
# plt.figure()
# plt.plot(r_fully_o,u_fully_o)
# plt.plot(r,f_fully(r))
return np.nan_to_num(f_fully(r))
# --------------------------------------------------------------
flow = Elbow_profile('Double_S_Elbow')
ufully = get_fully_SA(flow.r.ravel())
Rks = [0.51,1.67375,3.38375]
rk = 1.17604257
dls = [0,5,10]
dist = 6
for dl in dls:
u = flow.get_profile(Rk=rk,dl=dl,dist=dist,addfully=False)
u = u.reshape(3,-1)
u[2] += ufully
nicecontour(flow.x,flow.y,u,minval=0.48,maxval=1.13,scalefac=0.3)
plt.tight_layout()
plt.savefig("C:/Users/weisse02/PTBbox/VirtMet/Auswertung_paper/Profile_plots/" + flow.case + "_rk_" + str(rk) + "_dist_" + str(dist) + "_dl_" + str(dl) + ".pdf")
\ No newline at end of file
...@@ -6,7 +6,7 @@ Created on Tue Feb 28 14:09:14 2023 ...@@ -6,7 +6,7 @@ Created on Tue Feb 28 14:09:14 2023
""" """
from Flow_class import * from Flow_class import *
import matplotlib.pyplot as plt
MEDIUM_SIZE = 20 MEDIUM_SIZE = 20
plt.rc('font', size=MEDIUM_SIZE) # controls default text sizes plt.rc('font', size=MEDIUM_SIZE) # controls default text sizes
...@@ -18,7 +18,7 @@ plt.rc('legend', fontsize=MEDIUM_SIZE) # legend fontsize ...@@ -18,7 +18,7 @@ plt.rc('legend', fontsize=MEDIUM_SIZE) # legend fontsize
plt.rc('figure', titlesize=MEDIUM_SIZE) plt.rc('figure', titlesize=MEDIUM_SIZE)
savepath = "C:/Users/weisse02/PTBbox/VirtMet/Auswertung_paper/Mode_Plots/Coeffs_plot/" savepath = "C:/Users/weisse02/PTBbox/VirtMet/Auswertung_paper/Mode_Plots/Coeffs_plot/"
case = "Double_S_Elbow" case = "DoubleElbow"
coeffs,modes,umean = loadPODres(case) coeffs,modes,umean = loadPODres(case)
flow = Elbow_profile(case) flow = Elbow_profile(case)
...@@ -29,19 +29,20 @@ dldist,distdl = np.meshgrid(flow.dl,flow.dist,indexing="ij") ...@@ -29,19 +29,20 @@ dldist,distdl = np.meshgrid(flow.dl,flow.dist,indexing="ij")
# plot over rk, dist # plot over rk, dist
nicecontour(rkdist.ravel(),distrk.ravel(),coeffs[:,0,:,0].ravel(),polar=False,equalsize =False) nicecontour(rkdist.ravel(),distrk.ravel(),coeffs[:,0,:,0].ravel(),polar=False,equalsize =False)
plt.xlabel("Rc in D") plt.xlabel("$R_c$ in $D$")
plt.ylabel("Distance z in D") plt.ylabel("$z$ in $D$")
plt.tight_layout() plt.tight_layout()
plt.savefig(savepath + case + "_M0_rcdist.pdf") plt.savefig(savepath + case + "_M0_rcdist.pdf")
nicecontour(rkdl.ravel(),dlrk.ravel(),coeffs[:,:,0,0].ravel(),polar=False,equalsize =False) nicecontour(rkdl.ravel(),dlrk.ravel(),coeffs[:,:,10,0].ravel(),polar=False,equalsize =False)
plt.xlabel("Rc in D") plt.xlabel("$R_c$ in $D$")
plt.ylabel("dl in D") plt.ylabel("$d_l$ in $D$")
plt.tight_layout() plt.tight_layout()
plt.savefig(savepath + case + "_M0_rcdl_dist0.pdf") plt.savefig(savepath + case + "_M0_rcdl_dist0.pdf")
nicecontour(dldist.ravel(),distdl.ravel(),coeffs[0,:,:,0].ravel(),polar=False,equalsize =False) nicecontour(dldist.ravel(),distdl.ravel(),coeffs[0,:,:,0].ravel(),polar=False,equalsize =False)
plt.xlabel("Rc in D") plt.xlabel("$d_l$ in $D$")
plt.ylabel("dl in D") plt.ylabel("$z$ in $D$")
plt.tight_layout() plt.tight_layout()
plt.savefig(savepath + case + "_M0_dldist_rk0.pdf") plt.savefig(savepath + case + "_M0_dldist_rk0.pdf")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment