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

Write a calculated variable to postProcessing

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 29, 2021, 13:22
Default
  #21
Member
 
Vitor Monteiro
Join Date: Nov 2020
Posts: 32
Rep Power: 5
Vitor Monteiro is on a distinguished road
The code was exactly this one I was using later. But instead it was implemented at the multiphaseEulerFoam.C file and recompiled again.


Code:
forAll(fluid.multiComponentPhases(), multiComponentPhasei) // fases
      {
        phaseModel& phase = fluid.multiComponentPhases()[multiComponentPhasei];
        UPtrList<volScalarField>& Y = phase.YActiveRef();
        const volScalarField& alpha = phase;
        const volScalarField& rho = phase.rho();
    const scalarField& v = mesh().V();

        forAll(Y, i) // espécies
        {

     const double& m = gSum(alpha*rho*v);
     outputFilePtr() << mesh().time().timeName() << "    "
            << Y[i].name() << "    "
            << m  << endl;

         Info<< "coded totalMass output:" << endl
            << "    name: " << Y[i].name() << endl
        << "    mass: " << m << endl
            << endl;

     }; // fim for
       }; //fim for
Vitor Monteiro is offline   Reply With Quote

Reply

Tags
coded functions, gsum(), integration, postprocessing, write to file


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
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 7 December 15, 2020 13:06
Condensation as an additional variable Clark Griswold CFX 2 April 21, 2012 07:20
Additional variable as output of an expression Chander CFX 1 November 22, 2011 12:54
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas COMSOL 1 May 30, 2008 04:35
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 20:09


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