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 Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By MSF
  • 2 Post By Andrea1984
  • 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: 9
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: 12
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: 179
Rep Power: 16
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: 179
Rep Power: 16
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 and reverseila like this.
Andrea1984 is offline   Reply With Quote

Old   August 27, 2020, 10:08
Default
  #5
New Member
 
Ran Yi
Join Date: May 2019
Posts: 9
Rep Power: 6
lizzy is on a distinguished road
Hi,

In this case, the value of Sc or Sct are given in the transportProperties just like nu? Please correct me if I'm wrong.

Thanks,
Ran
Quote:
Originally Posted by Andrea1984 View Post
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
lizzy is offline   Reply With Quote

Old   August 27, 2020, 16:45
Default
  #6
Senior Member
 
Andrea
Join Date: Feb 2012
Location: Leeds, UK
Posts: 179
Rep Power: 16
Andrea1984 is on a distinguished road
Yes, the only difference is that you don't have to specify a dimension set because both Sc and Sct are dimless.

Andrea
lizzy likes this.
Andrea1984 is offline   Reply With Quote

Reply

Tags
createfields.h, icofoam, simplefoam, transport properties


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 02:57.