CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > 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 Tree1Likes
  • 1 Post By RMF

Reply
 
LinkBack Thread Tools Display Modes
Old   April 18, 2013, 16:31
Default patchExpression with alpha in OF 2.2.0 - calculate heat flux
  #1
RMF
New Member
 
Join Date: Aug 2012
Posts: 10
Rep Power: 4
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, 17:36
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
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, 08:11
Default
  #3
RMF
New Member
 
Join Date: Aug 2012
Posts: 10
Rep Power: 4
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, 20:19
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
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, 19:03
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
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, 03:49
Default
  #6
RMF
New Member
 
Join Date: Aug 2012
Posts: 10
Rep Power: 4
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
mgg likes this.

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

Old   May 4, 2013, 06:23
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
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, 08:05
Default
  #8
RMF
New Member
 
Join Date: Aug 2012
Posts: 10
Rep Power: 4
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, 17:46
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,803
Rep Power: 38
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
__________________
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, 12:50
Default
  #10
RMF
New Member
 
Join Date: Aug 2012
Posts: 10
Rep Power: 4
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
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
Radiation interface hinca CFX 15 January 26, 2014 17:11
heat flux distribution gtheo CFX 2 April 27, 2011 03:36
Total heat transf. rate vs Total surface heat flux Renato Sousa FLUENT 0 August 22, 2005 10:34
monitoring dynamic heat flux through a surface abdnakhi FLUENT 0 August 15, 2005 09:57
Wall Heat Flux & Temperature Greg Perkins FLUENT 9 July 17, 2001 11:55


All times are GMT -4. The time now is 10:22.