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

[swak4Foam] GroovyBC with power input (heat flux)

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

Like Tree2Likes
  • 2 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 9, 2015, 11:08
Default GroovyBC with power input (heat flux)
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I did not get the point to build a heat flux bc with groovy.
Why I use groovy is due to the fact that I also have to use some gaussian probability distribution.

At least I used this summary: http://www.modlab.lv/docs/2011/OpenF...Vilums_pdf.pdf

So what we get is the following situation:

T_f = f \cdot valueFraction + (1-f) \cdot (T_{centre} + gradExpr \cdot \delta)

f is the fractionExpression.

Now I want to use the gradient expression to evaluate the temperature at the face. We get the following expression:

\nabla T = \frac{q}{A} \cdot \frac{1}{kappa}

This is exactly the same expression like in the turbulentHeatFluxTemperature BoundaryCondition.

Now I expect, that the fractionExpression is zero. Therefore only the second term in the first eqn. is valid and we can write:

T_f = T_{centre} + gradExpr \cdot \delta

This is equal to:

\frac{T_f - T_{centre}}{\delta} = gradExpr

and that is equal to:

\nabla T = \frac{q}{A} \cdot \frac{1}{kappa}

In groovyBC I used the following code:
Code:
    top
    {

        type            groovyBC;
        variables       "Kappa=160;Q=10000;g=Q/sum(mag(Sf()))/Kappa;";
        fractionExpression "0";
        gradientExpression "g";
        value           uniform 300;
    }
If I run the simulation I will get a Temperature at the faces equal to zero and I do not know why? I think I made a stupid mistake. Any suggestion is appreciated.

Thanks in advance,
Kanarya and Marpole like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 9, 2015, 12:31
Default
  #2
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
Hi Tobi!

Quote:
Originally Posted by Tobi View Post
In groovyBC I used the following code:
Code:
    top
    {

        type            groovyBC;
        variables       "Kappa=160;Q=10000;g=Q/sum(mag(Sf()))/Kappa;";
        fractionExpression "0";
        gradientExpression "g";
        value           uniform 300;
    }
I haven't checked it much deeply, but with a slight glance I don't know if it's correct your definition of g. Maybe trying with this other g could solve it:
Code:
g=Q/mag(Sf())/Kappa
Let us know if it does the trick!

Btw, is the same mag(Sf()) than area()? Or does area() take the sign of normal direction into account?

Best regards,

Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   March 9, 2015, 14:43
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi Alex,

I need the whole area of the surface (not only one face). If I use yours, then the heatflux will increase extreamly (dividing by a very small number).

That is not the problem.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   March 9, 2015, 15:03
Default
  #4
Senior Member
 
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21
zfaraday will become famous soon enough
Quote:
Originally Posted by Tobi View Post
Hi Alex,

I need the whole area of the surface (not only one face). If I use yours, then the heatflux will increase extreamly (dividing by a very small number).

That is not the problem.
Yes, you are right Tobi, sorry, I wrote that after a quick glance to the formulation without checking the calculation on paper. I got confused because recently I have been using groovyBC aswell but in my case it was for convection heat transfer not fixed power and I worked with heat fluxes instead of total heat. That's why understood wrong your formulation, I didn't remember any sum(...) below the fraction. After checking deeper your formulation, it seems to be ok... Have you managed to solve the problem with temperatures?
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com

The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in!
zfaraday is offline   Reply With Quote

Old   March 10, 2015, 03:57
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

today it is working! I don't know what was the problem. The only thing that I changed today was to set the fractionExpression to zero but if I check the first post, I already did this yesterday. Don't know but its working proper now


To your question ... area() - never used this option in groovy. Is it really a groovyBC function? It is definitly not the same as above.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 12, 2016, 05:49
Default
  #6
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 15
Kanarya is on a distinguished road
Dear Tobi,

I would like to use groovyBC in order to apply constant 400 kW/m^2 heat flux at the wall but I could not find how?
can you help me?
I am using OF version 2.3.1
Thanks!

Quote:
Originally Posted by Tobi View Post
Hi,

today it is working! I don't know what was the problem. The only thing that I changed today was to set the fractionExpression to zero but if I check the first post, I already did this yesterday. Don't know but its working proper now


To your question ... area() - never used this option in groovy. Is it really a groovyBC function? It is definitly not the same as above.
Kanarya is offline   Reply With Quote

Old   January 12, 2016, 06:17
Default
  #7
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

I think you can use "turbulentlHeatTransferTemperature" for that. You can apply the flux [W/m^2]. There is no need for groovy. If you want to use groovy you have to derive the equation yourself / or just check the pdf in the first link. It shoud be sufficient.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 12, 2016, 07:07
Default
  #8
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 15
Kanarya is on a distinguished road
thanks for the quick answer...yes you are right!I thought so as well but I have laminar flow so I do not have "alphaEff" so it gives me a problem
Code:
--> FOAM FATAL ERROR: 

    request for volScalarField alphaEff from objectRegistry region0 failed
    available objects of type volScalarField are

24
(
alpha.water_0
cp
alpha.vapour
interfaceProperties:K
pSat
alpha.water
mCond
kappa
rho
mVap
p_rgh
nu
gh
nu1
((hEvap*(mCond+mVap))|T)
IF
p
rho_0
nu2
T
rhoCp_0
(-IF*SLarge)
rhoCp
((IF*SLarge)*TSat)
)


    From function objectRegistry::lookupObject<Type>(const word&) const
    in file /usr/local/OpenFOAM//OpenFOAM-2.3.1/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 198.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/usr/local/OpenFOAM//OpenFOAM-2.3.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/usr/local/OpenFOAM//OpenFOAM-2.3.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const& Foam::objectRegistry::lookupObject<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >(Foam::word const&) const in "/home/links/rek209/OpenFOAM/rek209-2.3.1/platforms/linux64GccDPOpt/lib/libphaseChangeTwoPhaseMixturesInterEvapCondPhaseChangeFoam.so"
#3  Foam::incompressible::turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() in "/usr/local/OpenFOAM//OpenFOAM-2.3.1/platforms/linux64GccDPOpt/lib/libincompressibleTurbulenceModel.so"
#4  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::updateCoeffs() at /usr/local/OpenFOAM//OpenFOAM-2.3.1/src/OpenFOAM/lnInclude/PtrListI.H:36
#5  Foam::fvMatrix<double>::fvMatrix(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at /usr/local/OpenFOAM//OpenFOAM-2.3.1/src/finiteVolume/lnInclude/fvMatrix.C:325
#6  Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::Sp<double>(Foam::DimensionedField<double, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at /usr/local/OpenFOAM//OpenFOAM-2.3.1/src/OpenFOAM/lnInclude/tmpI.H:191
#7  Foam::tmp<Foam::fvMatrix<double> > Foam::fvm::Sp<double>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at /usr/local/OpenFOAM//OpenFOAM-2.3.1/src/OpenFOAM/lnInclude/tmpI.H:176
#8  
 at /scratch/rkahraman/evapCond/interEvapCondPhaseChangeFoam_allfiles/interExCondPhaseChangeFoam/TEqn.H:36
#9  __libc_start_main in "/lib64/libc.so.6"
#10  
 in "/home/links/rek209/OpenFOAM/rek209-2.3.1/platforms/linux64GccDPOpt/bin/interExCondPhaseChangeFoam"
Aborted
Quote:
Originally Posted by Tobi View Post
Hi,

I think you can use "wallHeatTransfer" for that. You apply Tinf and alpha there. There is no need for groovy. If you want to use groovy you have to derive the equation that have to be implemented in groovy yourself / or just check the pdf in the first link.
Thanks for your help
Kanarya is offline   Reply With Quote

Old   January 12, 2016, 07:15
Default
  #9
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

it seems that its your own solver. Do you have a field implemented that correspond to "thermal diffusivity"? If yes then use that, otherwise implement it to your solver or change the BC or if you want, use groovy.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 12, 2016, 09:37
Default
  #10
Senior Member
 
Join Date: May 2011
Posts: 231
Rep Power: 15
Kanarya is on a distinguished road
Thanks again...the problem is I know only the thermal conductivity and heat flux, so I can not implement groovyBC...do you have any idea how i can build the groovyBC in order to have fix heat flux?

BEST!
Kanarya is offline   Reply With Quote

Old   January 12, 2016, 10:04
Red face
  #11
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

I don't know what your application is for and what you actually want to do but if I understand it correct you can use the groovy in the first post:
__________________
Keep foaming,
Tobias Holzmann
Tobi 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
Conjugate Heat Transfer: Wall Heat Flux at Coupled Walls? MaxHeat FLUENT 4 September 14, 2017 10:44
Forced convective heat transfere with fixed heat flux? BenFranklinIII OpenFOAM Running, Solving & CFD 0 July 30, 2015 05:31
[OpenFOAM] Paraview 3.98 - errors when saving geometry file pajot ParaView 1 September 28, 2013 10:45
Heat Flux Profile at Fluid-Porous Interface Hitch8 CFX 4 December 15, 2012 09:57
groovyBC nonuniform Wall heat flux Shoonya Main CFD Forum 0 August 11, 2010 13:03


All times are GMT -4. The time now is 12:30.