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

How to include "ScalarFieldField" class in foamToVTK

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 25, 2023, 08:24
Default How to include "ScalarFieldField" class in foamToVTK
  #1
New Member
 
Anton
Join Date: Feb 2022
Location: Sweden
Posts: 6
Rep Power: 4
pierrevalis is on a distinguished road
Hey everyone,


I have ran a simulation using a custom solver which utilizes a kinematicCloud for the parcels. https://github.com/KAIST-LENSE/MP-PIC-PBE_CryFoam

To post process the data in paraview I convert everything to VTK using foamToVTK. All scalarFields and vectorFields of the parcels are converted to VTK without issue, but there is one property of the parcels which is not converted - the property has the class "ScalarFieldField". It is essentially an array for each parcel.



This is a snippet from when running foamToVTK,


Code:
        labels            : active origId typeId origProcId
        scalars           : d noNode kv minmodeTheta rho rhoc dTarget R_growthc nParticle age muc dr totalSource R_nucleationc supersatc tTurb
        vectors           : UCorrect UTurb U Uc
        spherical tensors :
        symm tensors      :
        tensors           :
As you see it doesn't handle this class, my question is how can I convert this data to something which is possible to analyze?


This is what the FoamFile looks like
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       scalarFieldField;
    location    "17.42/lagrangian/kinematicCloud";
    object      F;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


8400
(

30
(
1
1.67951e-11
3.44599e-23
4.60773e-35
4.51792e-47
3.46558e-59
2.16671e-71
1.13583e-83
5.09726e-96
1.98959e-108
6.83983e-121
2.09216e-133
5.74196e-146
1.424e-158
3.21043e-171
6.61408e-184
1.25083e-196
2.18009e-209
3.51424e-222
5.25569e-235
7.313e-248
9.49143e-261
1.1517e-273
1.30925e-286
1.39708e-299
1.40181e-312
0
0
0
0
)
...
)

Thanks in advance!


/Anton
pierrevalis is offline   Reply With Quote

Old   October 29, 2023, 17:41
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
No answer for you, but a question - what should an array of arrays represent in VTK? ie, which field type would this map to?
olesen is offline   Reply With Quote

Old   October 30, 2023, 06:51
Default
  #3
New Member
 
Anton
Join Date: Feb 2022
Location: Sweden
Posts: 6
Rep Power: 4
pierrevalis is on a distinguished road
Quote:
Originally Posted by olesen View Post
No answer for you, but a question - what should an array of arrays represent in VTK? ie, which field type would this map to?
Hey, I appreciate your question!

I am using a solver which is made to model crystallisation of lovastatin crystals through mixing a solution with an anti-solvent. This is done by using the Multiphase particle in cell solver (MP-PIC) which is then coupled with a population balance equation (PBE) in each lagrangian parcel. The distribution function of the crystals in the parcels is discretized into a set of bins which each contain a certain amount of crystals within a certain size interval. It is the number of crystals in each bin which is stored as an array, for all parcels in the domain which leads to the array of arrays. You can find the source to the original paper in the github-link in my original post.

I believe I have managed to circumvent this issue by using my limited c++ skills to alter the solver such that each field associated with each bin is written as a separate file instead.

Edit: Also I want it in VTK so I can save data for specific clips through paraview. There is probably an easier way to do this...

Last edited by pierrevalis; October 30, 2023 at 07:02. Reason: Addition information.
pierrevalis is offline   Reply With Quote

Reply

Tags
foamtovtk, kinematiccloud, mppicpbe, parcel, scalarfieldfield


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
Colliding Coal Cloud in coalCollidingChemistryFoam cmigueis OpenFOAM Programming & Development 28 November 24, 2022 03:13
[waves2Foam] Problems compiling waves2foam solver kenrichaiz OpenFOAM Community Contributions 15 January 2, 2021 03:58
Mapping of pointFields with topology changes mturcios777 OpenFOAM Programming & Development 16 August 8, 2016 12:34
Cht tutorial in 15 braennstroem OpenFOAM Running, Solving & CFD 197 June 10, 2015 04:02
Writing a CFD code davesmith_01 Main CFD Forum 13 October 6, 2012 05:25


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