CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   How to store a field in a new varianle and see it in paraFoam? (https://www.cfd-online.com/Forums/openfoam-post-processing/241486-how-store-field-new-varianle-see-parafoam.html)

saicharan662000@gmail.com March 1, 2022 23:46

How to store a field in a new varianle and see it in paraFoam?
 
Hello guys,
I am trying to assign alpha1 values to a variable A in compressibleInterFoam solver.
So I added a subroutine in createFields.H like this


Code:

volScalarField A
    (
    IOobject
        (
        "A",
        mesh.time().timeName(),
        mesh,
        IOobject::MUST_READ,
        IOobject::AUTO_WRITE
        ),
        mesh,
      dimensionedScalar("zero", dimless, 0.0) 
    );
A.ref() = mixture.alpha1();

But I could see alpha1 at first time step only. Later field is disappearing for remaining time steps.
Can anyone help me with this?

SHUBHAM9595 March 2, 2022 18:15

Hi Hari,

Can u see this new field in your intermediate time folders ? If yes, then something might be wrong with the OpenFOAM plugin of paraview. As an alternative try loading files via foamToVTK and then it should work.

saicharan662000@gmail.com March 2, 2022 23:10

Hello shubham,
Can you tell me How to load these files to vtk?
Thanks for your reply

SHUBHAM9595 March 3, 2022 14:31

Just Execute
Code:

foamToVTK
command in the home folder (where u hav your 0/ constant/ & system/ directory) ...this will by default write all the fields at all the time steps....open paraview (by
Code:

paraview
command) instead of paraFoam (as the issue might be from the FOAM's plugin of paaraview). Now File > Open > choose supported format - legacy VTK format....and then open the YOUR_TEST_CASE.vtk file

saicharan662000@gmail.com March 3, 2022 22:41

accessing alpha.water with a new variable.
 
1 Attachment(s)
Hello shubam,
I am attaching a pic so that u can see what's actually my problem is?
ALPHA1 which I named as "A" is staying the same through out the runtime.
Thanks for the reply


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