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

How to extract the normal pressure gradient from the momentum equation

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

Like Tree3Likes
  • 1 Post By mtgoncalves
  • 1 Post By Zhiheng Wang
  • 1 Post By mtgoncalves

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 18, 2017, 11:52
Default How to extract the normal pressure gradient from the momentum equation
  #1
New Member
 
Join Date: Aug 2016
Posts: 19
Rep Power: 10
mtgoncalves is on a distinguished road
I would like to evaluate the normal pressure gradient to a patch by moving all terms (except for the pressure gradient term) to the right side, followed by a dot product with the normal to a patch:

[pressure gradient term] . n = ([unsteady term] + [convection term] + [diffusion term]) . n

I can get the convection and the diffusion terms using UEqn.H(). How do I then proceed to perform the dot product between UEqn.H() and the normal to a patch?
Zhiheng Wang likes this.
mtgoncalves is offline   Reply With Quote

Old   September 27, 2017, 02:57
Default
  #2
Member
 
Zhiheng Wang
Join Date: Mar 2016
Posts: 72
Rep Power: 10
Zhiheng Wang is on a distinguished road
Quote:
Originally Posted by mtgoncalves View Post
I would like to evaluate the normal pressure gradient to a patch by moving all terms (except for the pressure gradient term) to the right side, followed by a dot product with the normal to a patch:

[pressure gradient term] . n = ([unsteady term] + [convection term] + [diffusion term]) . n

I can get the convection and the diffusion terms using UEqn.H(). How do I then proceed to perform the dot product between UEqn.H() and the normal to a patch?
why dont you use scalarField& Pbf = p.boundaryField[patchID].snGrad();
or scalarField& Pbf = p.boundaryField[patchID].Grad().component(normalDirec tion); where normaldirection is x=0, y=1 and z=2
shiyu likes this.
Zhiheng Wang is offline   Reply With Quote

Old   September 27, 2017, 12:13
Default
  #3
New Member
 
Join Date: Aug 2016
Posts: 19
Rep Power: 10
mtgoncalves is on a distinguished road
Maybe my understanding is lacking so please correct me if I'm wrong. But I think the following:

My reason is that I am not sure whether computing dp/dn from gradients of p is identical to computing dp/dn as function of U. U and p are not fully coupled due to the segregated solution approach of SIMPLE/PISO/PIMPLE (especially if you use loose tolerances and/or a low number of correctors).

So my conjecture is that the difference between

p.boundaryField[patchID].snGrad()

and

-[fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U)] . n

is larger than simply round-off errors.
Zhiheng Wang likes this.
mtgoncalves is offline   Reply With Quote

Old   September 27, 2017, 16:56
Default
  #4
Member
 
Zhiheng Wang
Join Date: Mar 2016
Posts: 72
Rep Power: 10
Zhiheng Wang is on a distinguished road
What solver you are using if you are using some case built for buoyancy and gravity along with heat transfer visit this page
http://caefn.com/openfoam/solvers-bu...nesqpimplefoam
Else interpolation of U corrects P as both are define at cell center in openFOAM like co-located variables. Coupling is all about to replace one in terms of other. I guess if you will extract dp/dn for incompresible or low mach number flows with out heat transfer and elevation there wont be any physical reason to change gradient of pressure along the flow accept velocity, but with heat transfer or buoyant flows density and elevation are considerable factors too.
SO you better name the solver and case you are using that will be helpful to answer that dp/dn extracts thermodynamic pressure or buoyant pressure.
Correct me if I am wrong
Regards
Zhiheng Wang is offline   Reply With Quote

Old   September 29, 2017, 10:50
Default
  #5
New Member
 
Join Date: Aug 2016
Posts: 19
Rep Power: 10
mtgoncalves is on a distinguished road
I am using pimpleFoam without any source terms (no gravity, buoyancy, etc.)

Anyway, I am almost there. I have the approximate code I need. Compiling, unfortunately, yields an error:

error: no match for ‘operator&’ (operand types are ‘Foam::tmp<Foam::GeometricField<Foam::Vector<doubl e>, Foam::fvsPatchField, Foam::surfaceMesh> >’ and ‘const Foam::Field<Foam::Vector<double> >’)

I am trying to do this:

linearInterpolate(-(fvc::ddt(U) + fvc::div(phi, U) - fvc::laplacian(nu, U))) & mesh.boundaryMesh()[boundary_label("numericalBoundary")].faceNormals()

So, in essence, I am trying to interpolate -(ddt(U) + div(phi, U) - laplacian(nu, U)) onto a patch which I named "numericalBoundary", and following this up by a dot product with the face normals of the patch.

How should I correctly implement this interpolation followed by a dot product?
mtgoncalves is offline   Reply With Quote

Reply

Tags
momentum equation, normals, patch, pressure gradient

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
Pressure Poisson equation Zach_uky CFD Freelancers 0 March 1, 2016 17:23
static vs. total pressure auf dem feld FLUENT 17 February 26, 2016 13:04
Pressure gradient normal to wall steph79 FLUENT 0 October 27, 2010 08:30
Derivation of Momentum Equation in Integral Form Demonwolf Main CFD Forum 2 October 29, 2009 19:53
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 15:57


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