CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] groovyBC for defining heat influx at the boundary (https://www.cfd-online.com/Forums/openfoam-community-contributions/140851-groovybc-defining-heat-influx-boundary.html)

pradeepramesh August 25, 2014 01:06

groovyBC for defining heat influx at the boundary
 
1 Attachment(s)
Hi ,

I am using laplacianfoam for a heat-block case. I have gone thru the discussion - "Mixed BC - heat transfer - laplacianFoam"
http://www.cfd-online.com/Forums/ope...acianfoam.html.

From the forum discussions - "externalWallHeatFluxTemperature" and "groovyBC" were pointed out.

I am interested to apply heat influx at the boundary wall.Please find the attached snapshot for more info.

How to apply "groovyBC" for defining heat influx at the boundary in a heat-block?

Thank you,
Pradeep

gschaider August 25, 2014 17:38

Quote:

Originally Posted by pradeepramesh (Post 507590)
Hi ,

I am using laplacianfoam for a heat-block case. I have gone thru the discussion - "Mixed BC - heat transfer - laplacianFoam"
http://www.cfd-online.com/Forums/ope...acianfoam.html.

From the forum discussions - "externalWallHeatFluxTemperature" and "groovyBC" were pointed out.

I am interested to apply heat influx at the boundary wall.Please find the attached snapshot for more info.

How to apply "groovyBC" for defining heat influx at the boundary in a heat-block?

Thank you,
Pradeep

With "fractionExpression '0'" you're on the right track. What gradientExpression is supposed to to be depends on your physics (which heat-flux you want to prescribe). Rewrite it so that you get an expression "dT/dx = ....". Then you'll just have to take what is on the right hand side of that expression and write it down as a groovyBC-expression (Note: x in this case is not the x in the cartesian coordinates but normal to the wall)

pradeepramesh August 25, 2014 22:33

Thank you very much Bernhard

pradeepramesh August 26, 2014 00:02

Dear Bernhard,

For a case, flux is ------------>>>> q = -(k) * (dT/dx)

(dT/dx) = - q /k

We have :

"q" is the heat flux : q = 10 (W/m2),

"k" is the thermal Conductivity of the material : k = 200 (W/mK)


HTML Code:

Outwall
{
        type                          groovyBC;
        value                        uniform 293;
        gradientExpression          “(-q)/k";
        fractionExpression          "0";
        variables                          “q=10;k=200";
}

I would like request your feedback on the above mentioned BC.

Thank you!

gschaider August 26, 2014 08:12

Quote:

Originally Posted by pradeepramesh (Post 507775)
Dear Bernhard,

For a case, flux is ------------>>>> q = -(k) * (dT/dx)

(dT/dx) = - q /k

We have :

"q" is the heat flux : q = 10 (W/m2),

"k" is the thermal Conductivity of the material : k = 200 (W/mK)


HTML Code:

Outwall
{
        type                          groovyBC;
        value                        uniform 293;
        gradientExpression          “(-q)/k";
        fractionExpression          "0";
        variables                          “q=10;k=200";
}

I would like request your feedback on the above mentioned BC.

Thank you!

That should work. Sign depends on your definition of the flux.

I usually limit myself to answers about the technical aspects of swak4Foam. Physics is your own responsibility

pradeepramesh August 26, 2014 19:54

Thank you very much. It worked!

costrom November 13, 2014 22:34

would it be possible to use a 'q' file that is the output from a different solver instead of defining one constant value for q on the boundary?

gschaider November 14, 2014 05:01

Quote:

Originally Posted by costrom (Post 519102)
would it be possible to use a 'q' file that is the output from a different solver instead of defining one constant value for q on the boundary?

Currently no. Unless the data is a 1D-function q(s). Then you can use a lookup

I've explained it a number of times in different places: it is not THAT easy to do it in a general way (fileformats, different discretizations, error handling, parallel etc)

costrom November 14, 2014 05:52

I apologize for asking a question that has been answered elsewhere, but...

I have a qMean file resulting from a dsmcFoam run, and I would like to use the heat fluxes from that as a boundary condition for a laplacianFoam runcase. is this currently possible in openFOAM 2.3.x without editing the *.h, *.c files?

gschaider November 14, 2014 07:16

Quote:

Originally Posted by costrom (Post 519142)
I apologize for asking a question that has been answered elsewhere, but...

I have a qMean file resulting from a dsmcFoam run, and I would like to use the heat fluxes from that as a boundary condition for a laplacianFoam runcase. is this currently possible in openFOAM 2.3.x without editing the *.h, *.c files?

I'm not familiar with that solver. qMean is average in time or average in space as a function of time or space?

Depending on that timeVaryingMappedFixedValue might be able to help you

calf.Z January 14, 2019 06:38

Quote:

Originally Posted by gschaider (Post 507751)
With "fractionExpression '0'" you're on the right track. What gradientExpression is supposed to to be depends on your physics (which heat-flux you want to prescribe). Rewrite it so that you get an expression "dT/dx = ....". Then you'll just have to take what is on the right hand side of that expression and write it down as a groovyBC-expression (Note: x in this case is not the x in the cartesian coordinates but normal to the wall)

Thank you for your hints. If my case doesn't consider the materials of the Wall, just having the internal mesh in fluid, how should I know about k and dT/dx? I want to give the constant heat flux on wall and I just know q. Thank you.

gschaider January 15, 2019 05:47

Quote:

Originally Posted by calf.Z (Post 721862)
Thank you for your hints. If my case doesn't consider the materials of the Wall, just having the internal mesh in fluid, how should I know about k and dT/dx? I want to give the constant heat flux on wall and I just know q. Thank you.


There are boundary conditions that implement constant heat-flux in OpenFOAM. If your heat-flux has no spatial or temporal distribution then I'd recommend using these.
If you want to/have to use groovyBC the heat conductivity of the fluid is sufficient information to calculate the temperature gradient

calf.Z January 15, 2019 21:55

Quote:

Originally Posted by gschaider (Post 721986)
There are boundary conditions that implement constant heat-flux in OpenFOAM. If your heat-flux has no spatial or temporal distribution then I'd recommend using these.
If you want to/have to use groovyBC the heat conductivity of the fluid is sufficient information to calculate the temperature gradient

Thank you for your reply.

I think I know the thermo conductivity of fluid in my case but I am using tabular method to get these thermopropertities. So kappa is changing with T and P and read from tabulated table.

And I am using externalWallHeatFluxTemperature BC to give the constant heat flux. But I am not sure if kappaMethod : fluidThermo is suitable for my case.

I use wallHeatFlux to check the heat flux after simulation. The result is far diffrernt from the setting one. But when I use #include wallHeatFlux to check heat flux during running, it give other heat flux values which are closer to the setting one in BC.
So I am confused about the different behaviors of the utility. I just use it in different moments and it gives me different values.

Any hint is highly appreciated.


All times are GMT -4. The time now is 00:06.