diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-09 14:45:36 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2013-09-09 14:45:36 +0200 |
commit | 4b87d4a37151e0fcdb978a520909b4d2ad154ea9 (patch) | |
tree | a49fe187182c6376adda97c92cb415a7d72807c0 /Tests | |
parent | aa0cbf94406f348a57f0a043425b0c12d2d2ec90 (diff) |
Kranc.mt: Add a test for conservation law calculations
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/Kranc.mt | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Tests/Kranc.mt b/Tests/Kranc.mt index bf13bca..c867e67 100644 --- a/Tests/Kranc.mt +++ b/Tests/Kranc.mt @@ -113,3 +113,53 @@ Test[ , TestID->"SimpleWave" ] + +Test[ + Module[ + {eulerCons, evolvedGroups, nonevolvedGroups, declaredGroups, declaredGroupNames, groups}, + + Map[DefineTensor, {Den, S, En, rho, v, p}]; + + evolvedGroups = Map[CreateGroupFromTensor, {Den, S[uj], En}]; + nonevolvedGroups = Map[CreateGroupFromTensor, {rho, v[uj], p}]; + + declaredGroups = Join[evolvedGroups, nonevolvedGroups]; + declaredGroupNames = Map[First, declaredGroups]; + + groups = declaredGroups; + + eulerCons = + { + Name -> "eulerauto_cons_calc", + Primitives -> {rho, v[ui], p}, + Equations -> + { + flux[Den,ui] -> rho v[ui], + flux[S[uj],ui] -> rho v[ui] v[uj] + p Euc[ui,uj], + flux[En,ui] -> v[ui](En + p) + }, + ConservedEquations -> + { + Den -> rho, + S[ui] -> rho v[ui], + En -> p/(gamma-1) + 1/2 rho v[ui] v[uj] Euc[li,lj] + }, + PrimitiveEquations -> + { + rho -> Den, + v[ui] -> S[ui] / Den, + p -> (gamma-1)(En - 1/2 Euc[li,lj] S[ui] S[uj]/Den) + } + }; + + CreateKrancThornTT[ + groups, "TestThorns", "ConservationCalculation", + Calculations -> {}, + ConservationCalculations -> {eulerCons}, + RealParameters -> {gamma}, + DeclaredGroups -> declaredGroupNames]]; + , + Null + , + TestID->"ConservationCalculation"]; + |