View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001369 | OpenFOAM | Bug | public | 2014-08-07 14:16 | 2014-12-29 11:09 |
Reporter | Assigned To | henry | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | any | ||||
Summary | 0001369: turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs(): refValue can become negative | ||||
Description | In turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() a field alpha is computed as KDeltaNbr - (Qr + QrNbr)/Tp, which can become negative, if Qr is large, and results in a negative refValue later. This is passed to a thermo.He() function as a temperature in enthalpy based solver, leading to a crash. (Or to nonsensical calculations of enthalpy as function of temperature). I propose to include the radiative contribution in the refGrad instead, as refGrad=(Qr+QrNbr)/kappa. I did this and my case where I ran into this problem is working fine now. | ||||
Tags | No tags attached. | ||||
|
I forgot to mention: The trouble really arises with temperature dependent heat capacities ... |
|
Could you provide a simple case for testing? Thanks Sergio |
|
Might take a week because I wont be here but I will try to set up a case based on the tutorial files. |
|
Found an easy way to reproduce this: I am using OpenFoam 2.2.x, but as far as I see it should be the same with 2.3. 1.) Take tutorial case multiRegionHeaterRadiation 2.) change constant/heater/thermophysicalProperties to this: thermoType { type heSolidThermo; mixture pureMixture; //transport constIso; transport polynomial; //thermo hConst; thermo hPolynomial; equationOfState rhoConst; specie specie; energy sensibleEnthalpy; } mixture { specie { nMoles 1; molWeight 12; } transport { //kappa 80; kappaCoeffs<8> (80 0 0 0 0 0 0 0); } thermodynamics { Hf 0; Sf 0.; // Cp 450; CpCoeffs<8> (200 0.6 0 0 0 0 0 0); } equationOfState { rho 8000; } } 3.) change the boundary condition in 0/heater/T for minY from fixedValue 300 to fixedValue 1500 4.) run chtMultiRegionSimpleFoam and at t=374 this will (hopefully :) happen: --> FOAM FATAL ERROR: Maximum number of iterations exceeded From function thermo<Thermo, Type>::T(scalar f, scalar T0, scalar (thermo<Thermo, Type>::*F)(const scalar) const, scalar (thermo<Thermo, Type>::*dFdT)(const scalar) const, scalar (thermo<Thermo, Type>::*limit)(const scalar) const) const 5.) change in updateCoeffs() to: valueFraction() = KDeltaNbr/(KDeltaNbr+KDelta); refValue() = TcNbr; refGrad() = (Qr+QrNbr)/kappa(*this); run again, for me it works, then. |
|
To be a little more precise: I think here Tw.refValue() should really evaluate to a temperature, not some effective value, because it is passed to the thermo to calculate the enthalpy: void Foam::mixedEnergyFvPatchScalarField::updateCoeffs() { if (updated()) { return; } const basicThermo& thermo = basicThermo::lookupThermo(*this); const label patchi = patch().index(); const scalarField& pw = thermo.p().boundaryField()[patchi]; mixedFvPatchScalarField& Tw = refCast<mixedFvPatchScalarField> ( const_cast<fvPatchScalarField&>(thermo.T().boundaryField()[patchi]) ); Tw.evaluate(); valueFraction() = Tw.valueFraction(); refValue() = thermo.he(pw, Tw.refValue(), patchi); refGrad() = thermo.Cpv(pw, Tw, patchi)*Tw.refGrad() + patch().deltaCoeffs()* ( thermo.he(pw, Tw, patchi) - thermo.he(pw, Tw, patch().faceCells()) ); mixedFvPatchScalarField::updateCoeffs(); } |
|
Thanks for the bug-report and analysis of the problem. I have now studied the issue carefully and reproduced the problem in OpenFOAM-2.3.x based on your suggestion but I had to significantly increase the heater temperature to cause a crash. As you suggest there are two actually two issues, one relating to a potential failure if Qr+QrNbr causes the reference temperature to become negative and the second relating to the local-linearization used in the T->h->T boundary condition conversions which requires the reference temperature to be close to the boundary temperature in the case of non-linear properties. Both of these issues are resolved by your suggested fix: valueFraction() = KDeltaNbr/(KDeltaNbr+KDelta); refValue() = TcNbr; refGrad() = (Qr+QrNbr)/kappa(*this); which I have applied to OpenFOAM-2.3.x and OpenFOAM-dev. Resolved by commit a01b5bb4a064656d07825359784fa34424c2b894 |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-08-07 14:16 |
|
New Issue | |
2014-08-08 12:33 |
|
Note Added: 0003199 | |
2014-08-11 09:23 |
|
Note Added: 0003201 | |
2014-08-11 11:06 |
|
Note Added: 0003202 | |
2014-08-13 14:29 |
|
Note Added: 0003203 | |
2014-08-26 12:14 |
|
Note Added: 0003220 | |
2014-12-29 11:09 | henry | Note Added: 0003375 | |
2014-12-29 11:09 | henry | Status | new => resolved |
2014-12-29 11:09 | henry | Resolution | open => fixed |
2014-12-29 11:09 | henry | Assigned To | => henry |