Skip to content

Commit

Permalink
Merge pull request #75 from ManuelLerchner/66-sheet-4-task-2-simulati…
Browse files Browse the repository at this point in the history
…on-of-the-rayleigh-tylor-instability

Rayleigh Tylor Instability
  • Loading branch information
TobiasEppacher authored Dec 14, 2023
2 parents cbc2406 + f2ada0e commit 341cf07
Show file tree
Hide file tree
Showing 79 changed files with 3,381 additions and 695 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
run: |
cd build
make -j tests
make -j benchmarks
- name: Upload build artifacts
uses: actions/upload-artifact@v2
Expand Down
54 changes: 35 additions & 19 deletions benchmarks/2DParticleRect/2DParticleRect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include "particles/containers/directsum/DirectSumContainer.h"
#include "particles/containers/linkedcells/LinkedCellsContainer.h"
#include "particles/spawners/cuboid/CuboidSpawner.h"
#include "physics/forces/GravitationalForce.h"
#include "physics/forces/LennardJonesForce.h"
#include "physics/pairwiseforces/GravitationalForce.h"
#include "physics/pairwiseforces/LennardJonesForce.h"
#include "simulation/Simulation.h"
#include "utils/ArrayUtils.h"

Expand All @@ -29,21 +29,34 @@ void execute2DRectBenchmark(int x, int y) {
CuboidSpawner spawner(center_offset - std::array<double, 3>{x * 1.225 / 2, y * 1.225 / 2, 0}, {x, y, 1}, 1.225, 1, {0, 0, 0}, 0);

// Settings for the forces for both simulations
std::vector<std::unique_ptr<ForceSource>> forces;
std::vector<std::unique_ptr<PairwiseForceSource>> forces;
forces.push_back(std::make_unique<LennardJonesForce>());

// ############################################################
// # Direct Sum Container
// ############################################################

std::vector<Particle> particles_ds;
spawner.spawnParticles(particles_ds);

// Instantiation of the Direct Sum Container simulation
SimulationParams params_ds{
"2DParticleRect", "", 0.01, 5, 0, 30, SimulationParams::DirectSumType{}, Thermostat{0, 0, 100000000}, "none"};
std::unique_ptr<ParticleContainer> particle_container_ds = std::make_unique<DirectSumContainer>();
spawner.spawnParticles(particle_container_ds);
Simulation simulation_ds(particle_container_ds, forces, params_ds);
SimulationParams params_ds{"2DParticleRect", "", 0.01, 5, 0, 30, SimulationParams::DirectSumType{}, Thermostat{0, 0}, "none",
{"LennardJones"}, true, true};
params_ds.num_particles = particles_ds.size();

Simulation simulation_ds(particles_ds, params_ds);

// Simulating with Direct Sum Container
Logger::logger->info("Starting simulation using Direct Sum container...");
params_ds.logSummary();
SimulationOverview direct_sum_data = simulation_ds.runSimulationPerfTest();
Logger::logger->info("Finished simulation using Direct Sum container\n");
direct_sum_data.logSummary();

// ############################################################
// # Linked Cells Container
// ############################################################

std::vector<Particle> particles_lc;
spawner.spawnParticles(particles_lc);
// Instantiation of the Linked Cells Container simulation
SimulationParams params_lc{"2DParticleRect",
"",
Expand All @@ -52,18 +65,21 @@ void execute2DRectBenchmark(int x, int y) {
0,
30,
SimulationParams::LinkedCellsType{domain_size, cutoff_radius, boundary_conditions},
Thermostat{0, 0, 100000000},
"none"};
std::unique_ptr<ParticleContainer> particle_container_lc = std::make_unique<LinkedCellsContainer>(domain_size, cutoff_radius);
spawner.spawnParticles(particle_container_lc);
Simulation simulation_lc(particle_container_lc, forces, params_lc);

Thermostat{0, 0},
"none",
{"LennardJones"},
true,
true};
Simulation simulation_lc(particles_lc, params_lc);
// Simulating with Linked Cells Container
Logger::logger->info("Starting simulation using Linked Cells container...");
params_lc.logSummary();
SimulationOverview linked_cells_data = simulation_lc.runSimulationPerfTest();
Logger::logger->info("Finished simulation using Linked Cells container\n");
linked_cells_data.logSummary();

// ############################################################
// # Comparison Logging
// ############################################################

// Final Logging
Logger::logger->info("Simulation of {} particles in a {}x{} grid\n", x * y, x, y);

Logger::logger->info("Direct sum container:");
Expand Down
13 changes: 7 additions & 6 deletions input/body_collision/body_collision_assignment3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@
</boundary_conditions>
</linkedcells_container>
</particle_container>
<force>LennardJones</force>
<thermostat>
<target_temperature>0</target_temperature>
<max_temperature_change>0</max_temperature_change>
<application_interval>10000000</application_interval>
</thermostat>
<forces>
<LennardJones />
</forces>
</settings>


Expand All @@ -57,6 +54,8 @@
<z>0.0</z>
</velocity>
<type>0</type>
<epsilon>1.0</epsilon>
<sigma>1.2</sigma>
</cuboid_spawner>

<cuboid_spawner>
Expand All @@ -79,6 +78,8 @@
<z>0.0</z>
</velocity>
<type>1</type>
<epsilon>1.0</epsilon>
<sigma>1.2</sigma>
</cuboid_spawner>

</particle_source>
Expand Down
9 changes: 3 additions & 6 deletions input/equilibration/multiple_recursive_levels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
</boundary_conditions>
</linkedcells_container>
</particle_container>
<force>LennardJones</force>
<thermostat>
<target_temperature>0</target_temperature>
<max_temperature_change>0</max_temperature_change>
<application_interval>10000000</application_interval>
</thermostat>
<forces>
<LennardJones />
</forces>
</settings>

<particle_source>
Expand Down
11 changes: 5 additions & 6 deletions input/equilibration/subsimulations/bottom_left.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
</boundary_conditions>
</linkedcells_container>
</particle_container>
<force>LennardJones</force>
<thermostat>
<target_temperature>0</target_temperature>
<max_temperature_change>0</max_temperature_change>
<application_interval>10000000</application_interval>
</thermostat>
<forces>
<LennardJones />
</forces>
</settings>

<particle_source>
Expand All @@ -51,6 +48,8 @@
<z>0.0</z>
</velocity>
<type>0</type>
<epsilon>1.0</epsilon>
<sigma>1.2</sigma>
</sphere_spawner>
</particle_source>

Expand Down
11 changes: 5 additions & 6 deletions input/equilibration/subsimulations/bottom_right.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
</boundary_conditions>
</linkedcells_container>
</particle_container>
<force>LennardJones</force>
<thermostat>
<target_temperature>0</target_temperature>
<max_temperature_change>0</max_temperature_change>
<application_interval>10000000</application_interval>
</thermostat>
<forces>
<LennardJones />
</forces>
</settings>

<particle_source>
Expand All @@ -51,6 +48,8 @@
<z>0.0</z>
</velocity>
<type>0</type>
<epsilon>1.0</epsilon>
<sigma>1.2</sigma>
</sphere_spawner>

<sub_simulation>
Expand Down
11 changes: 5 additions & 6 deletions input/equilibration/subsimulations/center_center.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
</boundary_conditions>
</linkedcells_container>
</particle_container>
<force>LennardJones</force>
<thermostat>
<target_temperature>0</target_temperature>
<max_temperature_change>0</max_temperature_change>
<application_interval>10000000</application_interval>
</thermostat>
<forces>
<LennardJones />
</forces>
</settings>

<particle_source>
Expand All @@ -51,6 +48,8 @@
<z>0.0</z>
</velocity>
<type>0</type>
<epsilon>1.0</epsilon>
<sigma>1.2</sigma>
</sphere_spawner>
</particle_source>

Expand Down
12 changes: 6 additions & 6 deletions input/equilibration/subsimulations/right_center.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
</boundary_conditions>
</linkedcells_container>
</particle_container>
<force>LennardJones</force>
<thermostat>
<target_temperature>0</target_temperature>
<max_temperature_change>0</max_temperature_change>
<application_interval>10000000</application_interval>
</thermostat>
<forces>
<LennardJones />
</forces>
</settings>

<particle_source>
Expand All @@ -51,7 +48,10 @@
<z>0.0</z>
</velocity>
<type>0</type>
<epsilon>1.0</epsilon>
<sigma>1.2</sigma>
</sphere_spawner>

<sub_simulation>
<name>
Top Right
Expand Down
11 changes: 5 additions & 6 deletions input/equilibration/subsimulations/top_left.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
</boundary_conditions>
</linkedcells_container>
</particle_container>
<force>LennardJones</force>
<thermostat>
<target_temperature>0</target_temperature>
<max_temperature_change>0</max_temperature_change>
<application_interval>10000000</application_interval>
</thermostat>
<forces>
<LennardJones />
</forces>
</settings>

<particle_source>
Expand All @@ -51,6 +48,8 @@
<z>0.0</z>
</velocity>
<type>0</type>
<epsilon>1.0</epsilon>
<sigma>1.2</sigma>
</sphere_spawner>

<sub_simulation>
Expand Down
11 changes: 5 additions & 6 deletions input/equilibration/subsimulations/top_right.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
</boundary_conditions>
</linkedcells_container>
</particle_container>
<force>LennardJones</force>
<thermostat>
<target_temperature>0</target_temperature>
<max_temperature_change>0</max_temperature_change>
<application_interval>10000000</application_interval>
</thermostat>
<forces>
<LennardJones />
</forces>
</settings>

<particle_source>
Expand All @@ -51,6 +48,8 @@
<z>0.0</z>
</velocity>
<type>0</type>
<epsilon>1.0</epsilon>
<sigma>1.2</sigma>
</sphere_spawner>
</particle_source>

Expand Down
11 changes: 5 additions & 6 deletions input/falling_drop/falling_drop_assignment3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
</boundary_conditions>
</linkedcells_container>
</particle_container>
<force>LennardJones</force>
<thermostat>
<target_temperature>0</target_temperature>
<max_temperature_change>0</max_temperature_change>
<application_interval>10000000</application_interval>
</thermostat>
<forces>
<LennardJones />
</forces>
</settings>

<particle_source>
Expand All @@ -51,6 +48,8 @@
<z>0.0</z>
</velocity>
<type>0</type>
<epsilon>1.0</epsilon>
<sigma>1.2</sigma>
</sphere_spawner>

</particle_source>
Expand Down
26 changes: 12 additions & 14 deletions input/falling_drop/falling_drop_equilibrated.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,33 @@
xsi:noNamespaceSchemaLocation="../simulation_schema.xsd">

<settings>
<fps>24</fps>
<fps>60</fps>
<video_length>30</video_length>
<delta_t>0.005</delta_t>
<end_time>10.0</end_time>
<delta_t>0.0005</delta_t>
<end_time>40</end_time>
<third_dimension>false</third_dimension>
<particle_container>
<linkedcells_container>
<domain_size>
<x>303</x>
<y>180</y>
<z>10</z>
<z>1</z>
</domain_size>
<cutoff_radius>3.0</cutoff_radius>
<boundary_conditions>
<left>Reflective</left>
<right>Reflective</right>
<left>Periodic</left>
<right>Periodic</right>
<bottom>Reflective</bottom>
<top>Reflective</top>
<back>Reflective</back>
<front>Reflective</front>
<back>Outflow</back>
<front>Outflow</front>
</boundary_conditions>
</linkedcells_container>
</particle_container>
<force>LennardJones</force>
<thermostat>
<target_temperature>0</target_temperature>
<max_temperature_change>0</max_temperature_change>
<application_interval>10000000</application_interval>
</thermostat>
<forces>
<LennardJones />
<GlobalDownwardsGravity g="12.44" />
</forces>
</settings>

<particle_source>
Expand Down
Loading

0 comments on commit 341cf07

Please sign in to comment.