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

Bug in turbulentHeatFluxTemperatureFvPatchScalarField; OF 1.6.x

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 1, 2010, 09:40
Default Bug in turbulentHeatFluxTemperatureFvPatchScalarField; OF 1.6.x
  #1
New Member
 
Oleksiy Kurenkov
Join Date: Mar 2009
Location: Nueremberg
Posts: 16
Rep Power: 17
evrikon is on a distinguished road
Send a message via Skype™ to evrikon
Hi forum,

in OpenFoam 1.6.x the boundary condition which represents a constant heat flux through the boundary does not work for incompressible cases like buoyantBoussinesqSimpleFoam. To see the bug please have a look into

/src/turbulenceModels/incompressible/turbulentHeatFluxTemperatureFvPatchScalarField.C
:line 160

You can see:
const scalarField& Cpp =
patch().lookupPatchField<volScalarField, scalar>(CpName_);

This is not correct because an incompressible solver does not have any information about Cp.
-----------------------------------------
Here is my bugfix:

void turbulentHeatFluxTemperatureFvPatchScalarField::up dateCoeffs()
{
if (updated())
{
return;
}

const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");

const scalarField alphaEffp =
patch().lookupPatchField<volScalarField, scalar>(alphaEffName_);

// const scalarField& Cpp =
// patch().lookupPatchField<volScalarField, scalar>(CpName_);

transportModel& laminarTransport = rasModel.transport();
dimensionedScalar Cp(laminarTransport.lookup("Cp"));

gradient() = q_/(Cp.value()*alphaEffp);

fixedGradientFvPatchScalarField::updateCoeffs();
}
-------------------------------------------------------------------------------------------------
Further I specified Cp by adding one line into readTransportProperties.H for solver buoyantBoussinesqSimpleFoam:

//Bug fix OLK: Cp is needed for fixedHeatFlux boundary condition
// Heat capacity
dimensionedScalar Cp(laminarTransport.lookup("Cp"));
-------------------------------------------------------------------------------------------------
For other incompressible solvers with heat transfer it should be done too.

Now I can use the new boundary condition turbulentHeatFluxTemperature for both compressible and incompressible cases.

Cheers, Oleksiy
__________________
*************************
Cheers, Oleksiy
evrikon is offline   Reply With Quote

Old   July 2, 2010, 06:23
Default
  #2
New Member
 
Robert
Join Date: Apr 2010
Posts: 16
Rep Power: 16
rob3rt is on a distinguished road
Hello Evrikon,

I had this error while trying to compile your bugfix.

derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C:1 59: error: ‘transportModel’ was not declared in this scope
derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C:1 59: error: ‘laminarTransport’ was not declared in this scope
derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C:1 59: error: ‘rasModel’ was not declared in this scope
derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C:1 62: error: ‘Cpp’ was not declared in this scope

What should I declare to make this working?

And

another question is: what is difference between turbulentHeatFluxTemperature (without rho) and wallHeatFlux (http://openfoamwiki.net/index.php/Contrib_wallHeatFlux)?
I think both can be used for incompressible cases, right?

Thanks very much for your time.

Kind Regards,
Robert.
rob3rt is offline   Reply With Quote

Old   September 7, 2010, 08:31
Default
  #3
New Member
 
Oleksiy Kurenkov
Join Date: Mar 2009
Location: Nueremberg
Posts: 16
Rep Power: 17
evrikon is on a distinguished road
Send a message via Skype™ to evrikon
Dear Robert,

I implemented this bug fix directly in OpenFoam 1.6.x. I changed the boundary condition in turbulentHeatFluxFvPatchField.C as described above and recompiled the whole turbulenceModels staff. It takes only a few minutes. If you try to do that, please do a backup of turbulenceModels directory before!

I assume you simply miss the corresponding libraries. Do you try to define this boundary condition as your own library? Then you do need to look into your Make/files and Make/Options.
__________________
*************************
Cheers, Oleksiy
evrikon is offline   Reply With Quote

Old   September 9, 2010, 05:39
Default
  #4
New Member
 
Join Date: Sep 2009
Posts: 13
Rep Power: 17
cgoniva is on a distinguished road
Dear Oleksiy,

Shouldn't you add rho to the equation:
"gradient() = q_/(Cp.value()*alphaEffp*rho0); "
as this is done here (http://openfoamwiki.net/index.php/Contrib_wallHeatFlux) ???

This rho should be read from dictionary as you did for Cp:
"dimensionedScalar rho0(laminarTransport.lookup("rho0")); "

Cheers,
Chris
cgoniva is offline   Reply With Quote

Old   September 9, 2010, 05:52
Default
  #5
New Member
 
Join Date: Sep 2009
Posts: 13
Rep Power: 17
cgoniva is on a distinguished road
oh... some mistake, it should be:

"gradient() = q_/(Cp.value()*alphaEffp*rho0.value()); "

Cheers, Chris
cgoniva is offline   Reply With Quote

Old   September 27, 2010, 09:52
Default
  #6
New Member
 
Oleksiy Kurenkov
Join Date: Mar 2009
Location: Nueremberg
Posts: 16
Rep Power: 17
evrikon is on a distinguished road
Send a message via Skype™ to evrikon
No, I only speak about the incompressible case where no rho is present in OpenFoam. Therefore the gradient is not divided by rho. For compressible cases it should be divided.
__________________
*************************
Cheers, Oleksiy
evrikon 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error occurs when compiling OpenFoam 1.6.x with Icc fs82 OpenFOAM Bugs 5 January 20, 2010 04:08
Serious bug in LES interface fs82 OpenFOAM Bugs 21 November 16, 2009 09:15
Bug in Meshing Parameters menu Spacing1 (1e+10) Karna ANSYS Meshing & Geometry 1 October 12, 2009 15:38
Bug reports Mattijs Janssens (Mattijs) OpenFOAM 0 January 10, 2005 11:05
Forum y2k Bug Jonas Larsson Main CFD Forum 1 January 5, 2000 11:22


All times are GMT -4. The time now is 19:01.