|
[Sponsors] | |||||
How to access the Kla, "KD", in InterfaceCompositionPhaseChangePhaseSystem of MPE |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Shuji Chang
Join Date: Apr 2022
Posts: 4
Rep Power: 5 ![]() |
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();
}
#};
Any BIG BOSS could give me some suggestions about doing this? Best wishes |
|
|
|
|
|
|
|
|
#2 |
|
New Member
Shuji Chang
Join Date: Apr 2022
Posts: 4
Rep Power: 5 ![]() |
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 |
|
|
|
|
|
![]() |
| Tags |
| c++ solver class, controldict., multiphaseeulerfaom |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [DesignModeler] DesignModeler Scripting: How to get Full Command Access | ANT | ANSYS Meshing & Geometry | 54 | August 20, 2025 00:15 |
| 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 |
| 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 |