Giter VIP home page Giter VIP logo

dnspod's Introduction

dnspod: direct diagnosis of diapycnal mixing from direct numerical simulations

Can limited observations recover irreversible turbulent fluxes? A test case using DNS.

xref: Kaminski & Smyth (2018), JFM

Questions

  1. How well do we do at recovering the net change in background potential energy through irreversible mixing when sampling a fully resolved turbulence field like the χpod?
  2. How does agreement depend on sampling parameters viz. wave pumping amplitude / frequency?
  3. Does sorting and using the Winters & D’Asaro (1996) formulation get us closer to the true value than time averaging a la Osborn (1980)

Output Organization

  1. root directory : dnspod/
  2. scripts : dnspod/scripts/
  3. model output : dnspod/slices/simulation_name/
    1. bpe/ , means/: Individual .mat files for each model output file
    2. bpe.mat, means.mat: Combined bpe, means structures.
  4. Sampled output : dnspod/slices/simulation_name/samples/sample_name/
    1. sample_xx.mat: one per output .mat file.
    2. merged.mat: combined sample_xx.mat
  5. images : dnspod/images/

Code variables

Useful output variables / terminology

layerShear layer parameters (dimensional)
sampNon-dimensionalized sampling parameters
pump_z : pumping amplitude
pump_period : pumping period
uback : constant background flow
trajTrajectory in non-dimensional space
used to sample griddedInterpolant output
sampleFields sampled along trajectory traj
wdaStructure with inferred turbulent parameters.
Tbins : bin edges (nbins, time)
Tcen : center of bins (nbins-1, time)
Jq, Kt, eps, chi : turbulent parameters (time)
T_Jq : mean(Tcen * Jq) : J_q weighted mean temp.
Jmat : 2D Jq matrix (Tcen, time)
tmat : time matrix to go with Jmat (Tcen, time)
no_min_dz : 1 if there was not enough pumping, else 0 (time)
zsort : Sorted z-heights for bin edges, starting at 0 (Tbins, time)
dz : estimate separation between isotherms Tbins (Tcen, time)
dz_true : true separation between isotherms Tbins (Tcen, time)
dz_rmse : sqrt(nanmean((dz_true-dz).^2)) RMSE in estimated dz

Code organization

General

masterExample of processing simulation output
process_outputProcesses DNS output. Requires layer and samp structures
Also merges bpe and means to individual files.
Calls sample_single_file in parfor loop.
process_sampled_fieldActually does the Winters & D’Asaro estimate for a run.
Requires directory and “chunk” length dt.
Calls winters_dasaro_avg for pre-processing and
process_wda_estimate to get turbulence parameters.

Processing

Higher-level wrappers

sample_single_filesmall wrapper so that parfor works :/
calls sample_along_trajectory
sample_along_trajectoryActually does all the work.
Constructs griddedInterpolant, builds
trajectory and samples.

Core processing

This is more complicated/modular than it needs to be because I copied stuff over from chipod_gust/ so that we are doing the same thing in both places.

process_wda_estimateGiven a χpod time-series with requisite stuff
(bins etc.), estimate K_T and J_q^t.
winters_dasaro_avgbins time-series + and gets all data necessary
to actually make the estimate
isoscalar_average
generate_wda_bins
thorpeSort

Analysis

calc_buoyancy_budgetEstimate terms in buoyancy budget.
calculate_buoyancy_between_boundsEstimate mean buoyancy between two isosurfaces
get_buoy_rangeReturns a range of isosurfaces between which
we might expect to get good agreement
get_turb_time_rangeGiven sample, returns a time range that is
mostly “pure turbulence”. Currently hardcoded.
test_internal_wave_pumpingAttempt to account for internal wave
contamination. Abandoned.

Plotting

plot_buoyancy_budgetPlot terms in buoyancy budget.
plot_estimateGiven wda or sample structure, make plot
of all quantities.
plot_jq2D scatter plot of wda.Jmat

dnspod's People

Contributors

akkaminski avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.