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

build volScalarField from scalarFields

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 9, 2017, 12:16
Default build volScalarField from scalarFields
  #1
Member
 
Joaquín Neira
Join Date: Oct 2017
Posts: 38
Rep Power: 9
cojua8 is on a distinguished road
Hello,

I'm trying to build a volScalarField from a product of two scalarField

Code:
dimensionedScalar nu
(
    "nu",
    dimViscosity,
    transportProperties.lookup("nu")
);

dimensionedScalar rhoInfValue
(
    "rhoInf",
    dimDensity,
    transportProperties.lookup("rhoInf")
);

volScalarField mu
(
    IOobject
    (
        "mu",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    nu*rhoInfValue
);
but it doesn't work
is there any way to do this?
cojua8 is offline   Reply With Quote

Old   November 9, 2017, 17:35
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

you are trying to make a volScalarField from a product of two dimensionedScalars. So you should use another constructor: this one. In terms of code it is:

Code:
volScalarField mu
(
    IOobject
    (
        "mu",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    mesh,
    nu*rhoInfValue
);
cojua8 likes this.
alexeym is offline   Reply With Quote

Reply

Tags
scalarfield, volscalarfield


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
Error in compiling new drag model k.farnagh OpenFOAM Programming & Development 13 May 21, 2016 04:08
execFlowFunctionObjects - unknown field problem Toorop OpenFOAM Post-Processing 16 March 14, 2016 04:25
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 23:38
Building from Source on Windows using Cygwin64 ericthefatguy SU2 2 May 12, 2015 19:23
writing execFlowFunctionObjects immortality OpenFOAM Post-Processing 30 September 15, 2013 07:16


All times are GMT -4. The time now is 06:01.