Skip to content

Commit

Permalink
Added a unit test for internal energy
Browse files Browse the repository at this point in the history
  • Loading branch information
hamsteri15 committed Jun 14, 2024
1 parent 2cb52e7 commit c3302f7
Show file tree
Hide file tree
Showing 15 changed files with 383 additions and 213 deletions.
4 changes: 2 additions & 2 deletions gpu_chemistry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ thermoType
mixture <SomeMultiComponentMixture>;
transport <SomeTransportType>;
thermo janaf;
energy sensibleEnthalpy;
energy sensibleEnthalpy / sensibleInternalEnergy;
equationOfState perfectGas;
specie specie;
}
```
This solves the energy equation for sensible enthalpy and the transport properties are computed based on any of the available transport models in stock OpenFOAM. Heat capacity is taken from Janaf polynomials and the ideal gas law is assumed for the density.
This solves the energy equation for sensible enthalpy or internal energy and the transport properties are computed based on any of the available transport models in stock OpenFOAM. Heat capacity is taken from Janaf polynomials and the ideal gas law is assumed for the density.


#### Supported ODE solvers
Expand Down
4 changes: 2 additions & 2 deletions gpu_chemistry/benchmark/Benchmark-gpuChemistry.cu
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ TEST_CASE("gpuODESystem"){

using namespace FoamGpu;

auto gpu_thermos = toDeviceVector(makeGpuThermos(mech));
auto gpu_thermos = toDeviceVector(makeGpuThermos_h(mech));
auto gpu_reactions = toDeviceVector(makeGpuReactions(mech));

const gLabel nCells = 1;
Expand Down Expand Up @@ -763,7 +763,7 @@ TEST_CASE("gpuODESolver"){

using namespace FoamGpu;

auto thermos = toDeviceVector(makeGpuThermos(mech));
auto thermos = toDeviceVector(makeGpuThermos_h(mech));
auto reactions = toDeviceVector(makeGpuReactions(mech));

const gLabel nCells = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ enum jacobianType { fast = 0, exact = 1 };

class MockOFSystem : public ODESystem {

const PtrList<FoamThermoType> specieThermos_;
const ReactionList<FoamThermoType> reactions_;
const PtrList<FoamGpu::testThermoType1> specieThermos_;
const ReactionList<FoamGpu::testThermoType1> reactions_;
label nSpecie_;
mutable scalarField Y_;
mutable scalarField c_;
Expand All @@ -27,14 +27,14 @@ class MockOFSystem : public ODESystem {

public:

const ReactionList<FoamThermoType>& getReactions() const
const ReactionList<FoamGpu::testThermoType1>& getReactions() const
{
return reactions_;
}


MockOFSystem(TestData::Mechanism m)
: specieThermos_(TestData::makeCpuThermos(m))
: specieThermos_(TestData::makeCpuThermos_h(m))
, reactions_(TestData::makeSpeciesTable(m),
specieThermos_,
TestData::makeReactionDict(m))
Expand Down
Loading

0 comments on commit c3302f7

Please sign in to comment.