Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finishing changes of setup #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
5 changes: 1 addition & 4 deletions plotGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/visc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void viscSimulation::update(int nSteps)
xAdvection(donorCell);
py = uPressure();
xSources(py);
// updateDeltaT(px, py);
updateDeltaT(px, py);
// print();
}
//print();
Expand Down