Skip to content
Snippets Groups Projects
Commit 647e1615 authored by sergio's avatar sergio
Browse files

BUG: Fixing sign of qr in externalWallHeatFluxTemperature

1) The sign of radiative flux (qr) for modes Power and HeatFlux was
corrected.

2) Relaxation factor implementation was incomplete. Now caching
valueFraction and refValue from  the previous time step.
parent 5425de66
Branches
Tags
No related merge requests found
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -360,6 +360,9 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
const scalarField& Tp(*this);
const scalarField valueFraction0(valueFraction());
const scalarField refValue0(refValue());
scalarField qr(Tp.size(), Zero);
if (qrName_ != "none")
{
......@@ -375,7 +378,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
{
case fixedPower:
{
refGrad() = (Q_/gSum(patch().magSf()) + qr)/kappa(Tp);
refGrad() = (Q_/gSum(patch().magSf()) - qr)/kappa(Tp);
refValue() = 0;
valueFraction() = 0;
......@@ -383,7 +386,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
}
case fixedHeatFlux:
{
refGrad() = (q_ + qr)/kappa(Tp);
refGrad() = (q_ - qr)/kappa(Tp);
refValue() = 0;
valueFraction() = 0;
......@@ -459,8 +462,9 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
}
}
valueFraction() = relaxation_*valueFraction() + (1 - relaxation_);
refValue() = relaxation_*refValue() + (1 - relaxation_)*Tp;
valueFraction() =
relaxation_*valueFraction() + (1 - relaxation_)*valueFraction0;
refValue() = relaxation_*refValue() + (1 - relaxation_)*refValue0;
mixedFvPatchScalarField::updateCoeffs();
......
  • Hi!

    Can I ask why is it q_-qr instead of q_+qr? I think it was correct. Let's create an adiabatic patch, thus q_ = 0. In this case the heat flux is qr (you "put back" the radiative flux) Then calculate the resulted wall heat flux: It will be qr, since you prescribed it with the BC, and substract the radiative flux which is also qr, thus the heat flux is zero, which is expected since you made an adiabatic wall.

    If you use q_-qr, you will end up with a heat flux of -2*qr. Maybe I'm wrong somewhere so feel free to correct me.

    Thanks!

    • Hi,

      Same question as Simon. I also have the impression that the signs were correct. When we apply this 'fix', our simulations start to show nonphysical results which disappear when we turn of radiation. Can you re-evaluate this commit?

      Thanks!

    • Please register or sign in to reply
  • Hi!

    It is corrected in commit 712512d4

    Edited by Regő Simon
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment