|
[Sponsors] |
How do createFields.H in interFoam read separate transport properties? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 15, 2018, 18:11 |
How do createFields.H in interFoam read separate transport properties?
|
#1 |
New Member
Join Date: May 2018
Posts: 4
Rep Power: 8 |
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. |
|
June 17, 2018, 06:41 |
|
#2 |
Member
Vince
Join Date: Mar 2017
Posts: 45
Rep Power: 9 |
Hi Shinri,
rho1 and rho2 are read from the transportDict when constructing the mixture object. Code:
immiscibleIncompressibleTwoPhaseMixture mixture(U, phi); 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()), Vince |
|
Tags |
createfields, interfoam |
|
|
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 |