if __name__=='__main__': import read import gridmapping import surface import matplotlib.pyplot as plt # select test case fname='../test/h5input/goland_mod_Nsurf01_M003_N004_a040.aero_state.h5' haero=read.h5file(fname) tsdata=haero.ts00000 # select surface and retrieve data ss=0 M,N=tsdata.dimensions[ss] Map=gridmapping.AeroGridMap(M,N) SurfGeo=surface.AeroGridGeo(Map,tsdata.zeta[ss]) # generate geometry data SurfGeo.generate_areas() SurfGeo.generate_normals() #SurfGeo.aM,SurfGeo.aN=0.25,0.75 SurfGeo.generate_collocations() # ---------------------------------------------------------------- Test Wvc zeta_vec=SurfGeo.zeta.reshape(-1,order='C') Wvc_scalar=get_Wvc_scalar(Map) Wvc=get_Wvc_vector(Wvc_scalar) zetac_vec=np.dot(Wvc.T,zeta_vec) zetac=zetac_vec.reshape(Map.shape_pan_vect)
def __init__(self, tsdata, omega=np.zeros((3), )): ''' Initialise rom data structure at time step. omega: rotation speed of the A FoR [rad/s] ''' self.tsdata0 = tsdata self.n_surf = tsdata.n_surf self.dimensions = tsdata.dimensions self.dimensions_star = tsdata.dimensions_star # allocate surfaces self.Surfs = [] self.Surfs_star = [] # allocate size lists - useful for global assembly self.NN = [] self.MM = [] self.KK = [] self.KKzeta = [] self.NN_star = [] self.MM_star = [] self.KK_star = [] self.KKzeta_star = [] for ss in range(self.n_surf): ### Allocate bound surfaces M, N = tsdata.dimensions[ss] Map = gridmapping.AeroGridMap(M, N) Surf = surface.AeroGridSurface(Map, zeta=tsdata.zeta[ss], gamma=tsdata.gamma[ss], u_ext=tsdata.u_ext[ss], zeta_dot=tsdata.zeta_dot[ss], gamma_dot=tsdata.gamma_dot[ss], rho=tsdata.rho, omega=omega) # generate geometry data Surf.generate_areas() Surf.generate_normals() Surf.aM, Surf.aN = 0.5, 0.5 Surf.generate_collocations() self.Surfs.append(Surf) # store size self.MM.append(M) self.NN.append(N) self.KK.append(Map.K) self.KKzeta.append(Map.Kzeta) ### Allocate wake surfaces M, N = tsdata.dimensions_star[ss] Map = gridmapping.AeroGridMap(M, N) Surf = surface.AeroGridSurface(Map, zeta=tsdata.zeta_star[ss], gamma=tsdata.gamma_star[ss], rho=tsdata.rho) self.Surfs_star.append(Surf) # store size self.MM_star.append(M) self.NN_star.append(N) self.KK_star.append(Map.K) self.KKzeta_star.append(Map.Kzeta)