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

Fit the image using run time post processing

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2019, 06:45
Default Fit the image using run time post processing
  #1
New Member
 
Join Date: Feb 2019
Posts: 2
Rep Power: 0
Gaubtas is on a distinguished road
Hi I am using run-time post processing to get a nicely generated image after my OpenFOAM case is done. I do this as a part of automating the CFD process. The part I am stuck on is scaling the result to fit the image.

controlDict contains camera section which adjusts what I'm looking for.

camera {
nFrameTotal 1;
zoom _zoom; //replaced at runtime by a script, but how do I compute this?
parallelProjection yes;
position (_halfWidth, _halfHeight, 1); //center the view
focalPoint (_halfWidth, _halfHeight, 0); //center the view
clipBox (0,0,0)(_width, _height, 1);
}

The cases are essentially 2d. Problem for me is that I want to fit the image to the entire resolution. There is some kind of correlation between this and the aspect ratio of the simulation (setting zoom to be aspect ratio almost works). I can't figure out why or what is the exact behaviour. Ideally I would like some padding on the right side and put my scale legend there.

Coming from a 3D background I would imagine that you'd need to define a projection plane for a parallel (ortho) projection, but it seems the only parameter that does something similar is zoom, which seems arbitrary.
Gaubtas is offline   Reply With Quote

Old   February 20, 2019, 09:31
Default
  #2
New Member
 
Join Date: Feb 2019
Posts: 2
Rep Power: 0
Gaubtas is on a distinguished road
Seems I've found a solution.

Ended up using:
camera
{
viewAngle 90;
nFrameTotal 1;
parallelProjection no;
focalPoint (_halfWidth _halfHeight 0.0);
up (0 1 0);
position (_halfWidth _halfHeight _offsetHalfHeight);
}

for _offsetHalfHeight (distance away from the mesh):
If your mesh has 0 depth, or all depth is in -z coordinated (front face is z 0) then you can use half of the height of the simulation space. If it is not you have to add half of the depth of the mesh to half of the height of the mesh.

Still not sure how parallelProjection behaves.
Gaubtas is offline   Reply With Quote

Old   August 7, 2019, 08:38
Default
  #3
Senior Member
 
Carlo_P
Join Date: May 2019
Location: Italy
Posts: 176
Rep Power: 7
Carlo_P is on a distinguished road
Hey Gaubtas,
I'm managing to understand how to create pics in openFOAM.

can you give me the controlDict file?
Thanks a lot,
Carlo
Carlo_P 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
[General] Extracting ParaView Data into Python Arrays Jeffzda ParaView 30 November 6, 2023 21:00
Inconsistencies in reading .dat file during run time in new injection model Scram_1 OpenFOAM 0 March 23, 2018 22:29
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 13:40
time averaged solution in post processing coolwave Fidelity CFD 0 September 4, 2015 08:29
AMI interDyMFoam for mixer nu problem danny123 OpenFOAM Programming & Development 8 September 6, 2013 02:34


All times are GMT -4. The time now is 17:38.