CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

modyfing BC externalWallHeatFluxTemperature

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 30, 2015, 06:36
Default modyfing BC externalWallHeatFluxTemperature
  #1
Member
 
Roman
Join Date: Sep 2013
Posts: 81
Rep Power: 12
Roman1 is on a distinguished road
Hello! I am trying to change the boundary condition "externalWallHeatFluxTemperature" in order to make the heat transfer coefficient dependent on U and rho (for the solver fireFoam).
The expression where the heat transfer coefficient h_ is used is
hp = 1.0/(1.0/h_ + totalSolidRes); The type of the other operands is scalar.
At the new BC the heat transfer coefficient h_ must be a function of the U and rho (and other values if needed). To write this function U must be scalar too. One can get U by the next:
const volVectorField& U = db().lookupObject<volVectorField>("U");
scalarField z = mag(U);
But I can not convert the type scalarField to the type scalar. Please help to solve this problem or show other ways of making the heat transfer coefficient dependent on U and rho. There is the BC "convectiveHeatTransfer" but it is only for RAS and I can not find its place in the solver fireFoam.
Thanks
Roman1 is offline   Reply With Quote

Old   January 31, 2015, 11:40
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
A scalar field stores values for each cell. I do not really understand what you want to do, but you probably have to calculate your heat transfer coefficient also for each cell (or probably each wall face).
Have a look e.g. at https://github.com/OpenFOAM/OpenFOAM...arField.C#L155 how a boundary condition can be calculated based on other fields.
jherb is offline   Reply With Quote

Old   February 2, 2015, 05:25
Default
  #3
Member
 
Roman
Join Date: Sep 2013
Posts: 81
Rep Power: 12
Roman1 is on a distinguished road
Hello jherb. Thanks for your answer. As far as I understood
the selected expression serves to derive a new boundary condition.
I tried to write an analog for my case with U:
const volVectorField& U = db().lookupObject<volVectorField>("U");
But the method value() is absent there. I tried max(mag(U)).value().
The type of this expression can be used to derive
a new boundary condition for my case (it seemes to me).
The corrected module is compiled, built and run OK. But I am not
sure about the value of the expression max(mag(U)).value().
Is it calculated for the each cell or for the maximum value of the mag(U)
at the whole domain?

Thanks.
Roman1 is offline   Reply With Quote

Old   February 2, 2015, 17:18
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
I found this definition of max:
https://github.com/OpenFOAM/OpenFOAM...nctions.C#L505
It looks like this is calculating the max value for the whole field (actually automatically reducing the values of all cells on all processors).

But what are you trying anyway?
jherb is offline   Reply With Quote

Old   February 3, 2015, 15:40
Default
  #5
Member
 
Roman
Join Date: Sep 2013
Posts: 81
Rep Power: 12
Roman1 is on a distinguished road
Hello. The code that finally gave the desired result is

const volVectorField& U = db().lookupObject<volVectorField>("U");
volScalarField& magU(mag(U));

scalar z = 0;

forAll(magU, faceI)

129 {
130 label faceCellI = patch().faceCells()[faceI];

131
132 z = magU[faceI]*.....{code};
133 //I think magU[faceI] is for the particular cell, not for the whole field

142 }

Further are operations with scalar z.

It is derived from the code at the file convectiveHeatTransferFvPatchScalarField.C (str.113-142)
but without turbulence. Now I am testing new BC.
Thanks.
Roman1 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 15:23.