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

Multi-Species Codes and Tests #273

Open
wants to merge 316 commits into
base: master
Choose a base branch
from

Conversation

Liki-RM
Copy link
Contributor

@Liki-RM Liki-RM commented Dec 19, 2024

Summary
This pull request introduces a multi-species solver for inviscid flows (Euler equations). It supports both calorically imperfect and perfect gas models and can handle up to 4 species in 1D, 3 species in 2D, and 2 species in 3D computations. Tests are included to verify and validate the implementation against various cases.

Features
Multi-Species Solver

  • Supported Physics:
    • Inviscid (Euler equations) only.
    • Both calorically imperfect and perfect gas models.
  • State Vector :
    • n_state (number of elements in state vector):
      • Formula: n_state = (dim + 2) + (n_species - 1).
      • Maximum n_state: 6.
      • Supported configurations:
        • Up to 4 species in 1D.
        • Up to 3 species in 2D.
        • Up to 2 species in 3D.
  • Calorically Imperfect Model Details:
    • Species thermal properties are computed using NASA CAP coefficients (heat capacities, molecular weight, etc.).
    • Requires NameOfSpecies.txt and NameOfSpecies.kinetics files:
      • Located in tests/multispecies/InitialMixtureFiles and tests/multispecies/ReactionFiles.
      • Must be copied to the directory where tests are run.

Implementation Details
New Files

  1. real_gas.cpp
    • Multi-species flow computations using the calorically imperfect model.
    • Convective fluxes computed from conservative solutions.
  2. multi_species_calorically_perfect_euler.cpp
    • Multi-species flow computations using the calorically perfect model.
    • Convective fluxes computed from conservative solutions.
  3. inviscid_real_gas.cpp
    • Mono-species flow computations using the calorically imperfect model.
    • Convective fluxes computed from conservative solutions.

Tests Added

  • [Verifivcation] 1D and 2D multi-species vortex advection (low and high temperatures).
  • [Validation] 2D multi-species isentropic Euler vortex advection.
  • [Validation] 2D multi-species fuel droplet advection.
  • [Demonstration] 3D Taylor Green vortex.

Some tests failed; these are already reported in GitHub and unrelated to the changes introduced in this PR.
TestLog.txt
Details of the algorithms, physics, equations, and results are summarized in Liki's Master's thesis.

Liki-RM and others added 30 commits November 30, 2023 16:54
… AllRealGasConstants so they can be accessed as an object
…iscid_real_gas.cpp now except for file reading)
it passed compile but segmentation fault when running
…ative solutions of initial condition to prevent errors
…es using if statements, mono-species inviscid real gas test has verified)
it works without problems (1D, calorically perfect, 2-species)
(they are moved to multi_species directory)
it means that the multi-species code can compute the test cases under the following conditions;
1D... up to 4-species
2D... up to 3-species
3D... up to 2-species
test cases
it is a 2-species test (uniform density and air composition)
it is a 2-species test (uniform mixture density)
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
38.6% Duplication on New Code (required ≤ 3%)
B Maintainability Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should be somewhere else

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file should be somewhere else

@@ -10,7 +10,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
set(MPIMAX 4 CACHE STRING "Default number of processors used in ctest mpirun -np MPIMAX. Not the same as ctest -jX")


#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -g")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -g")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was this needed for?

Comment on lines +45 to +52
} else if (pde_type == PDE_enum::real_gas) {
// TO DO: will need to modify the nstate; i suggest adding it as a compile time constant; eg PHiLiP_2D_10species then nstate=(nspecies-1)+dim+2
// TO DO: modify this when you change number of species
return std::make_shared< DGWeak<dim,dim+2+2-1,real,MeshType> >(parameters_input, degree, max_degree_input, grid_degree_input, triangulation_input); // TO DO: N_SPECIES
} else if (pde_type == PDE_enum::multi_species_calorically_perfect_euler) {
// TO DO: will need to modify the nstate; i suggest adding it as a compile time constant; eg PHiLiP_2D_10species then nstate=(nspecies-1)+dim+2
// TO DO: modify this when you change number of species
return std::make_shared< DGWeak<dim,dim+2+2-1,real,MeshType> >(parameters_input, degree, max_degree_input, grid_degree_input, triangulation_input); // TO DO: N_SPECIES
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for other changes in this file

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when reviewing your own PR, go over once more so that unnecessary small changes like this are not included; makes the review much easier and avoids merge conflicts later one

@@ -51,4 +51,4 @@ foreach(dim RANGE 1 3)
unset(InitialConditionsLib)
unset(PODLib)
unset(MeshAdaptationLib)
endforeach()
endforeach()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert small changes like this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean up the comments or address the TO DO; I'm seeing this in other files too

Comment on lines 73 to +74
pcout << "Finished integration test with run error code: " << run_error << std::endl;
}
}
Copy link
Collaborator

@jbrillon jbrillon Dec 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert all unnecessary changes like this

Copy link
Collaborator

@jbrillon jbrillon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do another self-review on the PR; also resolve all the outstanding merge conflicts by merging the latest version of master with this branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants