|
[Sponsors] |
February 19, 2019, 07:45 |
Fit the image using run time post processing
|
#1 |
New Member
Join Date: Feb 2019
Posts: 2
Rep Power: 0 |
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. |
|
February 20, 2019, 10:31 |
|
#2 |
New Member
Join Date: Feb 2019
Posts: 2
Rep Power: 0 |
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. |
|
August 7, 2019, 09:38 |
|
#3 |
Senior Member
Carlo_P
Join Date: May 2019
Location: Italy
Posts: 176
Rep Power: 8 |
Hey Gaubtas,
I'm managing to understand how to create pics in openFOAM. can you give me the controlDict file? Thanks a lot, Carlo |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] Extracting ParaView Data into Python Arrays | Jeffzda | ParaView | 30 | November 6, 2023 22:00 |
Inconsistencies in reading .dat file during run time in new injection model | Scram_1 | OpenFOAM | 0 | March 23, 2018 23:29 |
High Courant Number @ icoFoam | Artex85 | OpenFOAM Running, Solving & CFD | 11 | February 16, 2017 14:40 |
time averaged solution in post processing | coolwave | Fidelity CFD | 0 | September 4, 2015 09:29 |
AMI interDyMFoam for mixer nu problem | danny123 | OpenFOAM Programming & Development | 8 | September 6, 2013 03:34 |