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

What is the value of fvc::grad(U) at boundaries?

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By EmadTandis
  • 1 Post By EmadTandis
  • 2 Post By Zhiheng Wang

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2018, 09:41
Default What is the value of fvc::grad(U) at boundaries?
  #1
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 77
Rep Power: 16
EmadTandis is on a distinguished road
Hello
I am working on a elastic solver in which I need to calculate grad(U) at boundaries. I just read the code of gaussGrad.C and concluded that value of grad(U) at boundaries must be equal to patchInternalField value of grad(U), since it is zeroGradientType. But I got different experience. I need to know how grad(U) works at boundaries.
Any help will be appreciated
EmadTandis is offline   Reply With Quote

Old   May 11, 2018, 12:50
Default
  #2
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 77
Rep Power: 16
EmadTandis is on a distinguished road
I found the reason!
gradScheme class uses a function named "correctBoundaryCondition(vf,fGrad)" using which the gGrad at boundary is corrected by snGrad at boundaries.
I hope it can be of use for fellows.
hjasak likes this.
EmadTandis is offline   Reply With Quote

Old   May 15, 2018, 08:44
Default
  #3
Member
 
Emad Tandis
Join Date: Sep 2010
Posts: 77
Rep Power: 16
EmadTandis is on a distinguished road
Quote:
Originally Posted by EmadTandis View Post
I found the reason!
gradScheme class uses a function named "correctBoundaryCondition(vf,fGrad)" using which the gGrad at boundary is corrected by snGrad at boundaries.
I hope it can be of use for fellows.
Hello Dr Jasak
I need to calculate tangential component of grad(U) at boundaries more accurately. I guess that at boundary, it uses zero gradient condition for this component. Am I right? Is there any way to handle that or I have to develop a code by myself?
Thanks
Zhiheng Wang likes this.
EmadTandis is offline   Reply With Quote

Old   May 31, 2018, 07:24
Default Gradient along the boundary
  #4
Member
 
Zhiheng Wang
Join Date: Mar 2016
Posts: 72
Rep Power: 10
Zhiheng Wang is on a distinguished road
Let say You got T a parameter at boundary , or volScalarField or If you want Grad on surface as surfaceScalarField
surfaceScalarField SnGrad
(
fvc::snGrad(T) /// Normal component of Grad T
);

volScalarField SnVolGrad
(
IOobject
(
"SnVolGrad",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("SnVolGrad", T.dimensions()/dimLength, 0.0)
);

forAll(T.boundaryField(), patchi)
{
SnVolGrad.boundaryFieldRef()[patchi] = SnGrad.boundaryField()[patchi];

}

SnVolGrad.write();
/////////////////////////////////////////////////////////////////////////////////////////////////////

volVectorField GradientY
(
IOobject
(
"GradientY",
runTime.timeName(),
mesh
),

fvc::grad(T)
);


GradientY.write();

volScalarField GradientX
(
IOobject
(
"GradientX",
runTime.timeName(),
mesh
),
fvc::grad(T)().component(0)
);

GradientX.write();

volScalarField Grad_T
(
IOobject
(
"Grad_T",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("Grad_T", T.dimensions()/dimLength, 0.0)
);

forAll(SnVolGrad.boundaryField(),patchi)
{
Grad_T.boundaryFieldRef()[patchi] = GradientX.boundaryFieldRef()[patchi] + SnVolGrad.boundaryFieldRef()[patchi];
}
Grad_T.write();



Find suitable way any of above should work
Kummi and shiyu like this.
Zhiheng Wang 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
Mapped vs Cyclic Boundaries in OpenFOAM arsenis OpenFOAM Running, Solving & CFD 1 February 8, 2023 22:13
[ICEM] Can I define periodic boundaries in an unstructured mesh? Aoki ANSYS Meshing & Geometry 11 September 14, 2018 02:52
2D Rotating Detonation Engine Periodic Boundaries whitet86 FLUENT 2 June 25, 2015 12:04
Setting Flow/Pressure Boundaries in Floworks Eran FloEFD, FloWorks & FloTHERM 3 August 11, 2009 05:23
periodic boundaries - flow through a net PK FLUENT 0 July 12, 2007 12:58


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