CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How to implement groovyBC as the temperature boundary conditon?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 17, 2020, 07:27
Default How to implement groovyBC as the temperature boundary conditon?
  #1
New Member
 
Masih
Join Date: Feb 2020
Posts: 22
Rep Power: 6
masih.mojarrad is on a distinguished road
Hi all,


My project is refueling hydrogen tank and I want to consider the heat transfer in the walls. I found out groovyBC type seems appropriate for my temperature boundary condition at the walls but the problem is that I could not figure it out how to implement it. I found two examples like below:


rightWall

{
type groovyBC;
variables "htot=100.0;Tinf=298.15;rho=2700.0;cp=900.0;k=DT*r ho*cp;"
valueExpression "Tinf";
fractionExpression "1.0/(1.0 + k/(mag(delta())*htot))";
}


AND


rightWall

{
type groovyBC;
gradientExpression "gradT";
fractionExpression "0";
variables "htot=100.0;Tinf=20.0;rho=800.0;cp=385.0;gradT =hto t/(DT*rho*cp)*(Tinf-T);"
timelines (
);

}


I cannot really understand the terms above .For my case, there are two heat transfer coefficients, one for hydrogen inside the tank and one for the air outside the tank. I have also the heat conductivity value of the wall but I do not know how to put them in groovyBC condition. To be more clear, in examples above, I do not know what heat transfer coefficient (htot) is refer to (the hydrogen or the air for my case) and how i can consider both coefficients. Besides, i do not know where fractionExpression comes from in the first example and how I can set it for my case. Can anyone help me in this case and probably introduce me a suitable source for implementing groovyBC?


Best regards,
Masih
masih.mojarrad is offline   Reply With Quote

Old   February 17, 2020, 11:03
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,680
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Is there a reason you are using groovyBC and not the externalWallHeatFluxTemperature BC?

groovyBC is a mixed boundary condition and allows you to use both Dirichlet and Neumann condition on various elements all belonging to the same surface. Convection is a Robin type condition.

valueExpression contains the Dirichlet value wherever a Dirichlet condition should be applied
gradientExpression contains the gradient value whenever the Neumann condition should be applied
fractionExpression is an expression that determines whether a particle element (i.e. cell face) is a Dirichlet type or a Neumann type by returning 0 or 1, respectively.
LuckyTran is offline   Reply With Quote

Old   February 17, 2020, 14:03
Default
  #3
New Member
 
Masih
Join Date: Feb 2020
Posts: 22
Rep Power: 6
masih.mojarrad is on a distinguished road
Hi

Thanks a lot for your reply. As a matter of fact, I am a beginner in openfoam and after reading your post I have searched about externalWallHeatFluxTemperature BC and I found out this was much more reasonable than groovyBC. So, I would really like appreciate it. Just one more thing, I wonder which kappaMethod i should use. I already know there are four different types but there are very few explanation about them. I guess it is better to select fluidThermo in this case as the fluid is turbulent and compressible. What do you think? Do you probably have any source about them? Here is the only source I have found which does not seem sufficient.


https://github.com/OpenFOAM/OpenFOAM...eCoupledBase.H


Best regards,
Masih
masih.mojarrad is offline   Reply With Quote

Old   February 18, 2020, 11:37
Default
  #4
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,680
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
The kappa that you need to provide is for the heat conduction through the solid layers. But because this boundary condition is a derived BC, it gives you a third (useless) option to possiblyuse a kappa from the fluid region.

Use
Code:
kappaMethod lookup;
kappa banana;
To use a field named banana as the kappa field.

Use kappaMethod fluidThermo to use the fluid kappa specified in your thermo dict. You don't want to do this.

Likewise kappaMethod solidThermo will use the solid kappa from the thermo dict.

You want to do either lookup or solidThermo.
LuckyTran is offline   Reply With Quote

Old   February 19, 2020, 09:19
Default
  #5
New Member
 
Masih
Join Date: Feb 2020
Posts: 22
Rep Power: 6
masih.mojarrad is on a distinguished road
I used your codes but I faced to this error:


--> FOAM FATAL ERROR:
Did not find field banana on mesh region0 patch upperWall
Please set 'kappa' to the name of a volScalarField or volSymmTensorField.


I have no idea how to deal with it. Should I add this field to my solver??? This is my code:


upperWall
{
type externalWallHeatFluxTemperature;
mode coefficient;
Ta constant 298.15;
h uniform 10.0;
thicknessLayers (0.1 0.2);
kappaLayers (1 2);
kappaMethod lookup;
kappa banana;
value $internalField;
}
Thanks in advance for your time and for your help.
masih.mojarrad is offline   Reply With Quote

Old   February 19, 2020, 11:06
Default
  #6
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,680
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
You need to put the field name of your simulation. I don't have your setup to know how your kappa field is being set.


banana is just a dummy name I came up with (it's a safe word since there isn't any field named banana in openfoam). Using banana as name will guarantee an error.
LuckyTran is offline   Reply With Quote

Old   February 20, 2020, 10:53
Default
  #7
New Member
 
Masih
Join Date: Feb 2020
Posts: 22
Rep Power: 6
masih.mojarrad is on a distinguished road
I am really confused about this problem. I feel my questions seem silly but do I need to add a (kappa) field to zero folder? If so, does the solver recognize it or should I modify the solver as well?
I attached the zero and constant folders as well.
Attached Files
File Type: zip CFD-online.zip (8.1 KB, 2 views)
masih.mojarrad is offline   Reply With Quote

Old   July 13, 2021, 02:14
Default
  #8
New Member
 
Hosam Alrefaie
Join Date: Jul 2021
Posts: 24
Rep Power: 4
HosamAlrefaie is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
You need to put the field name of your simulation. I don't have your setup to know how your kappa field is being set.


banana is just a dummy name I came up with (it's a safe word since there isn't any field named banana in openfoam). Using banana as name will guarantee an error.
from where we can find the field name?
HosamAlrefaie 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
Out File does not show Imbalance in % Mmaragann CFX 5 January 20, 2017 10:20
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 08:44
[swak4Foam] Temperature Jump boundary condition in groovyBC hoseinhd OpenFOAM Community Contributions 2 January 13, 2016 00:52
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32


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