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

[swak4Foam] convective boundary condition with spatially varying heat-transfer coeff and Tinf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2018, 13:35
Default convective boundary condition with spatially varying heat-transfer coeff and Tinf
  #1
Member
 
Sangeet
Join Date: Jun 2017
Location: India
Posts: 43
Rep Power: 9
sangeet is on a distinguished road
Hello,
I am currently trying to use a convective boundary condition with spatially varying heat-transfer coeff and Tinf. I have both of these as 9th order (please dont ask me why) polynomial function of non-dimensional radial distance from origin. In the code below, D is used to non-dimensionalize the radial distance which has been calculated by using pos().x and pos().y. My Tinf is Taw here. k and kg are thermal conductivites. thetaAW is the non-dimensionalized Taw. h is the heat transfer coeff. The p and q are just constants of the polynomials.

EDIT: I am using laplacianFoam.

Code:
target
    {
        type                groovyBC;
    variables        
"D=0.0063;
k=51.9;
kg=0.0323;
r=sqrt(pow(pos().x,2)+pow(pos().y,2))/D;
h=($p1*pow(r,8)+$p2*pow(r,7)+$p3*pow(r,6)+$p4*pow(r,5)+$p5*pow(r,4)+$p6*pow(r,3)+$p7*pow(r,2)+$p8*r+$p9)*kg/D;
thetaAW=($q1*pow(r,8)+$q2*pow(r,7)+$q3*pow(r,6)+$q4*pow(r,5)+$q5*pow(r,4)+$q6*pow(r,3)+$q7*pow(r,2)+$q8*r+$q9);
Taw=$Tinf+($Tg-$Tinf)*thetaAW;
f=1/(1+k/(h*mag(delta())));";
    value            uniform 294;
    valueExpression        "Taw";
    gradientExpression    "0";
    fractionExpression    "f";
    }
The problem is that this results in a completely blown up solution, if i instead use a constant Tinf i.e, by
Code:
valueExpression        "294";    //say
then the solution does not blow up. Can anyone help me out here please?
sangeet is offline   Reply With Quote

Old   January 29, 2018, 12:13
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 sangeet View Post
Hello,
I am currently trying to use a convective boundary condition with spatially varying heat-transfer coeff and Tinf. I have both of these as 9th order (please dont ask me why) polynomial function of non-dimensional radial distance from origin. In the code below, D is used to non-dimensionalize the radial distance which has been calculated by using pos().x and pos().y. My Tinf is Taw here. k and kg are thermal conductivites. thetaAW is the non-dimensionalized Taw. h is the heat transfer coeff. The p and q are just constants of the polynomials.

EDIT: I am using laplacianFoam.

Code:
target
    {
        type                groovyBC;
    variables        
"D=0.0063;
k=51.9;
kg=0.0323;
r=sqrt(pow(pos().x,2)+pow(pos().y,2))/D;
h=($p1*pow(r,8)+$p2*pow(r,7)+$p3*pow(r,6)+$p4*pow(r,5)+$p5*pow(r,4)+$p6*pow(r,3)+$p7*pow(r,2)+$p8*r+$p9)*kg/D;
thetaAW=($q1*pow(r,8)+$q2*pow(r,7)+$q3*pow(r,6)+$q4*pow(r,5)+$q5*pow(r,4)+$q6*pow(r,3)+$q7*pow(r,2)+$q8*r+$q9);
Taw=$Tinf+($Tg-$Tinf)*thetaAW;
f=1/(1+k/(h*mag(delta())));";
    value            uniform 294;
    valueExpression        "Taw";
    gradientExpression    "0";
    fractionExpression    "f";
    }
The problem is that this results in a completely blown up solution, if i instead use a constant Tinf i.e, by
Code:
valueExpression        "294";    //say
then the solution does not blow up. Can anyone help me out here please?
As soon as I hear "polynomial of 9th order" I run for the hills: that is bound to be unstable https://www.wikiwand.com/en/Runge%27s_phenomenon

If you have no better approximation and mujst use them:
  • have you tried plotting the polynomial in the expected range and checked that it looks "sane"
  • are you sure that you're not using the polyomial outside of the data range used for fitting (because that will make sure that it explodes)
  • try writing every time-step and check when and where the "explosion" starts


Bernhard
__________________
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 31, 2018, 00:37
Default
  #3
Member
 
Sangeet
Join Date: Jun 2017
Location: India
Posts: 43
Rep Power: 9
sangeet is on a distinguished road
Thank you so much for your reply. Really helped me, I just shrank the domain to within my fit interval.

Btw thank you for making swak4Foam. It has been an immense help.
sangeet is offline   Reply With Quote

Reply

Tags
groovybc


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



All times are GMT -4. The time now is 15:56.