|
[Sponsors] |
April 12, 2021, 16:23 |
Visualize scalarCodedSource in paraFoam
|
#1 |
Member
Jonathan Wells
Join Date: Oct 2020
Location: Indiana
Posts: 44
Rep Power: 5 |
I'm coding a scalarCodedSource to use with my case, and I'm trying to visualize the results in paraFoam. Is there a way to make it write the result of the calculation at each time step?
Essentially, I am making the field Code:
scalarField& qq = eqn.source(); qq += ...; |
|
April 13, 2021, 10:13 |
|
#2 |
Member
Jonathan Wells
Join Date: Oct 2020
Location: Indiana
Posts: 44
Rep Power: 5 |
Anyone? I know there has to be a way to do this.
|
|
April 13, 2021, 11:58 |
|
#3 |
New Member
Join Date: May 2019
Posts: 16
Rep Power: 6 |
Hi Jonathan,
I'm not sure, if it's the best solution, but this might work: Code:
qq += ...; volScalarField volqq = volScalarField::New("qq",mesh_, 0.0); volqq.primitiveFieldRef() = qq; volqq.write(); |
|
April 14, 2021, 11:18 |
|
#4 |
Member
Jonathan Wells
Join Date: Oct 2020
Location: Indiana
Posts: 44
Rep Power: 5 |
For whatever reason, that causes the solution to take much longer and won't load anything at all in paraFoam.
|
|
April 14, 2021, 11:28 |
|
#5 |
New Member
Join Date: May 2019
Posts: 16
Rep Power: 6 |
So it also doesn't create qq files in your time folders?
|
|
April 14, 2021, 14:47 |
|
#6 |
Member
Jonathan Wells
Join Date: Oct 2020
Location: Indiana
Posts: 44
Rep Power: 5 |
||
April 14, 2021, 18:52 |
|
#7 |
Member
Jonathan Wells
Join Date: Oct 2020
Location: Indiana
Posts: 44
Rep Power: 5 |
Correction*
I realized that your code was printing the qq field every time step, rather than every 500 like my controlDict file specifies. That's almost certainly the cause of the slowdown, as my time step is 1e-5 and I'm running for several seconds. I guess I need to figure out how to make it write only at the same intervals as the rest of my data. |
|
April 15, 2021, 03:32 |
|
#8 |
New Member
Join Date: May 2019
Posts: 16
Rep Power: 6 |
Ah, ok, I thought you wanted to write it at each time step
This should do it: Code:
if (mesh_.time().writeTime()) { volScalarField volqq = volScalarField::New("qq",mesh_, 0.0); volqq.primitiveFieldRef() = qq; volqq.write(); } |
|
April 15, 2021, 15:09 |
|
#9 |
Member
Jonathan Wells
Join Date: Oct 2020
Location: Indiana
Posts: 44
Rep Power: 5 |
This worked perfectly! Thank you so much for the help!
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] Unable to launch parafoam & | boonhow | ParaView | 5 | March 23, 2022 08:09 |
[OpenFOAM.org] paraFoam Fatal Error upon run | Gallienus | OpenFOAM Installation | 2 | April 14, 2020 19:23 |
How to visualize cellSets in paraFoam with streamlines | anon_q | OpenFOAM Post-Processing | 0 | October 17, 2018 10:25 |
[OpenFOAM.com] paraFoam cannot open due to Qt issues - [Solved/Information] | u2berggeist | OpenFOAM Installation | 2 | July 2, 2018 17:03 |
[OpenFOAM] OpenFoam (Ubuntu): paraFoam via Xming+PuTTY | raketenmaid | ParaView | 4 | February 5, 2013 05:20 |