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

Extract data with c++ code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2019, 05:47
Default Extract data with c++ code
  #1
New Member
 
Maxime
Join Date: Mar 2019
Location: Paris
Posts: 5
Rep Power: 7
MaximeB is on a distinguished road
Hi everyone,

I am currently working on a fsi model and I need to create my own routine to set an external effort on my solid.

The question is: how can I extract my Usolid at each time step to use them after.

I've tried something like:
Code:
double uSolidExtracted[3][nbElem];

uSolidExtracted = Usolid.boundaryField()[myPatch];
But, I have an error:
Code:
error: incompatible types in assignment of 'Foam::fvPatchField<Foam::Vector<double> >' to 'double [3][nbElem]'
Thank you,
Maxime.
MaximeB is offline   Reply With Quote

Old   May 14, 2019, 06:18
Default
  #2
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!


You are trying to pass a double array to a vector patch field, that's why you can't compile.
uSolidExtracted should be a type of fvPatchField<Vector<double>>, not a double. And It'll be fine.
I don't know your problem exactly but I think it is a bit easier to use a coded BC or write your own BC. Then you can manipulate your boundary faces in the correct place, not inside the solver.
simrego is offline   Reply With Quote

Old   May 14, 2019, 07:36
Default
  #3
New Member
 
Maxime
Join Date: Mar 2019
Location: Paris
Posts: 5
Rep Power: 7
MaximeB is on a distinguished road
Thank you for the reply

Yes I will consider to code my own BC
MaximeB 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
extract data from graphs in paraView (paraFoam) vitorspadetoventurin OpenFOAM Post-Processing 1 November 24, 2014 02:39
How to extract data from a specific layer of the grids? ripperjack OpenFOAM Post-Processing 1 October 29, 2014 08:57
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 10:52
data exchange between two binary code rt Main CFD Forum 0 May 30, 2007 05:37
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56


All times are GMT -4. The time now is 06:43.