|
[Sponsors] |
August 14, 2013, 07:52 |
ForceCalcForNozzle
|
#1 |
New Member
Jason Pearl
Join Date: Jul 2013
Location: Burlington
Posts: 10
Rep Power: 12 |
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 |
|
August 14, 2013, 09:52 |
Found Solution
|
#2 |
New Member
Jason Pearl
Join Date: Jul 2013
Location: Burlington
Posts: 10
Rep Power: 12 |
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() |
|
|
|