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

build volScalarField from scalarFields

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

Like Tree1Likes
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Display Modes
Old   November 9, 2017, 12:16
Default build volScalarField from scalarFields
  #1
New Member
 
Joaquín Neira
Join Date: Oct 2017
Posts: 12
Rep Power: 2
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,760
Rep Power: 29
alexeym will become famous soon enoughalexeym will become famous soon enough
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

Thread Tools
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 On
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 14 June 21, 2017 05:14
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 18:23
writing execFlowFunctionObjects immortality OpenFOAM Post-Processing 30 September 15, 2013 06:16


All times are GMT -4. The time now is 19:00.