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

How can a function gradient() equal a value?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2019, 17:36
Default How can a function gradient() equal a value?
  #1
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Hello Foamers,

I was looking through a tutorial page 110ish on changing boundaries, or modifying them for the files inside OpenFOAM-v1806/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/

and one of the things I came across in the convectiveHeatFluxFvPatchScalarField.C file was this line (113) for the gradient()?

gradient() = h.value() / k.value() * (Tsur.value() - T);

To compile this folder just use sudo bash and then wmake. This was for OpenFOAM 6?

I attached the complete source already compiled. convectiveHeatFlux.zip
massive_turbulence is offline   Reply With Quote

Old   January 21, 2019, 03:53
Default
  #2
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Actually, the function
Code:
gradient()
is the gradient of the function projected on the normal face to the patch : if f is a scalar, grad(f) is a vector then n.grad(f) is a scalar.

Cheers,
Cyp is offline   Reply With Quote

Old   January 28, 2019, 09:35
Default
  #3
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by Cyp View Post
Actually, the function
Code:
gradient()
is the gradient of the function projected on the normal face to the patch : if f is a scalar, grad(f) is a vector then n.grad(f) is a scalar.

Cheers,
Thanks! That part I do understand, it's more of a question about what class or C++ file this function is in. I guess it's an overloaded function with the parenthesis operator but I've never seen a function call made like this in C++ so I'm not sure how this is capable?
massive_turbulence is offline   Reply With Quote

Reply

Tags
call, equality operator, function


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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 12:04
Objective function gradient verification: surface vs volume integral formulation Evgeniy SU2 7 February 27, 2018 07:38
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 06:42
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 09:53
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51


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