Skip to content
Snippets Groups Projects
Commit 4a73ae99 authored by Anna Mareike Kostelecky's avatar Anna Mareike Kostelecky Committed by Timo Koch
Browse files

Resolve "Rename Parameter "GrainFouriersLaw.UseAdaptedVolumeForPyramid""

parent 9acfbfa7
No related branches found
No related tags found
1 merge request!3671[dualnetwork] Rename Parameter "GrainFouriersLaw.UseAdaptedVolumeForPyramid" to "GrainFouriersLaw.UseVolumeEqualPyramid"
......@@ -50,6 +50,9 @@ struct TruncatedPyramidGrainFouriersLaw
auto getPyramidBaseLengthFromVolume = [&](const Scalar v, const Scalar h)
{
// Using the formula for the volume of a pyramid frustum to calculate its base length:
// v = 1/3 h * (a^2 + a*b + b^2), where a is the base side length, b the top side length,
// h the height and v the volume of the frustum.
const Scalar b = topSideLength;
using std::sqrt;
return 0.5*sqrt(3.0) * sqrt(-(b*b*h-4.0*v)/h) -0.5*b;
......@@ -58,7 +61,7 @@ struct TruncatedPyramidGrainFouriersLaw
// the pyramid base length of the inside pore
const Scalar insideBaseSideLength = [&]()
{
static const bool useAdaptedVolume = getParamFromGroup<bool>(problem.paramGroup(), "GrainFouriersLaw.UseAdaptedVolumeForPyramid", false);
static const bool useAdaptedVolume = getParamFromGroup<bool>(problem.paramGroup(), "Problem.UseVolumeEqualPyramid", false);
if (useAdaptedVolume)
return getPyramidBaseLengthFromVolume(0.5*insideVolVars.poreVolume(), insideHeight);
......@@ -69,7 +72,7 @@ struct TruncatedPyramidGrainFouriersLaw
// the pyramid base length of the outside pore
const Scalar outsideBaseSideLength = [&]()
{
static const bool useAdaptedVolume = getParamFromGroup<bool>(problem.paramGroup(), "GrainFouriersLaw.UseAdaptedVolumeForPyramid", false);
static const bool useAdaptedVolume = getParamFromGroup<bool>(problem.paramGroup(), "Problem.UseVolumeEqualPyramid", false);
if (useAdaptedVolume)
return getPyramidBaseLengthFromVolume(0.5*outsideVolVars.poreVolume(), outsideHeight);
......
......@@ -103,6 +103,9 @@ struct FluidOrGrainPyramidFouriersLaw
static const bool realVolume = getParamFromGroup<bool>(problem.paramGroup(), "Problem.UseVolumeEqualPyramid", true);
if (realVolume)
{
// Using the formula for the volume of a pyramid frustum to calculate its base length and base area:
// v = 1/3 h * (a^2 + a*b + b^2), where a is the base side length, b the top side length,
// h the height and v the volume of the frustum .
using std::sqrt;
const Scalar vol = 0.5 * volVars.poreVolume();
const Scalar baseLenTop = sqrt(pyramidFrustumTopArea);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment