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

How do createFields.H in interFoam read separate transport properties?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2018, 18:11
Default How do createFields.H in interFoam read separate transport properties?
  #1
New Member
 
Join Date: May 2018
Posts: 4
Rep Power: 8
shinri1217 is on a distinguished road
Hi all,

I'm new to OpenFOAM. This might be a dumb question, but I just cannot figure out. I'm working on modifying the interFoam solver, and I start to read the source code.

In the createFields.H, there are some codes as follow. I'm wondering how they get rho1 and rho2. I thought the "rho" in the IOobject should be the file name, but indeed rho is stored in transportProperties.

Also, how do they put rho for two different phases as rho1 and rho2? It is easy to understand in icoFoam, since there is lookup function there. However in the interFoam, I cannot find where is the lookup and how it identify two different rho in "transportProperties".

Code:
#include "createPhi.H"

Info<< "Reading transportProperties\n" << endl;
immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);

volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2());

const dimensionedScalar& rho1 = mixture.rho1();
const dimensionedScalar& rho2 = mixture.rho2();

// Need to store rho for ddt(rho, U)
volScalarField rho
(
    IOobject
    (
        "rho",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT
    ),
    alpha1*rho1 + alpha2*rho2
);
rho.oldTime();
Thanks for your reading and I hope someone could tell me why.

Thanks.
shinri1217 is offline   Reply With Quote

Old   June 17, 2018, 06:41
Default
  #2
Member
 
Vince
Join Date: Mar 2017
Posts: 45
Rep Power: 9
hyFoam is on a distinguished road
Hi Shinri,


rho1 and rho2 are read from the transportDict when constructing the mixture object.
Code:
immiscibleIncompressibleTwoPhaseMixture mixture(U, phi);
You can investigate this further by first looking at this file: $WM_PROJECT_DIR/src/transportModels/incompressible/incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C
Code:
nuModel1_
    (
        viscosityModel::New
        (
            "nu1",
            subDict(phase1Name_),
            U,
            phi
        )
    ),
    nuModel2_
    (
        viscosityModel::New
        (
            "nu2",
            subDict(phase2Name_),
            U,
            phi
        )
    ),

    rho1_("rho", dimDensity, nuModel1_->viscosityProperties()),
    rho2_("rho", dimDensity, nuModel2_->viscosityProperties()),
Thanks,


Vince
hyFoam is offline   Reply With Quote

Reply

Tags
createfields, interfoam


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
Read properties per component from an input file dictionary Cyp OpenFOAM Programming & Development 29 November 1, 2015 22:41
ReactingFoam Laminar flame simulation transport properties gbansal OpenFOAM Running, Solving & CFD 3 November 23, 2012 17:03
where we could read the properties value? agungwp CFX 3 May 26, 2009 02:32
Transport properties with PPDF combustion Erik Siemens 0 February 18, 2009 06:18
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 15:37


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