|
[Sponsors] |
BC externalWallHeatFluxTemperature understanding problem |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 30, 2018, 09:17 |
BC externalWallHeatFluxTemperature understanding problem
|
#1 |
Member
Join Date: Oct 2018
Location: France
Posts: 34
Rep Power: 8 |
I'm currently trying to create a custom boundary condition based on "externalWallHeatFluxTemperature". In course of the changing I found some lines I don't understand and I hope that somebody can clarify them to me.
As I understood it, with the original BC one can choose between three modes ("Q" = total heat transferred in W, "q" = heat flux in W/m^2, "h" = convection by defining a HTC and an "ambient" temperature). To be able to create a consistent output which can be processed in each mode three values are generated: 1) refGrad in K/m ... the temperature gradient for the calculations in the modes "Q" and "q" (taking into account the radiative heat) 2) refValue in K ... a calculated temperature to take into account radiation for the mode "h" 3) valueFraction (dimensionless) ... the ratio of an overall HTC for convection & radiation and an overall HTC for convection, radiation & conduction These three values are necessary for the calculation (via mixedFvPatchScalarField). However, in "externalWallHeatFluxTemperature.C" (https://www.openfoam.com/documentati...8C_source.html) the lines 426 - 429 show the following calculation: Code:
const scalarField kappaDeltaCoeffs ( this->kappa(Tp)*patch().deltaCoeffs() ); When calculating the valueFraction in the lines 440 and 445 respectively, the code reads Code:
valueFraction()[i] = hpmqr/(hpmqr + kappaDeltaCoeffs[i]); valueFraction()[i] = hp[i]/(hp[i] + kappaDeltaCoeffs[i]); In the valueFraction the ratio of the "combined" HTCs is calculated which doesn't seem to be consistent wrt to their units. It would make much more sense to me calculate them like this: In "mixedFvPatchField.C" (https://www.openfoam.com/documentati...8C_source.html) the lines 174 -178 show the function used in "externalWallHeatFluxTemperature.C" (snGrad): Code:
return valueFraction_ *(refValue_ - this->patchInternalField()) *this->patch().deltaCoeffs() + (1.0 - valueFraction_)*refGrad_; For the mode "h": Although it think it should be something like which in the end differs by a factor (if I didn't make a mistake). I don't know if I don't read the codes correctly or if I make a conceptual mistake in my considerations/thoughts. Does anybody have an idea why the calculations and definitions (especially of valueFraction) are made like that? stockzahn |
|
October 31, 2018, 05:52 |
|
#2 |
Member
Join Date: Oct 2018
Location: France
Posts: 34
Rep Power: 8 |
One more question: Until now I couldn't find how the updated coefficients
- refGrad - refValue - valueFraction are processed to "realize" the boundary condition. Does anybody know where this values are used to calculate the values at the boundaries? stockzahn |
|
November 1, 2018, 12:49 |
|
#3 | |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Quote:
mesh.surfaceInterpolation::deltaCoeffs() |
||
November 2, 2018, 03:38 |
|
#4 |
Member
Join Date: Oct 2018
Location: France
Posts: 34
Rep Power: 8 |
||
November 2, 2018, 08:02 |
|
#5 | |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Quote:
above fields are used in void Foam::mixedFvPatchField<Type>::evaluate(const Pstream::commsTypes) there is also a thread here updateCoeffs() and evaluate() where it is discussed. The explanation where in the solution process it is used is provided here: https://www.openfoam.com/documentati...onditions.html |
||
November 2, 2018, 12:32 |
|
#6 |
Member
Join Date: Oct 2018
Location: France
Posts: 34
Rep Power: 8 |
Thank you very much again for the hints, have a nice weekend,
stockzahn |
|
November 2, 2018, 15:30 |
|
#7 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 21 |
To summarize the main idea behind this. We begin in the .H file which starts like this:
Code:
class externalWallHeatFluxTemperatureFvPatchScalarField : public mixedFvPatchScalarField, public temperatureCoupledBase { refValue() =... refGrad() =... valueFraction() =... And afterwards call the updateCoeffs function of the mixed boundary itself: mixedFvPatchScalarField::updateCoeffs(); Which now sets the patch value. As shown here: https://www.openfoam.com/documentati...bcs-mixed.html This means all we need to do is set those three values to something meaningful. E.g: Code:
..... case fixedPower: { refGrad() = (Q_/gSum(patch().magSf()) + qr)/kappa(Tp); refValue() = 0; valueFraction() = 0; break; } .... mixedFvPatchScalarField::updateCoeffs(); |
|
Tags |
externalwallheatflux, openfoam bc |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with interFoam; Wave/wiggle alpha1 behavior | JonW | OpenFOAM | 10 | February 4, 2023 08:27 |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Gambit - meshing over airfoil wrapping (?) problem | JFDC | FLUENT | 1 | July 11, 2011 06:59 |
Problem in implementing cht | tilek | CFX | 3 | May 8, 2011 09:39 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |