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

why createFields.H for simpleFoam does not read transport properties and nu ?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By MSF
  • 1 Post By Andrea1984

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 14, 2017, 08:09
Default why createFields.H for simpleFoam does not read transport properties and nu ?
  #1
vs1
New Member
 
vaibhav
Join Date: Sep 2016
Posts: 15
Rep Power: 5
vs1 is on a distinguished road
Dear All,

Why createFields.H for simpleFoam does not read transport properties dict and nu but for icoFoam it does?

The code below is present in createFields.H for icoFoam but not in simpleFoam. Why is it so ?

Info<< "Reading transportProperties\n" << endl;

IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);

dimensionedScalar nu
(
transportProperties.lookup("nu")
)


Best,
Vaibhav
vs1 is offline   Reply With Quote

Old   September 15, 2017, 03:55
Default
  #2
MSF
New Member
 
Join Date: Apr 2014
Location: Germany
Posts: 24
Rep Power: 8
MSF is on a distinguished road
Hi,

simpleFoam uses transportModels and icoFoam doesn't. That is why in simpleFoam there is something like
Code:
 singlePhaseTransportModel laminarTransport(U, phi);
instead of the lines of code you posted. More about transportModels can be found in http://www.tfd.chalmers.se/~hani/kur...nFoam%20v2.pdf .

Best,
Moritz
vs1 likes this.
MSF is offline   Reply With Quote

Old   June 28, 2019, 12:54
Default
  #3
Senior Member
 
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 167
Rep Power: 11
Andrea1984 is on a distinguished road
Hi,

I understand it's an old thread but I figured it is better to ask here before opening a new one.

My understanding is that when we are dealing with simpleFoam and pimpleFoam we can't control directly from createFields.h what is read in from transportProperties since this file is now read when we instantiate our transport model, i.e.:


Code:
singlePhaseTransportModel laminarTransport(U, phi);

This is different from icoFoam where we read the transportProperties directly from createFields.H.

I am adding a passive scalar transport equation to pimpleFoam. The passive scalar equation is:


Code:
    alphat = turbulence->nut()/Sct;
    alphat.correctBoundaryConditions();

    volScalarField alphaEff("alphaEff", turbulence->nu()/Sc + alphat);

    fvScalarMatrix TEqn
    (
        fvm::ddt(T)
      + fvm::div(phi, T)
      - fvm::laplacian(alphaEff, T)
    );

In order to specify the laminar (Sc) and turbulent Schmidt (Sct) numbers for the passive scalar I have created two DimensionedScalar entries in createFields.H,i.e.:


Code:
dimensionedScalar Sc
(
   "Sc",
   dimless,
   0.71
);

dimensionedScalar Sct
(
   "Sct",
   dimless,
   0.85
);

Everything is working fine with this approach.

However it is a bit inconvenient that every time I want to change the values of Sc and Sct I have to do it manually in createFields.H and re-compile my solver. Is there any way to read these two parameters from transportProperties without having to modify the singlePhaseTransportModel class?

Many thanks,
Andrea
Andrea1984 is offline   Reply With Quote

Old   June 28, 2019, 14:09
Default
  #4
Senior Member
 
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 167
Rep Power: 11
Andrea1984 is on a distinguished road
I have actually managed to do achieve this by using:

Code:
// Schmidt number
dimensionedScalar Sc("Sc", dimless, laminarTransport);

// Turbulent Schmidt number
dimensionedScalar Prt("Sct", dimless, laminarTransport);
after

Code:
singlePhaseTransportModel laminarTransport(U, phi);
in createFields.H
Santiago likes this.
Andrea1984 is offline   Reply With Quote

Reply

Tags
createfields.h, icofoam, simplefoam, transport properties

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT -4. The time now is 23:16.