PHASTA/Extract Energy Spectrum

From PHASTA Wiki
Jump to: navigation, search


Run the phasta code with the following in the solver.inp file:

    Use STGinflow BCs: True
    STG SurfID: 411
    STG BL Height: 0.0027
    STG U_0: 75.0
    STG Number of Modes: 405
    STG Mode Growth: 0.01
    STG Mesh Growth: 1.13
    STG Channel: False
    Collect STG Energy Spectrum Data: True
    STG Energy Distance Tolerance: 0.0005 #(allowed position error from the distance from STGinflow (helpful if the spacings are specified from the model and you know the position))
    Energy Spectrum at Distances: 0.0 0.00675 0.0162 #(from defined STGinflow face in +xdir)
  • The third to last line listed here and below matter for gathering points to gather nodes on
  • Try to have a time step a fraction of a cycle of kMax(=approx. 75.0)
    • ex:1/(kMax*U_0*percent_of_rotation), or 1/(75*75*0.05)=0.03))

Configure n-procs_dir

Make vars directory within n-procs_case dir.

mkdir n-procs_case/vars
  • Delete xyzts.dat if from a previous run.
  • If there are additional Probe points you want, create a fresh xyzts.dat file with some header (like 4 1 1 1 1) and those points

(additional functionality may be included later by modifying common/bcSTG.f#236 ex: inputing frequency of data reading (right now at every timestep))

Extracting Ubar

  • As was done to extract a STGInflow.dat file for the IDDES domain from the RANS domain, open the /projects/tools/Models/STG/FlatePlate/RANS_FullPlate/Run/computeVARsforFLATEPLATE.pvsm open the RANS case that you wish to use
  • Create filers on that Case that find the points in xyzts.dat
  • Right-click the "GradientOfUnstructuredDataSet1" and select "Change Input" and select the filter that you just created.
  • File>Save_Data and save as PV-points.csv in the Run above the LES n-procs_case
  • Copy Riccardo's matlab script /projects/tools/Models/STG/FlatPlate/RANS_FullPlate/Run/Prepare_STGInflow3.m to this directory

Creating an energy Spectrum

  • Copy John's matlab scripts to the Run directory
/projects/tools/Models/STG/FlatPlate/STG_Plate/RunNew/John_Load_Varts_Directory.m
/projects/tools/Models/STG/FlatPlate/STG_Plate/RunNew/John_Compute_STG_Eng_Spectrum.m (TODO)

Run the latter. i.e. matlab execute "John_Compute_STG_Eng_Spectrum( N_procs_case_directory,dt,StartTime )" -Output(TODO)