
[Sponsors] 
February 5, 2018, 13:58 
chtMultiRegionSimpleFoam with porous solid region.

#1 
New Member
Join Date: Nov 2017
Posts: 2
Rep Power: 0 
Hi,
In the tutorial/example for chtMultiRegionSimpleFoam i.e., heatExchanger, the porous region is modeled as fluid. I am trying to model this as a solid region since there is a volumetric heat source. The solver utilizes interRegionHeatTransferModel between regions using constantheatTransfer model. Does this model always expect the porous region to be fluid ?? Because it is expecting a surfaceField 'phi' and is giving me an error message: request for surfaceScalarField phi from objectRegistry porous failed available objects of type surfaceScalarField are 0() If possible, please point me to appropriate location from where this error could be originating... Thanks 

March 7, 2018, 07:35 

#2  
New Member
Adri
Join Date: Sep 2017
Posts: 24
Rep Power: 3 
Quote:
Thanks, Adrià 

March 8, 2018, 18:30 

#3 
Senior Member
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 160
Rep Power: 7 
you cant model a porous region as a solid as you dont have the required fields e.g U . There is nothing stopping you having heat generation in a fluid using fvOptions.In fact it works very well.
__________________
A CHEERING BAND OF FRIENDLY ELVES CARRY THE CONQUERING ADVENTURER OFF INTO THE SUNSET 

March 9, 2018, 03:48 
chtMultiRegionFoam for porous regions

#4  
New Member
Adri
Join Date: Sep 2017
Posts: 24
Rep Power: 3 
Quote:
in my case I would like to use chtMultiRegionFoam (transient) to look to heat transfers between a flow of hot air going through a porous bed (cf attachement). It's not for a heatexchanger it would be more for a thermal storage of heat in porous bed. So I don't need ther constantHeatSource but more a porosity modeling. Do you think that I can introduce in constant/porous/fvOptions :  a darcy forcheimer porosity model (with explicitPorositySource)  with a radial porosity profile ?  with a interfacial area density definition, (i.e the ratio of the area of the fluid / solid interface and the volume of the porous zone)  heat transfer law modeling between fluid & porous bed (nonthermal equilibrium) Thanks again for your help ! Adrià 

August 3, 2018, 19:30 

#5  
Member
Colli, Alejandro
Join Date: Jan 2014
Posts: 75
Rep Power: 6 
Quote:


August 31, 2018, 11:14 

#6 
New Member
Adri
Join Date: Sep 2017
Posts: 24
Rep Power: 3 
Hi Alejandro,
Yes I am working on it. I manage to build a case considering fluid going accross a porous media and exchanging heat flux between both of them as 2 different regions (cf attached) However I have some dimension troubles when I try to change the existing variableHeatTransfer function to calculate the h heat flux from the Nusselt number. I want to replace the proposed formula by a more adapted to my porous case adding 1 constant value : Code:
Nu = a*pow(Re, b)*pow(Pr, c) > Nu = 2 + 1.1*pow(Re, 0.6)*pow(Pr, 0.3) Code:
> FOAM FATAL ERROR: LHS and RHS of + have different dimensions dimensions : [0 0 0 0 0 0 0] + [0 0.6 0 0 0 0 0] Code:
/**\ =========  \\ / F ield  OpenFOAM: The Open Source CFD Toolbox \\ / O peration  \\ / A nd  Copyright (C) 20112016 OpenFOAM Foundation \\/ M anipulation   License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. \**/ #include "WakaoCorrelationVariableHeatTransfer.H" #include "addToRunTimeSelectionTable.H" #include "turbulentFluidThermoModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { namespace fv { defineTypeNameAndDebug(WakaoCorrelationVariableHeatTransfer, 0); addToRunTimeSelectionTable ( option, WakaoCorrelationVariableHeatTransfer, dictionary ); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::fv::WakaoCorrelationVariableHeatTransfer::WakaoCorrelationVariableHeatTransfer ( const word& name, const word& modelType, const dictionary& dict, const fvMesh& mesh ) : interRegionHeatTransferModel(name, modelType, dict, mesh), UNbrName_(coeffs_.lookupOrDefault<word>("UNbr", "U")), a_(0), // b_(0), // pow(Re,b) c_(0), // pow(Pr,c) ds_(0), //ds_("ds_", dimLength, 0.01), Pr_(0), AoV_() { if (master_) { a_ = readScalar(coeffs_.lookup("a")); b_ = readScalar(coeffs_.lookup("b")); c_ = readScalar(coeffs_.lookup("c")); ds_ = readScalar(coeffs_.lookup("ds")); Pr_ = readScalar(coeffs_.lookup("Pr")); AoV_.reset ( new volScalarField ( IOobject ( "AoV", mesh_.time().timeName(), mesh_, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh_ ) ); } } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::fv::WakaoCorrelationVariableHeatTransfer::~WakaoCorrelationVariableHeatTransfer() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::fv::WakaoCorrelationVariableHeatTransfer::calculateHtc() { if (master_) { const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName()); const compressible::turbulenceModel& nbrTurb = nbrMesh.lookupObject<compressible::turbulenceModel> ( turbulenceModel::propertiesName ); const fluidThermo& nbrThermo = nbrMesh.lookupObject<fluidThermo>(basicThermo::dictName); const volVectorField& UNbr = nbrMesh.lookupObject<volVectorField>(UNbrName_); const volScalarField ReNbr(mag(UNbr)*ds_*nbrThermo.rho()/nbrTurb.mut()); const volScalarField NuNbr(2 + a_*pow(ReNbr, b_)*pow(Pr_, c_)); } } bool Foam::fv::WakaoCorrelationVariableHeatTransfer::read(const dictionary& dict) { if (interRegionHeatTransferModel::read(dict)) { coeffs_.readIfPresent("UNbr", UNbrName_); coeffs_.readIfPresent("a", a_); coeffs_.readIfPresent("b", b_); coeffs_.readIfPresent("c", c_); coeffs_.readIfPresent("ds", ds_); coeffs_.readIfPresent("Pr", Pr_); return true; } else { return false; } } // ************************************************************************* // Code:
/**\ =========  \\ / F ield  OpenFOAM: The Open Source CFD Toolbox \\ / O peration  \\ / A nd  Copyright (C) 20112016 OpenFOAM Foundation \\/ M anipulation   License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. \**/ #include "variableHeatTransfer.H" #include "turbulentFluidThermoModel.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { namespace fv { defineTypeNameAndDebug(variableHeatTransfer, 0); addToRunTimeSelectionTable ( option, variableHeatTransfer, dictionary ); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::fv::variableHeatTransfer::variableHeatTransfer ( const word& name, const word& modelType, const dictionary& dict, const fvMesh& mesh ) : interRegionHeatTransferModel(name, modelType, dict, mesh), UNbrName_(coeffs_.lookupOrDefault<word>("UNbr", "U")), a_(0), b_(0), c_(0), ds_(0), Pr_(0), AoV_() { if (master_) { a_ = readScalar(coeffs_.lookup("a")); b_ = readScalar(coeffs_.lookup("b")); c_ = readScalar(coeffs_.lookup("c")); ds_ = readScalar(coeffs_.lookup("ds")); Pr_ = readScalar(coeffs_.lookup("Pr")); AoV_.reset ( new volScalarField ( IOobject ( "AoV", mesh_.time().timeName(), mesh_, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh_ ) ); } } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::fv::variableHeatTransfer::~variableHeatTransfer() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::fv::variableHeatTransfer::calculateHtc() { const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName()); const compressible::turbulenceModel& nbrTurb = nbrMesh.lookupObject<compressible::turbulenceModel> ( turbulenceModel::propertiesName ); const fluidThermo& nbrThermo = nbrMesh.lookupObject<fluidThermo>(basicThermo::dictName); const volVectorField& UNbr = nbrMesh.lookupObject<volVectorField>(UNbrName_); const volScalarField ReNbr(mag(UNbr)*ds_*nbrThermo.rho()/nbrTurb.mut()); const volScalarField NuNbr(a_*pow(ReNbr, b_)*pow(Pr_, c_)); const scalarField htcNbr(NuNbr*nbrTurb.kappaEff()/ds_); const scalarField htcNbrMapped(interpolate(htcNbr)); htc_.primitiveFieldRef() = htcNbrMapped*AoV_; } bool Foam::fv::variableHeatTransfer::read(const dictionary& dict) { if (interRegionHeatTransferModel::read(dict)) { coeffs_.readIfPresent("UNbr", UNbrName_); coeffs_.readIfPresent("a", a_); coeffs_.readIfPresent("b", b_); coeffs_.readIfPresent("c", c_); coeffs_.readIfPresent("ds", ds_); coeffs_.readIfPresent("Pr", Pr_); return true; } else { return false; } } // ************************************************************************* // 1. Does anybody already used or validated this fvOption before ? There is no tutorial using it. 2. Do you agree that ds_ value would be declared as a dimensionedScalar [0 1 0 0 0 ...]. That would explain the dimension problem I found. 3. If it is the case, how can it works with the original function ? I am quite surprised to have found such a mistake. I am waiting for your reactions ! 

September 1, 2018, 15:12 

#7 
Member
Colli, Alejandro
Join Date: Jan 2014
Posts: 75
Rep Power: 6 
why u removed the following 3 lines from the original function?
Code:
const scalarField htcNbr(NuNbr*nbrTurb.kappaEff()/ds_); const scalarField htcNbrMapped(interpolate(htcNbr)); htc_.primitiveFieldRef() = htcNbrMapped*AoV_; 

September 3, 2018, 03:42 

#8 
New Member
Adri
Join Date: Sep 2017
Posts: 24
Rep Power: 3 
Hi, Excuse me your right it's a mistake of copy/paste for the post.
the corrected version : Code:
/**\ =========  \\ / F ield  OpenFOAM: The Open Source CFD Toolbox \\ / O peration  \\ / A nd  Copyright (C) 20112016 OpenFOAM Foundation \\/ M anipulation   License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. \**/ #include "WakaoCorrelationVariableHeatTransfer.H" #include "addToRunTimeSelectionTable.H" #include "turbulentFluidThermoModel.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { namespace fv { defineTypeNameAndDebug(WakaoCorrelationVariableHeatTransfer, 0); addToRunTimeSelectionTable ( option, WakaoCorrelationVariableHeatTransfer, dictionary ); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::fv::WakaoCorrelationVariableHeatTransfer::WakaoCorrelationVariableHeatTransfer ( const word& name, const word& modelType, const dictionary& dict, const fvMesh& mesh ) : interRegionHeatTransferModel(name, modelType, dict, mesh), UNbrName_(coeffs_.lookupOrDefault<word>("UNbr", "U")), a_(0), // b_(0), // pow(Re,b) c_(0), // pow(Pr,c) ds_(0), //ds_("ds_", dimLength, 0.01), Pr_(0), AoV_() { if (master_) { a_ = readScalar(coeffs_.lookup("a")); b_ = readScalar(coeffs_.lookup("b")); c_ = readScalar(coeffs_.lookup("c")); ds_ = readScalar(coeffs_.lookup("ds")); Pr_ = readScalar(coeffs_.lookup("Pr")); AoV_.reset ( new volScalarField ( IOobject ( "AoV", mesh_.time().timeName(), mesh_, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh_ ) ); } } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::fv::WakaoCorrelationVariableHeatTransfer::~WakaoCorrelationVariableHeatTransfer() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::fv::WakaoCorrelationVariableHeatTransfer::calculateHtc() { if (master_) { const fvMesh& nbrMesh = mesh_.time().lookupObject<fvMesh>(nbrRegionName()); const compressible::turbulenceModel& nbrTurb = nbrMesh.lookupObject<compressible::turbulenceModel> ( turbulenceModel::propertiesName ); const fluidThermo& nbrThermo = nbrMesh.lookupObject<fluidThermo>(basicThermo::dictName); const volVectorField& UNbr = nbrMesh.lookupObject<volVectorField>(UNbrName_); const volScalarField ReNbr(mag(UNbr)*ds_*nbrThermo.rho()/nbrTurb.mut()); const volScalarField NuNbr(2 + a_*pow(ReNbr, b_)*pow(Pr_, c_)); const scalarField htcNbr(NuNbr*nbrTurb.kappaEff()/ds_); const scalarField htcNbrMapped(interpolate(htcNbr)); htc_.primitiveFieldRef() = htcNbrMapped*AoV_; } } bool Foam::fv::WakaoCorrelationVariableHeatTransfer::read(const dictionary& dict) { if (interRegionHeatTransferModel::read(dict)) { coeffs_.readIfPresent("UNbr", UNbrName_); coeffs_.readIfPresent("a", a_); coeffs_.readIfPresent("b", b_); coeffs_.readIfPresent("c", c_); coeffs_.readIfPresent("ds", ds_); coeffs_.readIfPresent("Pr", Pr_); return true; } else { return false; } } // ************************************************************************* // thanks for your help. adrià 

September 3, 2018, 06:22 

#9 
Member
Colli, Alejandro
Join Date: Jan 2014
Posts: 75
Rep Power: 6 
can u upload the complete .H and .C code together with the make directory, then i can try to compile on my side. Which version of OF are u using?


September 4, 2018, 05:22 

#10 
New Member
Adri
Join Date: Sep 2017
Posts: 24
Rep Power: 3 
Sure,
version : CFDdirect version OpenFOAM.5.0 you have the function to compile attached. Adrià 

September 4, 2018, 08:06 

#11 
Member
Colli, Alejandro
Join Date: Jan 2014
Posts: 75
Rep Power: 6 
Also, I ran ur example but, it is set for constantHeatTransfer. Did u run it with variableHeatTransfer? I would need the dictionary with your a, b, c, etc constant for your particular case.


September 13, 2018, 09:52 

#12 
New Member
Adri
Join Date: Sep 2017
Posts: 24
Rep Power: 3 
Hi Alejandro,
Sorry for my late answer but I deal with other topics and I just come back to my porous heat transfer case. Attached you 'll find the case with the modified library case. You will need to compile the Wakao lib to run it of course. As I said before, I encountered a dimension error when I try to run it, and I don't know why. here's the error when I take the following input coeffs : Code:
solidToAir { type WakaoCorrelationVariableHeatTransfer; active yes; WakaoCorrelationVariableHeatTransferCoeffs { interpolationMethod cellVolumeWeight; nbrRegionName air; master true; nbrModel airToSolid; fields (h); semiImplicit no; a 1.1; b 0.6;// c 0.333; ds 0.01; //in m? Pr 0.7; } } Code:
> FOAM FATAL ERROR: LHS and RHS of + have different dimensions dimensions : [0 0 0 0 0 0 0] + [0 0.6 0 0 0 0 0] From function Foam::dimensionSet Foam::operator+(const Foam::dimensionSet&, const Foam::dimensionSet&) in file dimensionSet/dimensionSet.C at line 501. Adrià 

September 14, 2018, 08:46 

#13 
Member
Colli, Alejandro
Join Date: Jan 2014
Posts: 75
Rep Power: 6 
Hi Adri,
After studying a little bit the code. I think you are right in that ds_ value should be declared as a dimensionedScalar [0 1 0 0 0 ...]. That would explain the dimension problem. Otherwise, The Reynolds number would not be dimensionless and has no sense at all. As u proposed by modifying: .H Code:
//scalar ds_; // error in the original code ? dimensionedScalar ds_; Code:
//ds_(0), ds_("ds_", dimLength, 0.01), Code:
if (master_) { a_ = readScalar(coeffs_.lookup("a")); b_ = readScalar(coeffs_.lookup("b")); c_ = readScalar(coeffs_.lookup("c")); //ds_ = readScalar(coeffs_.lookup("ds")); dimensionedScalar ds_ ( "ds_", dimLength, readScalar(coeffs_.lookup("ds")) ); I could compile and run without problems. The simulation is crashing after some iterations, but I have tried variableHeatTransfer and it is also crashing for the particular problem you are trying to solve (I think it is something related to numerical stability) Maybe you should report the bug 

September 14, 2018, 08:59 

#14 
New Member
Adri
Join Date: Sep 2017
Posts: 24
Rep Power: 3 
Thanks Alejandro. I think it to.
The simulation runs but I think the solid region mesh resolution of the version I attached is not good enough. Anyway I can update my case I attach the new one when it runs. Apart from the code problem do you think that the case is adapted to consider heat transfer through porous media ? For the moment I am quite far from experiment results when looking the temperature evolution. But the behaviour is ok. Adrià 

September 14, 2018, 11:23 

#15 
Member
Colli, Alejandro
Join Date: Jan 2014
Posts: 75
Rep Power: 6 
I think yes, you are doing something similar to the tutorial heat Exchanger. However, I can not see where to define the porosity in order to be taken into account by the heat equation either for porous zone and gas zone. Do you know how to set that variable in the present simulations?
Last edited by ancolli; September 28, 2018 at 20:10. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Can I use fvOptions to couple a solid region and a fluid region?  titanchao  OpenFOAM Running, Solving & CFD  1  March 7, 2018 07:46 
Error  Solar absorber  Solar Thermal Radiation  MichaelK  CFX  12  September 1, 2016 05:15 
Solid Temperature in porous Media  iamsarthaknag  STARCCM+  1  May 23, 2016 07:14 
Using starToFoam  clo  OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ...  33  September 26, 2012 04:04 
CFX4.3 build analysis form  Chie Min  CFX  5  July 12, 2001 23:19 