|
[Sponsors] |
March 31, 2014, 21:04 |
Adding Energy Equation for porousSimpleFoam
|
#1 |
New Member
Yesaswi
Join Date: Jan 2014
Posts: 26
Rep Power: 12 |
Hi,
I am new to openFOAM. I am trying to add energy equation for simplePorousFoam. I initially attempted the same for simpleFoam solver by
This ran successfully. I repeated the same for porousSimpleFoam. Practically, this doesn't work as the energy equations are different for different domains (porous and non porous). OpenFOAM deals with this my making modifications in the equation based on the inout porosity parameters. It used member functions like
Could anyone help me to implement the similar approach for energy equation too?? |
|
April 3, 2014, 14:34 |
porousSimpleFoam
|
#2 |
New Member
Yesaswi
Join Date: Jan 2014
Posts: 26
Rep Power: 12 |
Hi all,
Can someone explain me how the porous simple foam works? All I know is it modifies the original momentum equation just for the porous zone I want to add a temperature equation in the same way. It should have basic energy equation for fluid zone and porous temperature equation for porous zone. So, can someone help me out with this? Thank You, Yesaswi |
|
July 27, 2015, 00:44 |
|
#3 |
New Member
Ipos
Join Date: Feb 2015
Posts: 7
Rep Power: 11 |
Hi Yesaswi
I have a problem same as you. If you know about that. Could you describe to me pls. Thx |
|
July 28, 2015, 12:33 |
|
#4 |
Member
Kapa Lilla
Join Date: Mar 2009
Location: Bruxelles, Belgium
Posts: 57
Rep Power: 17 |
porousSimpleFoam add an additional force term in the region where porosity is defined, do not solve a different equation there.
So, if you want temperature equation everywhere and just add a source/sink in the porous regions that is fine, you can use fvOptions for simple sources or swak SourceExpression for more elaborated ones. If you want to solve two distinct equations depending on the region, you need something like multiregion handling, like in conjugate heat transfer, because there you will have boundary conditions in the interface to keep the problem well-posed. That is difficult, I think and I cannot help with that. Could you describe a bit better your problem? |
|
July 29, 2015, 07:04 |
|
#5 |
New Member
Ipos
Join Date: Feb 2015
Posts: 7
Rep Power: 11 |
Hi klilla
I use fvOptions for source but it has error. Can you explain me about that pls. Code:
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so" #2 Uninterpreted: #3 Foam::heRhoThermo<Foam::rhoThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate() in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libfluidThermophysicalModels.so" #4 Foam::heRhoThermo<Foam::rhoThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libfluidThermophysicalModels.so" #5 in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/rhoPorousSimpleFoam" #6 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6" #7 in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/rhoPorousSimpleFoam" Floating point exception (core dumped) Kittipos Last edited by Kittipos; August 4, 2015 at 00:03. |
|
January 25, 2018, 05:42 |
porousSimpleFoam
|
#6 |
Member
Ramana
Join Date: Jul 2017
Location: India
Posts: 58
Rep Power: 9 |
Hi,
I am new to openFOAM. I am trying to simulate Heat transfer from a porous square cylinder maintained at constant temeperature to a flowing wind.I want to add temperature equation and Brinkmann term for PorousSimpleFoam. initially I added TEqn.H similar to procedure explained for icofoam solver and made necessary changes in header file ,create fields and make file here are my observations for which i need some clarifications TEqn:fvScalarMatrix TEqn ( //fvm::ddt(T) // <--- steady state simulation, so ddt disabled... //+ fvm::div(phi, T) - fvm::laplacian(DT, T) == fvOptions(T) // porouszone is maintained at const. temperature ); TEqn.relax(); fvOptions.constrain(TEqn); TEqn.solve(); fvOptions.correct(T); UEqn: tmp<fvVectorMatrix> tUEqn ( fvm::div(phi, U) //- fvm::laplacian(nu, U) //<<------ here i added brinkmann term + MRF.DDt(U) + turbulence->divDevReff(U) == fvOptions(U) ); fvVectorMatrix& UEqn = tUEqn.ref(); UEqn.relax(); header file modifications // Pressure-velocity SIMPLE corrector { #include "UEqn.H" #include "TEqn.H" // TEqn included here #include "pEqn.H" } laminarTransport.correct(); turbulence->correct(); Make file modifications: my_porousSimpleFoam.C EXE = $(FOAM_USER_APPBIN)/my_porousSimpleFoam fvOptions Dict: s1 { type scalarFixedValueConstraint; active true; scalarFixedValueConstraintCoeffs { selectionMode cellZone; cellZone porousBlockage; volumeMode uniform; fieldValues { T 303; } } } incoming flow is at const temp. 283 following are the flow and heat transfer parameters considered Re 40 Darcy no (Da ): 10e-6,10e-4 ,10e-2 porosity values: 0..629,0.8,0.993 Pr :0.71 when i run the simulation the Cd and Nusselt number values are not matching with the case which i want to validate So, can someone help me out with this? Thank You, Svramana Last edited by svramana; January 25, 2018 at 05:53. Reason: to add simulation domain |
|
February 7, 2018, 17:10 |
multiRegionReactingPorousSimpleFoam
|
#7 |
Senior Member
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 118
Rep Power: 11 |
Hello Ramana,
Seems like you got the hang of things, creating your own solver, feel free to link your case and I may be able to look into it in the upcoming weekend. In the mean time, I have been working on a chemical catalyst model expanding upon the usermade solver called multiRegionSimpleReactingFoam (originally by TonkomoLLC https://github.com/TonkomoLLC/multiRegionReactingFoam). I have added a thermal model to the solid domain inside of the fluid domain, which may be a reacting mixture or not. This solver is not validated or tested enough but builds in OF4 (I'll soon update it to OF5), but it may give you a hint at what may the be next move. The solver does not include a heat transfer model between the porous media and the fluid, however, it may be included using fvoptions. Hope its of any help. https://www.dropbox.com/s/vgtl1o1be5...am.tar.gz?dl=0 Regards Lasse |
|
February 10, 2018, 14:07 |
|
#8 | |
Member
Ramana
Join Date: Jul 2017
Location: India
Posts: 58
Rep Power: 9 |
Quote:
Dear Lasse, Thank you so much for your replay and please find the case folder (solver ,case and ref. paper) for your reference . I will definitely go through the reference link and will update you . https://www.dropbox.com/s/e3i9wxifcg...e1.tar.gz?dl=0 Reagards, S.V.Ramana |
||
February 12, 2018, 15:44 |
|
#9 |
Senior Member
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 118
Rep Power: 11 |
Hello Ramana,
I implemented your case in the following: https://www.dropbox.com/s/eesdzhxa6x...er.tar.gz?dl=0 I chose to solve it with chtMultiRegionSimpleFoam, a transient version also exists, however, you may not agree with the implementation. The main issue is the porosity model inside the porous domain, it is just solved as normal fluid problem. To improve it either implement a porousity model in fvoption applying it only in the porous domain or divide the domain into a non porous domain or a porous domain, and then implement a custom boundary condition from the fluid - fluid inside porous domain. I would due the prior as its much simpler compared to the custom boundary conditions. Let me know if you have any questions, it was just a quick setup and the case is ready for the chtMultiRegionSimpleFoam call, if you wish to recreate it just create your mesh as usual and use the topodict on only the solid (porous) domain, by copying the polymesh into the porous folder and running the Allporos. Additionally, note that I build the case based upon the heatTransfer tutorial chtMultiRegionSimpleFoam called heatExchanger, and that the AoE and htcConst should be determined from the heat transfer rate between the solid porous domain and the fluid. Regards Lasse. |
|
February 14, 2018, 04:36 |
|
#10 | |
Member
Ramana
Join Date: Jul 2017
Location: India
Posts: 58
Rep Power: 9 |
Quote:
I am using single domain approach ,i don't have the thermo physical properties.All i have is Reynold number(nu),Pr No:0.71(for air),permiability K and porosity. |
||
February 14, 2018, 12:48 |
|
#11 |
Senior Member
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 118
Rep Power: 11 |
Hello Ramana,
My bad, however, as the tempererature is fixed any of the solid properties don't matter. The reason for the implementation is due to the enthalpy setup in chtMultiregionFoam allowing for a simple heat exchanger model implementation, which also may be used for a single domain approach. If you plan on using your own solver, I would implement the heat transfer model in the fvOptions based upon heat transfer in a porous domain. Below is an example of a abit more complex heat source implementation in chtMultiRegionFoam, showing how to call cell values in fvoptions and defining a source. Code:
energySource { type scalarCodedSource; //scalarSemiImplicitSource active true; name sourceTime; scalarCodedSourceCoeffs //scalarSemiImplicitSourceCoeffs S(x) = Su + Sp*x // q in [W]; or in [W/m³] if you use specific mode { selectionMode cellZone; cellZone porousity1; fields (h); fieldNames (h); name sourceTime; codeInclude #{ #}; codeCorrect #{ // Pout<< "**codeCorrect**" << endl; #}; codeAddSup #{ // const Time& time = mesh().time(); const scalarField& V = mesh_.V(); const vectorField& C = mesh_.C(); const volVectorField& U = mesh().lookupObject<volVectorField>("U"); const volScalarField z = U.mesh().C() & vector(0,0,1); scalarField& hSource = eqn.source(); forAll(C, i) { hSource[i] -= ((600000 - 40000*exp(-200*mag(0.5-z[i])))*V[i]); } // Pout << "***codeAddSup***" << endl; #}; codeSetValue #{ // Pout<< "**codeSetValue**" << endl; #}; // Dummy entry. Make dependent on above to trigger recompilation code #{ $codeInclude $codeCorrect $codeAddSup $codeSetValue #}; } sourceTimeCoeffs { // Dummy entry } } |
|
February 19, 2018, 07:10 |
problem with porousmedia heat transfer using simple foam
|
#12 |
Member
Ramana
Join Date: Jul 2017
Location: India
Posts: 58
Rep Power: 9 |
Hi,
i Code:
f you want temperature equation everywhere and just add a source/sink in the porous regions that is fine, you can use fvOptions for simple sources Regards, S.V.ramana |
|
February 19, 2018, 14:48 |
|
#13 |
Senior Member
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 118
Rep Power: 11 |
Hello Ramana,
Sorry for the late reply, however, I realised that the above mentioned piece of code does not work with the TEqn, and requires EEqn(to my understanding) and is therefore not of use to you unless you use solvers like chtMultiRegionFoam. To define the conditions between the porous zone and fluid I would suggest you looking into empirical relations or analytical porous reactor modelling as it will describe modelling of the heat transfer between the two regions. Here is a source in regarding the above: https://www.politesi.polimi.it/bitst..._DiStefano.pdf Sorry for the inconvenience, regards Lasse. |
|
February 20, 2018, 13:05 |
|
#14 | |
New Member
Adri
Join Date: Sep 2017
Posts: 24
Rep Power: 9 |
Dear Lasse,
Thanks for your case and explanations, it really helps me a lot cause I am building a transient case with a 3 region problem (air/porous/air) non thermal equilibrium between hot air going through the porous zone. Quote:
Can you explain the difference between both approaches ? Thanks ! adrià |
||
February 20, 2018, 16:11 |
|
#15 |
Senior Member
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 118
Rep Power: 11 |
Hello Adrià, to my understanding the porousSimpleFoam allows for either implicit in the tensorial resistance or the transport using the spherical part of the resistance in the momentum diagonal (from the solver source).
The transport approach is used by fvOptions through the means of the Darcy-Forchheimer model. I would say it would be the same approach and as accurate using the Darcy-Forchheimer model, and could easily be tested with use of a simple case, first solved with porousSimpleFoam and then chtMultiRegionFoam. Regards Lasse |
|
March 1, 2018, 12:06 |
|
#16 | |
New Member
Adri
Join Date: Sep 2017
Posts: 24
Rep Power: 9 |
Quote:
Adrià |
||
April 13, 2018, 04:07 |
Const. Temp on porous cylinder surface
|
#17 |
Member
Ramana
Join Date: Jul 2017
Location: India
Posts: 58
Rep Power: 9 |
Hi all
Code:
TEqn:fvScalarMatrix TEqn ( fvm::div(phi, T) - fvm::laplacian(DT, T) == fvOptions(T) // porouszone is maintained at const. temperature ); TEqn.relax(); fvOptions.constrain(TEqn); TEqn.solve(); fvOptions.correct(T); ); how to define const.Temperature only on walls of porouszone ? Regards, Ramana |
|
April 13, 2018, 04:47 |
|
#18 |
Member
Kapa Lilla
Join Date: Mar 2009
Location: Bruxelles, Belgium
Posts: 57
Rep Power: 17 |
I think you would need to define a separate faceZone for that and not using the cellZone defined for the porous Zone.
|
|
April 13, 2018, 07:44 |
Fixed temperature on face zone
|
#19 |
Member
Ramana
Join Date: Jul 2017
Location: India
Posts: 58
Rep Power: 9 |
||
April 13, 2018, 08:32 |
|
#20 |
Member
Kapa Lilla
Join Date: Mar 2009
Location: Bruxelles, Belgium
Posts: 57
Rep Power: 17 |
No, indeed not. You can only set it in cells. But what you can easily do is to separate the first cell zone attached to the boundary. It is an approximation, but better then nothing.
I tried to see if you could do it with swak4foam, but could not find anything like that. |
|
Tags |
poroussimplefoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
help adding the energy equation to porousinterfoam using the enthalpy formulation | nadine | OpenFOAM Programming & Development | 18 | June 17, 2014 09:39 |
error message | cuteapathy | CFX | 14 | March 20, 2012 07:45 |
SIMPLE and energy equation convergence | Fabio | Main CFD Forum | 0 | June 1, 2007 07:06 |
How to discretize of energy equation ?? | Asghari | FLUENT | 0 | October 12, 2006 09:09 |
energy equation formulation | Pedro | Phoenics | 1 | July 5, 2001 13:17 |