@@ -333,7 +333,7 @@ void MainWindowSupport::ProcessMonoDisperse(Ui_MainWindow *ui, Parameters *para)
333333 if (mCalc ->CheckIndependentScattering (para, clearanceToWavelength, sizeParameter, volFraction,
334334 criticalWavelength, strRegime, flagVolFrac))
335335 {
336- DisplayScatteringRegimeWarning (clearanceToWavelength, sizeParameter, volFraction, criticalWavelength, strRegime);
336+ PrepareScatteringRegimeWarning (clearanceToWavelength, sizeParameter, volFraction, criticalWavelength, strRegime);
337337 }
338338}
339339
@@ -363,7 +363,7 @@ void MainWindowSupport::ProcessPolyDisperse(Ui_MainWindow *ui, Parameters *para)
363363 if (mCalc ->CheckIndependentScattering (para, clearanceToWavelength, sizeParameter, volFraction,
364364 criticalWavelength, strRegime, flagVolFrac))
365365 {
366- DisplayScatteringRegimeWarning (clearanceToWavelength, sizeParameter, volFraction, criticalWavelength, strRegime);
366+ PrepareScatteringRegimeWarning (clearanceToWavelength, sizeParameter, volFraction, criticalWavelength, strRegime);
367367 }
368368}
369369
@@ -623,42 +623,109 @@ void MainWindowSupport::ReadCustomData(Parameters *para, QString fileName, bool
623623 }
624624}
625625
626- void MainWindowSupport::DisplayScatteringRegimeWarning (double clearanceToWavelength, double sizeParameter,
626+ // Prepare Scattering Regime Warning
627+ void MainWindowSupport::PrepareScatteringRegimeWarning (double clearanceToWavelength, double sizeParameter,
627628 double volFraction, double criticalWavelength,
628629 QString strRegime)
629630{
630- QString strTienDorlen = (clearanceToWavelength > 0.5 )
631- ? " <font color='green'>Independent</font>"
632- : " <font color='red'>Dependent</font>" ;
631+ QString strClearance = QString::number (clearanceToWavelength, ' f' , 3 );
633632
634- QString strGaly = " <font color='red'>Dependent</font>" ;
633+ // Logic, Threshold Strings and Hyperlink for Tien and Drolen
634+ bool isIndependentTien = (clearanceToWavelength > 0.5 );
635+ QString strTienResult = isIndependentTien ?
636+ QString (" <font color='green'>Independent</font> (c/λ=%1)" ).arg (strClearance) :
637+ QString (" <font color='red'>Dependent</font> (c/λ=%1)" ).arg (strClearance);
638+ QString strTienCriteria = " c/λ > 0.5" ;
639+ QString strTienDorlenLink = " <a href='https://doi.org/10.1615/AnnualRevHeatTransfer.v1.30' style='color: #0000EE;'>Tien and Drolen (1987)</a>" ;
635640
641+ // Logic, Threshold Strings and Hyperlink for Galy et al.
642+ bool isIndependentGaly = false ;
643+ QString strGalyCriteria;
644+ QString strGalyLink = " <a href='https://doi.org/10.1016/j.jqsrt.2020.106924' style='color: #0000EE;'>Galy et al. (2020)</a>" ;
645+
646+ if (volFraction <= 0.006 )
647+ {
648+ if (sizeParameter > 0.388 )
649+ {
650+ if (sizeParameter <= 2.0 )
651+ {
652+ isIndependentGaly = (clearanceToWavelength > 2.0 );
653+ strGalyCriteria = " c/λ > 2.0 (0.388 ≤ χ ≤ 2)" ;
654+ }
655+ else
656+ {
657+ isIndependentGaly = (clearanceToWavelength > 5.0 );
658+ strGalyCriteria = " c/λ > 5.0 (χ > 2)" ;
659+ }
660+ }
661+ else
662+ {
663+ isIndependentGaly = true ;
664+ strGalyCriteria = " Independent (χ ≤ 0.388)" ;
665+ }
666+ }
667+ else
668+ {
669+ if (sizeParameter <= 2.0 )
670+ {
671+ isIndependentGaly = (clearanceToWavelength > 2.0 );
672+ strGalyCriteria = " c/λ > 2.0 (χ ≤ 2)" ;
673+ }
674+ else
675+ {
676+ isIndependentGaly = (clearanceToWavelength > 5.0 );
677+ strGalyCriteria = " c/λ > 5.0 (χ > 2)" ;
678+ }
679+ }
680+ QString strGalyResult = isIndependentGaly ?
681+ QString (" <font color='green'>Independent</font> (c/λ=%1)" ).arg (strClearance) :
682+ QString (" <font color='red'>Dependent</font> (c/λ=%1)" ).arg (strClearance);
683+
684+ // --- Detailed Context Section ---
685+ QString strRegimeContext =
686+ " <b>Regime Definitions:</b><br>"
687+ " • Low Concentration Regime:<b> f<sub>v</sub> ≤ 0.006</b><br>"
688+ " • Transitional Regime:<b> 0.006 < f<sub>v</sub> ≤ 0.1</b><br>"
689+ " • High Concentration Regime:<b> f<sub>v</sub> > 0.1</b>" ;
690+
691+
692+ // --- Constructing the Message ---
636693 QString msg = QString (
637- " <b>Dependent Scattering Warning</b><br>"
638- " The current configuration deviates from the independent scattering regime. "
639- " Since MieSimulatorGUI is best suited for dilute mixtures, results at this "
640- " concentration should be interpreted with caution.<br><br>"
641- " <b>Independent or Dependent:</b><br>"
642- " • Per <b>Tien and Drolen (1987):</b> %1<br>"
643- " • Per <b>Galy et al. (2020):</b> %2<br><br>"
644- " <b>Details:</b><br>"
645- " • <b>Regime:</b> %3<br>"
646- " • <b>Volume Fraction:</b> %4<br>"
647- " • <b>Critical Wavelength:</b> %5<br>"
648- " • <b>Size Parameter:</b> %6<br>"
649- " • <b>Clearance/Wavelength Ratio:</b> %7"
694+ " <h3>Dependent Scattering Warning</h3>"
695+ " The current parameters suggest <b>dependent</b> scattering effects in the <b>%1</b>. "
696+ " Results should be interpreted with caution.<br><br>"
697+
698+ " <b>Current Parameters:</b><br>"
699+ " • Volume Fraction (<b>f<sub>v</sub></b>) = <b>%8</b><br>"
700+ " • Size Parameter (<b>χ</b>) = <b>%9</b> at Wavelength (<b>λ</b>) = <b>%11 nm</b><br>"
701+ " • Clearance to Wavelength Ratio (<b>c/λ</b>) = <b>%10</b><br>"
702+
703+ " <table border='1' cellspacing='0' cellpadding='4' style='border-collapse: collapse; width: 100%;'>"
704+ " <tr bgcolor='#f2f2f2'>"
705+ " <td><b>Source</b></td>"
706+ " <td><b>Independence Rules</b></td>"
707+ " <td><b>Assessment</b></td>"
708+ " </tr>"
709+ " <tr><td>%2</td><td>%3</td><td>%4</td></tr>"
710+ " <tr><td>%5</td><td>%6</td><td>%7</td></tr>"
711+ " </table><br><br>"
712+
713+ " %12"
650714 )
651- .arg (strTienDorlen)
652- .arg (strGaly)
653715 .arg (strRegime)
654- .arg (volFraction, 0 , ' g' , 6 )
655- .arg (criticalWavelength, 0 , ' g' , 6 )
656- .arg (sizeParameter, 0 , ' g' , 6 )
657- .arg (clearanceToWavelength, 0 , ' g' , 6 );
716+ .arg (strTienDorlenLink).arg (strTienCriteria).arg (strTienResult)
717+ .arg (strGalyLink).arg (strGalyCriteria).arg (strGalyResult)
718+ .arg (volFraction, 0 , ' g' , 4 )
719+ .arg (sizeParameter, 0 , ' g' , 3 )
720+ .arg (clearanceToWavelength, 0 , ' f' , 3 )
721+ .arg (criticalWavelength, 0 , ' g' , 5 )
722+ .arg (strRegimeContext);
658723
659724 DisplayWarning (msg);
660725}
661726
727+
728+
662729// Display warning message
663730void MainWindowSupport::DisplayWarning (QString warningMessage)
664731{
0 commit comments