这个问题解决了,主要是因为OpenFOAM在solarCalculator.C中有出纰漏
修改如下并编译就好了,可以模拟在useExternalBeam下给定太阳辐射值(随时间变化)的效果
void Foam::solarCalculator::correctSunDirection()
{
if (sunDirectionModel_ == mSunDirTracking)
{
calculateBetaTheta();
calculateSunDirection();
//directSolarRad_ = A_/exp(B_/sin(max(beta_, ROOTVSMALL)));
if (sunLoadModel_ == mSunLoadTimeDependent)
{
directSolarRad_ = directSolarRads_->value(mesh_.time().value());
}
else if (sunLoadModel_ == mSunLoadFairWeatherConditions)
{
directSolarRad_ = A_/exp(B_/sin(max(beta_, ROOTVSMALL)));
}
}
}
void Foam::solarCalculator::correctDirectSolarRad()
{
if (sunLoadModel_ == mSunLoadTimeDependent)
{
directSolarRad_ = directSolarRads_->value(mesh_.time().value());
}
else if (sunLoadModel_ == mSunLoadFairWeatherConditions)
{
directSolarRad_ = A_/exp(B_/sin(max(beta_, ROOTVSMALL)));
}
}