CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Accessing heat flux in velocity BC

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By jherb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2020, 22:28
Default Accessing heat flux in velocity BC
  #1
New Member
 
Daniel Grebe
Join Date: Feb 2020
Posts: 3
Rep Power: 6
turinturambar is on a distinguished road
TL;DR: I'm creating a custom boundary condition where the inlet velocity depends on the heat flux to the patch (radiation and conduction/convection). I'm trying to figure out how to access/calculate the heat flux in this boundary condition.

Long Version of the question:
I'm trying to implement the following boundary condition in openfoam: (Leccese 2017, page 35)
Quote:
\dot{q}_{w,cond} + \dot{q}_{w,rad} - \dot{m}_w[\delta h_{f} + c_s(T_f - T_{s,d})] = 0
I'm basing my new boundary condition off of flowRateInletVelocity boundary condition. The only part I'm having trouble with is the wall heat fluxes.

Thus far I've tried copying the procedure used in turbulentTemperatureRadCoupledMixed to calculate the heat flux, but it seems to access properties that it has inherited from temperatureCoupledBase. I'm not sure how I would be able to access those properties from my BC which is for velocity and not temperature. The following are the lines that I,m not sure how to implement in my code:
Quote:
const turbulentTemperatureRadCoupledMixedFvPatchScalarFi eld&
nbrField = refCast
<const turbulentTemperatureRadCoupledMixedFvPatchScalarFi eld>
(
nbrPatch.lookupPatchField<volScalarField, scalar>(TnbrName_)
);
On the other hand, if there is already an existing function or something like that to calculate the heat flux at a boundary, I'd be very glad to use that instead of calculation it my self.

For background, I'm developing this BC for use with reactingFoam to simulate the regression of a paraffin grain in a hybrid rocket motor.
turinturambar is offline   Reply With Quote

Old   July 20, 2020, 20:27
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
For a code example of calculating the wall heat flux have a look at the corresponding function object:
https://github.com/OpenFOAM/OpenFOAM...HeatFlux.C#L61
This might help you.
Also to access e.g. the pressure field on the patch, you could use code like :
Code:
const fvPatchScalarField& pPatch = patch().lookupPatchField<volScalarField, scalar>("p");
Gerry Kan likes this.
jherb is offline   Reply With Quote

Reply

Tags
boundary condition, heat flux, reactingfoam, velocity inlet


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
How do you use heat flux as a boundary condition in a non-wall area in UDF? JuBong Fluent UDF and Scheme Programming 2 July 2, 2018 22:15
Doubt - Variable Heat Flux input - UDF Neethu_N FLUENT 1 December 19, 2017 12:48
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 06:15
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00
Heat Flux at Internal walls or Fluid Solid Interface Mahi CFX 3 October 1, 2012 03:18


All times are GMT -4. The time now is 23:29.