#include #include #include "channelflow/chebyshev.h" #include "channelflow/flowfield.h" #include "channelflow/dns.h" #include "channelflow/utilfuncs.h" using namespace std; using namespace channelflow; int main() { cout << "================================================================\n"; cout << "This program loads from disk a velocity field from a previous \n"; cout << "integrates it with variable time-stepping, and computes some \n"; cout << "statistics." << endl << endl; cout << setprecision(17); // Define flow parameters const Real Reynolds = 100.0; const Real nu = 1.0/Reynolds; // Define integration parameters const Real dtmin = 0.01; const Real dtmax = 0.06; const Real CFLmin = 0.40; const Real CFLmax = 0.60; const Real dT = 1.0; // plot interval const Real T0 = 100.0; // start time const Real T1 = 200.0; // stop time // Load velocity, modified pressure, and base flow from disk. FlowField u("data-couette/u100"); FlowField q(u.Nx(), u.Ny(), u.Nz(), 1, u.Lx(), u.Lz(), u.a(), u.b()); // Get y-domain information from velocity field. Real a = u.a(); Real b = u.b(); int Ny = u.Ny(); // Set integration parameters. DNSFlags flags; flags.baseflow = PlaneCouette; flags.timestepping = SBDF3; flags.initstepping = CNRK2; flags.nonlinearity = Rotational; flags.dealiasing = DealiasXZ; flags.constraint = PressureGradient; // enforce constant pressure gradient flags.dPdx = 0.0; flags.Ubulk = 0.0; // Construct a variable time step object. See below for usage. TimeStep dt((dtmin+dtmax)/2, dtmin, dtmax, dT, CFLmin, CFLmax); // Construct a DNS. DNS dns(u, nu, dt, flags, T0); // Construct Chebyshev expansion for computing mean kx,kz=0,0 Fourier profile ChebyCoeff u00mean(Ny,a,b,Spectral); Real dragmean = 0.0; int count = 0; // Time stepping loop for (Real t=T0; t