Skip to content

Commit

Permalink
Outgoing direction lambdas are now correctly calculated for new phi r…
Browse files Browse the repository at this point in the history
…anges (0 to 360).
  • Loading branch information
vidanovic committed May 29, 2024
1 parent 2942c00 commit 7551305
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1404,29 +1404,29 @@ TEST_F(MultiPaneBSDF_102_BSDFMaterial_2011_SA1, TestBSDFMatrixAsInput)
double phi = 0;

double tauHem = aLayer.DirHem(minLambda, maxLambda, Side::Front, PropertySimple::T, theta, phi);
EXPECT_NEAR(0.10015962022890315, tauHem, 1e-6);
EXPECT_NEAR(0.1042435801750107, tauHem, 1e-6);

double rhoFrontHem =
aLayer.DirHem(minLambda, maxLambda, Side::Front, PropertySimple::R, theta, phi);
EXPECT_NEAR(0.37427314539272399, rhoFrontHem, 1e-6);
EXPECT_NEAR(0.39444965507057406, rhoFrontHem, 1e-6);

double rhoBackHem =
aLayer.DirHem(minLambda, maxLambda, Side::Back, PropertySimple::R, theta, phi);
EXPECT_NEAR(0.49380289507014985, rhoBackHem, 1e-6);
EXPECT_NEAR(0.52469447798200541, rhoBackHem, 1e-6);

double abs1 = aLayer.Abs(minLambda, maxLambda, Side::Front, 1, theta, phi);
EXPECT_NEAR(0.13078745299641195, abs1, 1e-6);
EXPECT_NEAR(0.13326587636977405, abs1, 1e-6);

double abs2 = aLayer.Abs(minLambda, maxLambda, Side::Front, 2, theta, phi);
EXPECT_NEAR(0.39477978138196002, abs2, 1e-6);
EXPECT_NEAR(0.36804088838464255, abs2, 1e-6);

auto absHeatDirect = aLayer.getAbsorptanceLayersHeat(
minLambda, maxLambda, Side::Front, ScatteringSimple::Direct, 0, 0);
EXPECT_NEAR(0.13078745299641195, absHeatDirect[0], 1e-6);
EXPECT_NEAR(0.39477978138196002, absHeatDirect[1], 1e-6);
EXPECT_NEAR(0.13326587636977405, absHeatDirect[0], 1e-6);
EXPECT_NEAR(0.36804088838464255, absHeatDirect[1], 1e-6);

auto absHeatDiffuse = aLayer.getAbsorptanceLayersHeat(
minLambda, maxLambda, Side::Front, ScatteringSimple::Diffuse, 0, 0);
EXPECT_NEAR(0.13991608585239351, absHeatDiffuse[0], 1e-6);
EXPECT_NEAR(0.33593287500067781, absHeatDiffuse[1], 1e-6);
EXPECT_NEAR(0.14235856875671704, absHeatDiffuse[0], 1e-6);
EXPECT_NEAR(0.30810470981349725, absHeatDiffuse[1], 1e-6);
}
Original file line number Diff line number Diff line change
Expand Up @@ -567,29 +567,29 @@ TEST_F(MultiPaneBSDF_102_XMLLayer_QuarterBasis, TestBSDFMatrixAsInput)
double phi = 0;

double tauHem = aLayer.DirHem(minLambda, maxLambda, Side::Front, PropertySimple::T, theta, phi);
EXPECT_NEAR(0.66204373946763506, tauHem, 1e-6);
EXPECT_NEAR(0.66279795230995919, tauHem, 1e-6);

double rhoFrontHem =
aLayer.DirHem(minLambda, maxLambda, Side::Front, PropertySimple::R, theta, phi);
EXPECT_NEAR(0.08119960555640926, rhoFrontHem, 1e-6);
EXPECT_NEAR(0.081884320055717497, rhoFrontHem, 1e-6);

double rhoBackHem =
aLayer.DirHem(minLambda, maxLambda, Side::Back, PropertySimple::R, theta, phi);
EXPECT_NEAR(0.053146823903719172, rhoBackHem, 1e-6);
EXPECT_NEAR(0.055022523258245352, rhoBackHem, 1e-6);

double abs1 = aLayer.Abs(minLambda, maxLambda, Side::Front, 1, theta, phi);
EXPECT_NEAR(0.092169082644899925, abs1, 1e-6);
EXPECT_NEAR(0.092253211387391024, abs1, 1e-6);

double abs2 = aLayer.Abs(minLambda, maxLambda, Side::Front, 2, theta, phi);
EXPECT_NEAR(0.16458757233105564, abs2, 1e-6);
EXPECT_NEAR(0.163064516246932, abs2, 1e-6);

auto absHeatDirect = aLayer.getAbsorptanceLayersHeat(
minLambda, maxLambda, Side::Front, ScatteringSimple::Direct, 0, 0);
EXPECT_NEAR(0.092169082644899925, absHeatDirect[0], 1e-6);
EXPECT_NEAR(0.16458757233105564, absHeatDirect[1], 1e-6);
EXPECT_NEAR(0.092253211387391024, absHeatDirect[0], 1e-6);
EXPECT_NEAR(0.163064516246932, absHeatDirect[1], 1e-6);

auto absHeatDiffuse = aLayer.getAbsorptanceLayersHeat(
minLambda, maxLambda, Side::Front, ScatteringSimple::Diffuse, 0, 0);
EXPECT_NEAR(0.1023710086958699, absHeatDiffuse[0], 1e-6);
EXPECT_NEAR(0.22180466155163003, absHeatDiffuse[1], 1e-6);
EXPECT_NEAR(0.10245034768455967, absHeatDiffuse[0], 1e-6);
EXPECT_NEAR(0.15614650485534323, absHeatDiffuse[1], 1e-6);
}
Original file line number Diff line number Diff line change
Expand Up @@ -846,20 +846,20 @@ TEST_F(MultiPaneBSDF_BSDFMaterial_Photopic, TestBSDFMatrixAsInput)
double phi = 0;

double tauHem = aLayer.DirHem(minLambda, maxLambda, Side::Front, PropertySimple::T, theta, phi);
EXPECT_NEAR(0.058047803083742695, tauHem, 1e-6);
EXPECT_NEAR(0.059276745102103894, tauHem, 1e-6);

double rhoFrontHem =
aLayer.DirHem(minLambda, maxLambda, Side::Front, PropertySimple::R, theta, phi);
EXPECT_NEAR(0.077271727768527268, rhoFrontHem, 1e-6);
EXPECT_NEAR(0.08213615912054377, rhoFrontHem, 1e-6);

double rhoBackHem =
aLayer.DirHem(minLambda, maxLambda, Side::Back, PropertySimple::R, theta, phi);
EXPECT_NEAR(0.077271727768527268, rhoBackHem, 1e-6);
EXPECT_NEAR(0.08213615912054377, rhoBackHem, 1e-6);

double abs1 = aLayer.Abs(minLambda, maxLambda, Side::Front, 1, theta, phi);
EXPECT_NEAR(0.86468046914773022, abs1, 1e-6);
EXPECT_NEAR(0.85858709577735293, abs1, 1e-6);

auto absHeat1 = aLayer.getAbsorptanceLayersHeat(
minLambda, maxLambda, Side::Front, ScatteringSimple::Diffuse, 0, 0);
EXPECT_NEAR(0.86483944018708581, absHeat1[0], 1e-6);
EXPECT_NEAR(0.8563572220147645, absHeat1[0], 1e-6);
}
2 changes: 1 addition & 1 deletion src/SingleLayerOptics/src/BSDFPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace SingleLayerOptics

double AngleLimits::delta() const
{
return m_High - m_Low;
return m_High > m_Low ? m_High - m_Low : m_High + (360 - m_Low);
}

bool AngleLimits::isInLimits(const double t_Angle) const
Expand Down

0 comments on commit 7551305

Please sign in to comment.