CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[swak4Foam] Problem with Transient Heat Source (using swak4Foam expression Source)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 3, 2013, 03:04
Default Problem with Transient Heat Source (using swak4Foam expression Source)
  #1
Senior Member
 
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 15
ahmmedshakil is on a distinguished road
Hi FOAMers,
I am solving energy equation for laser annealing problem. The equation I'm solving is as follows:
fvm::ddt(rhoCp, T) - fvm::laplacian(K,T) - rhoCp*VX*dtdx == heatSource();

Vx= velocity of the frame(I'm moving the the frame instead of source).
Cp & K is function of temperature.
Now, I'm calculating heatSource() using swak expression source(laser heat source)
Q= P*mu*(1-R)* exp(-mu*Z)*exp(-X^2/r^2);
where,
P = total power
mu = absorption co-efficient
R = Reflection.
Both mu and R is function of temperature.
Now, when I run the simulation I get the temperature value unusual(huge value!!!). I have also run the simulation taking mu as constant, in this case it gives reasonable value. Does any one had solve this type of problem? Thanks in advance .

shakil
Attached Files
File Type: gz mefFoam.tar.gz (7.3 KB, 77 views)
File Type: gz TestCase.tar.gz (5.0 KB, 51 views)
ahmmedshakil is offline   Reply With Quote

Old   August 3, 2013, 06:40
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by ahmmedshakil View Post
Hi FOAMers,
I am solving energy equation for laser annealing problem. The equation I'm solving is as follows:
fvm::ddt(rhoCp, T) - fvm::laplacian(K,T) - rhoCp*VX*dtdx == heatSource();

Vx= velocity of the frame(I'm moving the the frame instead of source).
Cp & K is function of temperature.
Now, I'm calculating heatSource() using swak expression source(laser heat source)
Q= P*mu*(1-R)* exp(-mu*Z)*exp(-X^2/r^2);
where,
P = total power
mu = absorption co-efficient
R = Reflection.
Both mu and R is function of temperature.
Now, when I run the simulation I get the temperature value unusual(huge value!!!). I have also run the simulation taking mu as constant, in this case it gives reasonable value. Does any one had solve this type of problem? Thanks in advance .

shakil
No time to look at it in detail. Two hints:
1. Is the temperature dependence in such a way that there is a positive feedback? Calculating by hand (or using some program that solves ODEs) for one cell might give hints
2. The explicit nature of the coupling might be a problem. Try to run the simulation with a timestep that is a tenth of the one you're currently using. If the results are approximately the same your physical model has a problem. If the problem is ten times smaller then you have a discretization problem
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   August 3, 2013, 07:41
Default
  #3
Senior Member
 
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 15
ahmmedshakil is on a distinguished road
Hi Gschaider,
Thank you for the answer. I guess it may be the explicit nature of coupling. I'm checking with the hints you suggested.
ahmmedshakil is offline   Reply With Quote

Old   August 22, 2013, 01:59
Default
  #4
Senior Member
 
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 15
ahmmedshakil is on a distinguished road
Hi,
Just figured out the problem is coming from the "mu" which is absorption coefficient. In my case, mu varies with the temperature with power law:
mu = mu0*(T/T0)^1.2
where,
mu0 = is the initial absorption
T0= is the initial temperature (300K)
Now, when I used this relationship in the heat source equation it causes the problem. Does any one have idea to deal with such situations???
ahmmedshakil is offline   Reply With Quote

Old   August 22, 2013, 05:57
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by ahmmedshakil View Post
Hi,
Just figured out the problem is coming from the "mu" which is absorption coefficient. In my case, mu varies with the temperature with power law:
mu = mu0*(T/T0)^1.2
where,
mu0 = is the initial absorption
T0= is the initial temperature (300K)
Now, when I used this relationship in the heat source equation it causes the problem. Does any one have idea to deal with such situations???
It MIGHT help to linearize the term and make it implicit. Something like

Code:
muPerT=mu0*(1/(T*T0))^1.2
(check arithmetics and adapt syntax) and as the source term use something like
Code:
fvm::Sp(muPerT,T)
That makes mu0 change with the temperature (not exactly, but the tendency).

I THINK (haven't tried yet) that you can still use an expressionSource for muPerT. Ah. And probably the physics in my example is wrong. That is your responsibility
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 7, 2015, 09:47
Default dimensian problems
  #6
Member
 
Kapa Lilla
Join Date: Mar 2009
Location: Bruxelles, Belgium
Posts: 57
Rep Power: 17
klilla is on a distinguished road
Dear All,

I try to use this feature of swak, but I have the following problem. When I try to run the case, my source term is complaining that pos.x() and T has dimensions, while the source term should not have?

I'm using OF 2.1 and Swak4Foam_2.x_release_0.2.2/

Why this is so?
Thanks,
Lilla

PS: my source term is depending on position and temperature.
klilla is offline   Reply With Quote

Old   January 7, 2015, 10:07
Default
  #7
Senior Member
 
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 15
ahmmedshakil is on a distinguished road
Can you please explain a bit detail of your problem? Because, if the source term is a function of position and temperature, it may have dimensions.

Cheers
#shakil
ahmmedshakil is offline   Reply With Quote

Old   January 7, 2015, 10:45
Default
  #8
Member
 
Kapa Lilla
Join Date: Mar 2009
Location: Bruxelles, Belgium
Posts: 57
Rep Power: 17
klilla is on a distinguished road
Dear Shakil,

indeed, the source itself has dimension (K/s), but in the syntax of expressionSource, it is given separately:

expression "543";
dimensions [0 0 -1 1 0 0 0];

My problem works fine with this constant source, but if I try to use a function

expression "54*(T-473.15)"

I got an error message that expression cannot be evaluated, because T and "473.15" do not have the same dimension. Now, I do not know how to define this constant with a dimension in this HeatSourceDict.

Best,
Lilla
klilla is offline   Reply With Quote

Old   January 7, 2015, 16:01
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by klilla View Post
Dear Shakil,

indeed, the source itself has dimension (K/s), but in the syntax of expressionSource, it is given separately:

expression "543";
dimensions [0 0 -1 1 0 0 0];

My problem works fine with this constant source, but if I try to use a function

expression "54*(T-473.15)"

I got an error message that expression cannot be evaluated, because T and "473.15" do not have the same dimension. Now, I do not know how to define this constant with a dimension in this HeatSourceDict.

Best,
Lilla
This seems to be a problem of swak4Foam. Please write a bug-report in the swak bugtracker

In the meantime a feasible workaround should be:
- create an expression field TDiff with value "T-473.15"
- rewrite your expression to "54*TDiff"
ahmmedshakil likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 8, 2015, 05:07
Default
  #10
Member
 
Kapa Lilla
Join Date: Mar 2009
Location: Bruxelles, Belgium
Posts: 57
Rep Power: 17
klilla is on a distinguished road
Dear Bernard,

thanks for your reply. I'll do the bug report, of course.

Just to be sure that I understood you well. What I did is that - dirty as it may - I defined that variable T-Tref, in my solver and called it expressionSource. In this way I bypassed the problem. That what you have meant, too? In any case, if I submit this report, will I be able to follow the progress of it? At one point I need to go for a newer release of OF - costumer request - and there I'd like to go back to the minimal, clean implementation.

All the best and thanks for this great tool,
Lilla
klilla is offline   Reply With Quote

Old   January 8, 2015, 05:51
Default
  #11
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by klilla View Post
Dear Bernard,

thanks for your reply. I'll do the bug report, of course.

Just to be sure that I understood you well. What I did is that - dirty as it may - I defined that variable T-Tref, in my solver and called it expressionSource. In this way I bypassed the problem. That what you have meant, too?
Yep.

Quote:
Originally Posted by klilla View Post
In any case, if I submit this report, will I be able to follow the progress of it?
Yep. As a reporter you get a mail every time something about this report is changed

Quote:
Originally Posted by klilla View Post
At one point I need to go for a newer release of OF - costumer request - and there I'd like to go back to the minimal, clean implementation.

All the best and thanks for this great tool,
Lilla
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 8, 2015, 06:01
Default
  #12
Member
 
Kapa Lilla
Join Date: Mar 2009
Location: Bruxelles, Belgium
Posts: 57
Rep Power: 17
klilla is on a distinguished road
Great, thanks!
Lilla
klilla is offline   Reply With Quote

Old   January 22, 2015, 05:38
Default
  #13
Member
 
Kapa Lilla
Join Date: Mar 2009
Location: Bruxelles, Belgium
Posts: 57
Rep Power: 17
klilla is on a distinguished road
I'd like to update the previous problem.

In fact, it works fine with:

- single phase model, one region
- single phase model, multi-region

It is not working fine (meaning takes the dimensions)

- multiphase model, multi-region

I have not tried the multiphase, one region, I'll do so, if I have a bit of time.

So I do not know now, if it is really a bug, or rather I have use/implemented it wrongly?

Best,
Lilla
klilla is offline   Reply With Quote

Reply


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
Conjugate heat transfer with heat source: Transient vs steadystate MBttR Main CFD Forum 14 July 26, 2016 11:01
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error FerdiFuchs OpenFOAM Community Contributions 27 April 16, 2014 16:14
[swak4Foam] swak4Foam-groovyBC build problem zxj160 OpenFOAM Community Contributions 18 July 30, 2013 14:14
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51
heat source problem John FLUENT 1 April 9, 2003 14:08


All times are GMT -4. The time now is 20:04.