|
[Sponsors] |
Bug in turbulentHeatFluxTemperatureFvPatchScalarField; OF 1.6.x |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 1, 2010, 09:40 |
Bug in turbulentHeatFluxTemperatureFvPatchScalarField; OF 1.6.x
|
#1 |
New Member
|
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 |
|
July 2, 2010, 06:23 |
|
#2 |
New Member
Robert
Join Date: Apr 2010
Posts: 16
Rep Power: 16 |
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. |
|
September 7, 2010, 08:31 |
|
#3 |
New Member
|
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 |
|
September 9, 2010, 05:39 |
|
#4 |
New Member
Join Date: Sep 2009
Posts: 13
Rep Power: 17 |
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 |
|
September 9, 2010, 05:52 |
|
#5 |
New Member
Join Date: Sep 2009
Posts: 13
Rep Power: 17 |
oh... some mistake, it should be:
"gradient() = q_/(Cp.value()*alphaEffp*rho0.value()); " Cheers, Chris |
|
September 27, 2010, 09:52 |
|
#6 |
New Member
|
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 |
|
|
|
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 |