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

Energy Equation - Adding source term

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By Aaron_L
  • 3 Post By Aaron_L
  • 1 Post By akidess

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 12, 2016, 09:55
Default Energy Equation - Adding source term
  #1
Member
 
Join Date: Jul 2013
Posts: 39
Rep Power: 12
cfdsolver1 is on a distinguished road
My Problem:





My question:

Hello everyone. I am working on convective heat transfer problem. I want to solve temperature both for fluid and solid regions. As I know, I can model this using multiRegionSolver of OpenFOAM. I want to generate heat inside solid block and analyze effect of solid thermal conductivity on heat transfer.

I think I can do this by adding source term to energy equation for solid region. I am beginner at OpenFOAM and I could not find a way to add heat generation as a source term into my solid region energy equation. Is it possible to do this with using OpenFOAM default solvers or do I need to write my own solver?

Thank you very much.
cfdsolver1 is offline   Reply With Quote

Old   September 12, 2016, 10:18
Default
  #2
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
This is implemented inside the fvOptions. You can simply add that to your chtmultiregion calculation without modifying the solver.
Bloerb is offline   Reply With Quote

Old   September 12, 2016, 10:25
Default
  #3
New Member
 
Aaron
Join Date: Apr 2016
Posts: 24
Rep Power: 10
Aaron_L is on a distinguished road
Hi,cfdsolver1

just use swak4foam to add source term, the source term expression like this
Quote:
expressions
(
Q1
{
field Q;
expression "exp(pos().x)";
condition "(mag(pos().x)<=1) && (mag(pos().y)<=1)";
}

);
the pos().x represent the position of x coordinate

I also do a research in mixed convection using openfoam and fluent, I use openfoam for one year and new to fluent, maybe we can communicate with each other.

best wishes,
Aaron
Luttappy likes this.
Aaron_L is offline   Reply With Quote

Old   September 12, 2016, 10:53
Default
  #4
Member
 
Join Date: Jul 2013
Posts: 39
Rep Power: 12
cfdsolver1 is on a distinguished road
Quote:
Originally Posted by Bloerb View Post
This is implemented inside the fvOptions. You can simply add that to your chtmultiregion calculation without modifying the solver.
Bloerb, thank you very much for your help. Do you have any example or tutorial about using fvOptions for heat transfer problems? Actually, I have come up with fvOptions suggestion before posting my problem here but most implementations were related to momentum equation. I did not understand well how I can include fvOptions into energy equation so any help appreciated.


Quote:
Originally Posted by Aaron_L View Post
Hi,cfdsolver1

just use swak4foam to add source term, the source term expression like this

the pos().x represent the position of x coordinate

I also do a research in mixed convection using openfoam and fluent, I use openfoam for one year and new to fluent, maybe we can communicate with each other.

best wishes,
Aaron
Dear Aaron, thank you for your reply. Is it possible to define source term using swak4foam for a region/surface? Or pos().x will handle it directly for me? I did not know swak4foam and I am confused little bit. I have a solid region and I want to apply heat generation directly to that region without dealing with its coordinates.

Also, Vice versa here, I have 6 years experience in modeling mixed convection using Fluent and I am totally new in OpenFOAM. Any help is really appreciated. You can also find me whenever you need help in Fluent.
cfdsolver1 is offline   Reply With Quote

Old   September 12, 2016, 22:57
Default
  #5
New Member
 
Aaron
Join Date: Apr 2016
Posts: 24
Rep Power: 10
Aaron_L is on a distinguished road
hi,cfdsolver1, swak4foam can easily help you deal with nonuniform source term field, As far as I know, use fvOptions can only deal with it uniform field/region/patch.

firstly, you can define a source term field Q
Quote:
volScalarField Q
(
IOobject
(
"Q",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
the add source term Q in TEqn in solid region
Quote:
fvScalarMatrix TEqn
(
fvm::ddt(rho*cp,T)
- fvm::laplacian(K, T)
- Q
);
TEqn().solve();
then, if you are uniform field,you need to define Q interalField and boundaryField like this
Quote:
dimensions [ 1 -1 -3 0 0 0 0 ];

internalField uniform 0;

boundaryField
{
yourpatch
{
type fixedValue;
value uniform 0;
}
}
if you are nonuniform field, you can use swak4foam.
Luttappy, Kummi and gezijun like this.
Aaron_L is offline   Reply With Quote

Old   September 13, 2016, 02:43
Default
  #6
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
Quote:
Originally Posted by Aaron_L View Post
As far as I know, use fvOptions can only deal with it uniform field/region/patch.
Pretty sure this is false. The cellZones can be arbitrary.
cfdsolver1 likes this.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   September 13, 2016, 02:56
Default cht solver
  #7
Member
 
Join Date: Oct 2015
Location: montreal- canada
Posts: 46
Rep Power: 10
Mohammad Jam is on a distinguished road
Hi Dear foamers

Do you have any experience in implementing mixed derivative term ddt{d2dx2} in chtMultiRegionFoam solver?

Regards,
Jam
Mohammad Jam is offline   Reply With Quote

Old   September 13, 2016, 11:07
Default
  #8
Member
 
Join Date: Jul 2013
Posts: 39
Rep Power: 12
cfdsolver1 is on a distinguished road
Thank you for your comment akidess. I have no idea about swak4foam yet, so I think fvOptions might be more easier for me, I guess.

Quote:
Originally Posted by akidess View Post
Pretty sure this is false. The cellZones can be arbitrary.
Quote:
Originally Posted by Aaron_L View Post
hi,cfdsolver1, swak4foam can easily help you deal with nonuniform source term field, As far as I know, use fvOptions can only deal with it uniform field/region/patch.

firstly, you can define a source term field Q

the add source term Q in TEqn in solid region

then, if you are uniform field,you need to define Q interalField and boundaryField like this


if you are nonuniform field, you can use swak4foam.
I will definitely check swak4foam too, thank you so much!
cfdsolver1 is offline   Reply With Quote

Old   May 22, 2017, 00:18
Default Query
  #9
Member
 
jeanpinto24@hotmail.com
Join Date: Feb 2017
Posts: 44
Rep Power: 9
jeanpinto24| is on a distinguished road
Dear all, by adding a new source term to the energy equation, which in my case is the energy delivered by people in a classroom. I must suppose that by adding this term to the energy equation, I must regard it as a positive heat that is gained by the fluid. Now I have the question of how to create Q internalFiel and boundaryFiel
jeanpinto24| is offline   Reply With Quote

Old   February 21, 2018, 10:52
Default
  #10
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 8
gouravjee is on a distinguished road
Hello everyone,
i want to know about how to write expression in openfoam
for the term which i have attached below



dist.png
thanks in advance
gouravjee is offline   Reply With Quote

Reply

Tags
multiregion, source energy term


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
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 tlcoons OpenFOAM Installation 13 April 20, 2016 17:34
Energy Source Term for Sub-Region Solmyr89 Fluent UDF and Scheme Programming 4 January 16, 2016 04:31
Adding an energy source term to a phase with reactions lxlxlxt Fluent Multiphase 0 February 10, 2014 20:42
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
Source term energy equation for reactive flows DaIN Main CFD Forum 0 October 6, 2011 15:11


All times are GMT -4. The time now is 21:45.