From dc7cecf81291d09f917a97cf601ef199c71cd501 Mon Sep 17 00:00:00 2001 From: michaelschoellhorn Date: Mon, 18 Dec 2023 15:36:02 +0100 Subject: [PATCH 1/2] Re-add dynamic delta t, reduce number of timesteps --- main.cpp | 2 +- plotGrid.py | 5 +---- src/visc.cpp | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/main.cpp b/main.cpp index 0f52078..3d16cbf 100644 --- a/main.cpp +++ b/main.cpp @@ -12,7 +12,7 @@ int main() Mat QThree = loadFromTxt("startingDistributions/2DShocktubeQ3.txt"); viscSimulation A(QOne, QTwox, QTwoy, QThree, 0.01, 0.01, 3.0); //A.print(); - A.update(50); + A.update(20); A.saveTo("data.txt"); } diff --git a/plotGrid.py b/plotGrid.py index d2c8e16..7642444 100644 --- a/plotGrid.py +++ b/plotGrid.py @@ -35,10 +35,7 @@ def plotGrid(twoDArray, colorbarTitle, title, XMax, YMax): Nx, Ny, Nghost, deltaX, deltay, Q1, Q2x, Q2y, Q3 = loadData('Data.txt') -oneDQ1 = Q1[:, 5] -oneDQ2x = Q2x[:, 5] -oneDQ3 = Q3[:, 5] -#plot1D(oneDQ1) + plotGrid(Q1[Nghost:Nx+Nghost, Nghost:Ny+Nghost], r'$\rho$', 'mass density', 4, 4) plotGrid(Q2x[Nghost:Nx+Nghost, Nghost:Ny+Nghost]/Q1[Nghost:Nx+Nghost, Nghost:Ny+Nghost], r'$u_{x}$', 'velocity in x direction', 4, 4) plotGrid(Q2y[Nghost:Nx+Nghost, Nghost:Ny+Nghost]/Q1[Nghost:Nx+Nghost, Nghost:Ny+Nghost], r'$u_{y}$', 'velocity in y direction', 4, 4) diff --git a/src/visc.cpp b/src/visc.cpp index 758daa9..b8c5732 100644 --- a/src/visc.cpp +++ b/src/visc.cpp @@ -27,7 +27,7 @@ void viscSimulation::update(int nSteps) xAdvection(donorCell); py = uPressure(); xSources(py); - // updateDeltaT(px, py); + updateDeltaT(px, py); // print(); } //print(); From 21b12ed1f19c4df0048ee68d315b00a1f1ae695a Mon Sep 17 00:00:00 2001 From: michaelschoellhorn Date: Mon, 18 Dec 2023 15:40:50 +0100 Subject: [PATCH 2/2] Make small addition to ReadMe --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8c1a792..b21a36f 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,5 @@ This code solves the 2D euler equations for arbitrary starting distributions and periodic boundary conditions. It uses a dimensionally split finite volume approach on a fixed grid and solves advection and source terms seperatly. For the advection step one can choose different flux functions implemented in flux.h. The equation used for determining pressure in the source terms can be chosen from pressure.h. + +The simulation itself can be run manually from the main.cpp file, MakeFile support is still to be added. It results in a txt file which then can be visualized via the plotGrid.py script.