Skip to content
Snippets Groups Projects

VirtFlow_GUI

To use just start GUI_Elbow.py in a python3 environment. Required python packages: Numpy, Scipy, json, wx, matplotlib

Functionality

A User Interface, which enables the inspection of velocity profiles downstream of a single elbow, double elbow out-of-plane, and double-S-elbow, with parameter variation of:

  • curvature radius (between 0.51 to 10 times the diameter (D) for the single elbow, and 0.51 to 5.51 for the other cases)
  • downstream distances (from 0 to 100 D)
  • Reynolds numbers (from 5e4 to 1e6)
  • pipe wall roughness (from 0 to ?? ks/D)
  • angular path (from -180 to 180)

Ultrasonic flow meters can be evaluated at the moment only for diametral paths with any number of reflections Uncertainties can be evaluated for a specific parameter set and the given input uncertainties. The output is shown in the terminal.

ToDo:

  • Ultrasonic non-diagonal paths therefore interpolation of the modes is necessary
  • Electro-Magnetic flow meters
  • deletion of unused functions

Code Structure

In the file GUI_Elbow.py the user interface is defined. In the file Flow_class.py the class Elbow_profile is defined, which can also be used outside the user interface. An instance of this class need to be initialized with a case name "SingleElbow", "DoubleElbow", "Double_S_Elbow", the POD modes and coefficients for the specific case are loaded during initialization. For example: casename = "DoubleElbow" flow = Elbow_profile(casename) A flow profile can be accessed with the method get_profile(Rk,dl,dist,x=None,y=None,addfully = False,asmat = True). e.g.: u = flow.get_profile(Rk = 1.3,dl=0.2,dist=10,addfully = True) It returns the velocity profile of u_x, u_y and u_z (u_z = axial velocity) as a numpy array of the size (3, Nphi, Nr), which is in the current version (3, 81, 41). x and y are just dummies and are not used. It will always return the velocity profile at the coordinates stored in the variables flow.r flow.phi or flow.xm, flow.ym as matrixes (81,41), flwo.x and flow.y are flat arrays of size 81*41. The function to calculate a POD is defined in the function do_POD, and the reconstruction of a profile do_reconstruct for a profile at a cross section, and do_reconstruct_path along a diametral path. with the method get_pathint integrals along ultrasonc paths will be calculated, this is be done for all parameters of a case. As one input an instance of the FlowMeter class must be provided. The FlowMeter class is defined in FlowMeter.py, it only contains information about the flow meter type. By now only ultrasonic flow meter with diametral paths with arbitrary number of reflections and any axial angle 0 < alpha < 90 degree. If the button "Eval Flow Meter" is clicked, an instance of the flow meter class with the selected parameter types is generated and it is checked whether the values of this exact type of flow meter was saved beforehand in the folder "FlowMeters/casename/" with the file name flow meter type _ Variation _ number of reflections _ alpha e.g. an ultrasonic V-path (number of reflections = 1) flow meter with axial angle alpha = 30 degree is saved according to FlowMeters/"DoubleElbow"/Ultrasonic_diametral_1_30.npz Is the correct flow meter file is not found the evaluation of the flow meter will be calculated for all parameters and the loaded case. After the calculation the flow meter values are saved in the folder as explained above. The calculation needs, depending on the performance of the computer, 10 to 30 minutes to be calculated for the double elbow cases.

Collection

The underlying data for the GUI is generated by CFD simulations. This simulations were automatically performed. In order to repead the simulations or produce additional data, the scripts which generate the simulation setup (geometry, grid, boundary conditions), start the simulation runs, as well as export the data and perform the POD are stored in the folder simulation runs.