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

patchExpression with alpha in OF 2.2.0 - calculate heat flux

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

Like Tree3Likes
  • 2 Post By RMF
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 18, 2013, 17:31
Default patchExpression with alpha in OF 2.2.0 - calculate heat flux
  #1
RMF
New Member
 
Join Date: Aug 2012
Posts: 13
Rep Power: 13
RMF is on a distinguished road
Hello,

I used the patchExpression "alpha)*area()*snGrad(h)" with swak4Foam to monitor the heat flux on a patch in OF 2.1.x. This worked very well. Since I have updated to OF 2.2.0 I get an error "Parser Error for driver PatchValueExpressionDriver at "1.2-3" :"field alpha not existing or of wrong type.

Has anybody an idea how to acces the thermal diffusivity in OF 2.2.0 in a patchExpression? Or does anybody know another way to monitor the wallHeatFlux.

Thanks

RMF
RMF is offline   Reply With Quote

Old   April 22, 2013, 18:36
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 RMF View Post
Hello,

I used the patchExpression "alpha)*area()*snGrad(h)" with swak4Foam to monitor the heat flux on a patch in OF 2.1.x. This worked very well. Since I have updated to OF 2.2.0 I get an error "Parser Error for driver PatchValueExpressionDriver at "1.2-3" :"field alpha not existing or of wrong type.

Has anybody an idea how to acces the thermal diffusivity in OF 2.2.0 in a patchExpression? Or does anybody know another way to monitor the wallHeatFlux.

Thanks

RMF
Seems you became a victim of the improvement of the thermodynimc classes. Didn't have much time to look at it, but when looking at the part where alpha is declared I see
Code:
 
alpha_
    (
        IOobject
        (
            phasePropertyName("thermo:alpha"),
            mesh.time().timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
Guess that means that it is now called thermo:alpha with the name of the phase in front. The bad thing is not that I don't know which phaseName should be prefixed in your case, the bad thing is that I don't think that swak accepts ":" as a valid part of a field name and this will need some work on the parser to make him accept it (because currently it is part of the ?:-operator)

Will look at this as soon as I find the time. Bug report might speed it up
__________________
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   April 24, 2013, 09:11
Default
  #3
RMF
New Member
 
Join Date: Aug 2012
Posts: 13
Rep Power: 13
RMF is on a distinguished road
This is what I found out as well in the meantime: alpha is called thermo:alpha (I used the "bananas"-trick with a wirteRegisteredObject). But as you've assumed, swak4Foam does not accept the ":" in thermo:alpha.

For those, who have a similar problem:
As a workaround I modified the solver and registered an additional field alpha, which is updated at the end of each timestep with the values from thermo:alpha. This is probably inefficient, but it is working for the moment. If there are any better ideas, I'd be glad to hear them.

I will report a bug and hope you will find the time to modify swak4Foam in the near future. Anyway, thank you for your answer.

Bye RMF
RMF is offline   Reply With Quote

Old   April 24, 2013, 21:19
Default
  #4
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 RMF View Post
This is what I found out as well in the meantime: alpha is called thermo:alpha (I used the "bananas"-trick with a wirteRegisteredObject). But as you've assumed, swak4Foam does not accept the ":" in thermo:alpha.

For those, who have a similar problem:
As a workaround I modified the solver and registered an additional field alpha, which is updated at the end of each timestep with the values from thermo:alpha. This is probably inefficient, but it is working for the moment. If there are any better ideas, I'd be glad to hear them.

I will report a bug and hope you will find the time to modify swak4Foam in the near future. Anyway, thank you for your answer.
I added a feature to swak where you can define aliases for such "unusual" field names like this
Code:
aliases {
  alpha thermo:alpha;
}
With that you can say "alpha" in your expression and "thermo:alpha" will be used. I'll push that to the public development-repository in the next days (just have to check it doesn't break anything) and of course it will be in the next release
__________________
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   April 28, 2013, 20:03
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 gschaider View Post
I added a feature to swak where you can define aliases for such "unusual" field names like this
Code:
aliases {
  alpha thermo:alpha;
}
With that you can say "alpha" in your expression and "thermo:alpha" will be used. I'll push that to the public development-repository in the next days (just have to check it doesn't break anything) and of course it will be in the next release
OK. It is pushed to the mercurial repository
__________________
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   May 2, 2013, 04:49
Default
  #6
RMF
New Member
 
Join Date: Aug 2012
Posts: 13
Rep Power: 13
RMF is on a distinguished road
Thank you very much. You were really quick. But it's still not working for me (maybe it's my fault):

I changed my function to

HeatLoss
{

type patchExpression;
patches (CAVITYIN CAVITYBACK);
verbose true;
aliases {
alpha thermo:alpha
}
expression"(alpha+alphat)*area()*snGrad(h)";
accumulations (sum);
}

but now I get the error message:

No field of type scalar with the name alpha found

Fields of type: volScalarField
17
(
thermo:mu
...


Something changed, but it's still not working...

Did I use the aliases wrong? The other variation I tested led to the old error message.

Bye RMF
apple-tree and mgg like this.

Last edited by RMF; May 2, 2013 at 15:40.
RMF is offline   Reply With Quote

Old   May 4, 2013, 07:23
Default
  #7
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 RMF View Post
Thank you very much. You were really quick. But it's still not working for me (maybe it's my fault):

I changed my function to

HeatLoss
{

type patchExpression;
patches (CAVITYIN CAVITYBACK);
verbose true;
aliases {
alpha thermo:alpha
}
expression"(alpha+alphat)*area()*snGrad(h)";
accumulations (sum);
}

but now I get the error message:

No field of type scalar with the name alpha found

Fields of type: volScalarField
17
(
thermo:mu
...


Something changed, but it's still not working...

Did I use the aliases wrong? The other variation I tested led to the old error message.

Bye RMF
No that looks alright. Must check. Which solver which version are you using?
__________________
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   May 4, 2013, 09:05
Default
  #8
RMF
New Member
 
Join Date: Aug 2012
Posts: 13
Rep Power: 13
RMF is on a distinguished road
I am using the buoyantSimpleFoam solver of OF 2.2.0
Thanks
Bye RMF
RMF is offline   Reply With Quote

Old   May 4, 2013, 18:46
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 RMF View Post
I am using the buoyantSimpleFoam solver of OF 2.2.0
Thanks
Bye RMF
Seems like the aliasing wasn't added to ALL relevant functions. A fix is now pushed to the development repository on sourceforge
lth 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   May 15, 2013, 13:50
Default
  #10
RMF
New Member
 
Join Date: Aug 2012
Posts: 13
Rep Power: 13
RMF is on a distinguished road
Sorry for the late reply: I was busy last week...but I now I had some time to test your modification. It's working now. Thank you very much!
RMF is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Total heat transf. rate vs Total surface heat flux Renato Sousa FLUENT 1 April 14, 2020 04:27
Wall Heat Flux & Temperature Greg Perkins FLUENT 10 November 20, 2015 10:32
Radiation interface hinca CFX 15 January 26, 2014 18:11
heat flux distribution gtheo CFX 2 April 27, 2011 04:36
monitoring dynamic heat flux through a surface abdnakhi FLUENT 0 August 15, 2005 10:57


All times are GMT -4. The time now is 18:16.