CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

ForceCalcForNozzle

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2013, 07:52
Default ForceCalcForNozzle
  #1
New Member
 
Jason Pearl
Join Date: Jul 2013
Location: Burlington
Posts: 10
Rep Power: 12
jaason is on a distinguished road
Hi Foamers,
I'm trying to create a code to calculate the force and started out with Mach.C and altered it. I have a volScalarField of the differential Force in the x direction for all control volumes in the mesh.

How can I pick out certain points in my Force volScalarField and sum them?

I did some searching online and tried using the sytax F[cellI] and
F.mesh().C()[cellI] where F is the volScalarField.

I tried outputting the 80th entry in the field Info << F.mesh().C()[80] << endl
but the post processor would not compile.

Sorry for the lengthiness I basically just want to access 80 individual points in the volScalarField sum them and output that data to the terminal.

any advice would be greatly appreciated maybe I don't have an appropriate header?

Headers I'm using:
Vector.H
calc.H
fvc.H
jaason is offline   Reply With Quote

Old   August 14, 2013, 09:52
Default Found Solution
  #2
New Member
 
Jason Pearl
Join Date: Jul 2013
Location: Burlington
Posts: 10
Rep Power: 12
jaason is on a distinguished road
I figured it out had to switch it over to a scalarField to access the points then I could use indices with the scalarField. It had to be set equal to the internalfield of the volScalarField.
Code:
 scalarField intF=f.internalfield()
jaason 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



All times are GMT -4. The time now is 02:46.