CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Assigning time dependent heat Source terms

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 19, 2015, 01:43
Default Assigning time dependent heat Source terms
  #1
Member
 
Mehdi Asghari
Join Date: Feb 2010
Location: Tehran,IRAN
Posts: 82
Rep Power: 7
Asghari_M is on a distinguished road
Hi all;
Maybe, my question is a frequent question in OpenFoam forums, however I haven't still found a definite answer for it:
How can we assign a time-dependent (transient) heat source term at OpenFoam.2.3.1 (for example by fvOptions) ?
An example for heat source (S(h)):

S(h)=2*physical_time/(1+physical_time); (h is the symbol of enthalpy.)

Thx in advance for any attention and help.

M.Asghari

Last edited by Asghari_M; May 19, 2015 at 14:38.
Asghari_M is offline   Reply With Quote

Old   July 28, 2015, 13:16
Default fvOption for time dependent momentum source
  #2
New Member
 
mahmoud aboukhedr
Join Date: Feb 2014
Posts: 9
Rep Power: 3
Mahmoud_aboukhedr is on a distinguished road
I was wondering if the modification can be done for the pressureGradientExplicitSource ,, I'm trying to solve pressure gradient source for time dependent icoFoam solver??
Mahmoud_aboukhedr is offline   Reply With Quote

Old   Yesterday, 12:15
Default
  #3
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: UK
Posts: 103
Rep Power: 7
hk318i is on a distinguished road
Did you try codedSource?
https://github.com/OpenFOAM/OpenFOAM.../CodedSource.H
hk318i is offline   Reply With Quote

Old   Yesterday, 12:27
Default
  #4
New Member
 
mahmoud aboukhedr
Join Date: Feb 2014
Posts: 9
Rep Power: 3
Mahmoud_aboukhedr is on a distinguished road
Quote:
Originally Posted by hk318i View Post

Thanks for the reply, but am not sure what you mean?
Mahmoud_aboukhedr is offline   Reply With Quote

Old   Yesterday, 13:59
Default
  #5
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: UK
Posts: 103
Rep Power: 7
hk318i is on a distinguished road
Sorry my response wasn't clear. I posted it using CFD-onlne app which it isn't very efficient. Actually, it is the second time to write this post because the first one wasn't posted for some reason, anyway . . .

The codedSource fvOption is general way to implement any source term on the run, on the other hand you could modify and existing fvOption to match your needs. Instead if you are planing to use only one solver you could implement it directly in the desired solver.

Regarding the heat source problem, I think this relation cannot be write because it is function in time only and dimensionless. It isn't consistent.

About the pressureGradientExplicitSource, for some reason OpenFOAM dropped it in OpenFOAM-dev, so I expect it will not be available in the next version or a new alternative will be introduced soon. Anyway, your question isn't clear, how do you want the pressure gradient to varies with time? The current implementation in OpenFOAM-2.4 calculates it based on average velocity and direction only both are constants and they are not like fixedTemperatureConstraint which has an option for that.

I think both problems need to be more clear, so the forum users could really help you with constrictive comments.
hk318i is offline   Reply With Quote

Old   Yesterday, 15:50
Default
  #6
Member
 
Mehdi Asghari
Join Date: Feb 2010
Location: Tehran,IRAN
Posts: 82
Rep Power: 7
Asghari_M is on a distinguished road
S(h) has J/m3 unit. Heat source term presented by me isn't a physical relation. Dimensions are hidden in the coefficient number 2.0 as follows:

S(h)=2.0*t/(1+t);

Assume , the coefficient number 2.0 (specified at above by red color) has J/m3 unit. And also the source term type is specific and not absolute.
Asghari_M is offline   Reply With Quote

Old   Yesterday, 16:27
Default
  #7
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: UK
Posts: 103
Rep Power: 7
hk318i is on a distinguished road
Quote:
Originally Posted by Asghari_M View Post
S(h) has J/m3 unit. Heat source term presented by me isn't a physical relation. Dimensions are hidden in the coefficient number 2.0 as follows:

S(h)=2.0*t/(1+t);

Assume , the coefficient number 2.0 (specified at above by red color) has J/m3 unit. And also the source term type is specific and not absolute.
It should be straight forward according to the source code description, attached before.
Your formula could be implemented like that;

Code:
     const Time& time = mesh().time();
     // cells volumes 
     const scalarField& V = mesh_.V(); 
     scalarField& heSource = eqn.source(); 
      //reference to the source term
     // your equation
     scalar hs = (2.0*time.value())/(1+time.value()); 
     // adding to source term
     heSource += scalarField(V.size(), hs); 
    // heSource +=  ((2.0*time.value())/(1+time.value()))*V; // in case you need it as absolute value
see also cfd.direct post about energy equation in OF, http://cfd.direct/openfoam/energy-equation/

Last edited by hk318i; Yesterday at 18:47. Reason: Comments added to the code and link to cfd.direct post
hk318i is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transient spacial dependent heat source Kumudu OpenFOAM Running, Solving & CFD 0 October 28, 2013 12:02
same geometry,structured and unstructured mesh,different behaviour. sharonyue OpenFOAM Running, Solving & CFD 13 January 2, 2013 23:40
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 12:44


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