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

How to access the Kla, "KD", in InterfaceCompositionPhaseChangePhaseSystem of MPE

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 2, 2022, 16:51
Default How to access the Kla, "KD", in InterfaceCompositionPhaseChangePhaseSystem of MPE
  #1
New Member
 
Shuji Chang
Join Date: Apr 2022
Posts: 4
Rep Power: 4
shuji_type97 is on a distinguished road
Hi Foamers,

Thanks for your reading.

I am still at the groping stage of using OpenFoam. I want to access the data "KD" calculated in the InterfaceCompositionPhaseChangePhaseSystem.C of MultiphaseEulerFoam because I want to get the Kla calculated in OpenFOAM and save it in the time folder.

May I ask whether is possible to access it by using mesh().lookupObject method? Actually, I tried that. Cause I know the Saturated Mass fraction, I want to calculate in ControlDict functions it by dividing mass transfer by rho like below:
Code:
code
       #{
            //Look up the dmdt
            const volScalarField& msp = mesh().lookupObject<volScalarField>("interfaceCompositionPhaseChange:dmidtfSp.O2.gasAndLiquid");
            
            //Look up the rho liquid
            const volScalarField& rho = mesh().lookupObject<volScalarField>("thermo:rho.liquid");
            
            volScalarField Kla
            (
               IOobject
               (
                  "Kla",
                  mesh().time().timeName(),
                  mesh(),
                  IOobject::NO_READ,
                  IOobject::AUTO_WRITE
               ),
               mesh(),
               dimensionedScalar("Kla", dimless/dimTime, 0.0)
            );
          
           Kla = msp/rho;
           
           if(mesh().time().outputTime())
           {
              Kla().write();
           }
           
       #};
No error was reported, but also no output in the time folder. I found in that Head file, dmidtfSp is private. Is this the reason why I cannot access it? I see my method is quite indirect. Is there any way to get the "KD" directly?

Any BIG BOSS could give me some suggestions about doing this?

Best wishes
shuji_type97 is offline   Reply With Quote

Old   November 4, 2022, 19:19
Default Solved
  #2
New Member
 
Shuji Chang
Join Date: Apr 2022
Posts: 4
Rep Power: 4
shuji_type97 is on a distinguished road
Hi Foamers,

Sorry for my stupidity. I make a fool mistake in my code.

in "functionsobjective" of controlDict, there is no block for "code". Now I use codeWrite, and it works.

Best wishes
shuji_type97 is offline   Reply With Quote

Reply

Tags
c++ solver class, controldict., multiphaseeulerfaom


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
How to access force values calculated by the function object. gigili206 OpenFOAM Programming & Development 1 June 27, 2023 12:15
Access UMean at particular run time absrocks OpenFOAM Running, Solving & CFD 3 July 7, 2021 21:29
[DesignModeler] DesignModeler Scripting: How to get Full Command Access ANT ANSYS Meshing & Geometry 53 February 16, 2020 16:13
Why is access to turbulence fields provided as const? mrishi OpenFOAM Programming & Development 3 January 23, 2020 13:51
Is there a way to access the gradient limiter in Fluent ? CFDYourself FLUENT 1 February 16, 2016 06:49


All times are GMT -4. The time now is 07:42.