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

Viscosity assignment in viscosity model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 16, 2018, 11:56
Default Viscosity assignment in viscosity model
  #1
Member
 
Martin
Join Date: Dec 2011
Posts: 40
Rep Power: 14
msaravia is on a distinguished road
Hi everyone!

I am taking as a template the viscosityModel class to write a class for magnetic materials constitutive laws.

I have some VERY BASIC doubts about the handling of the viscosity in, for example, the Newtonian model. The code is:

Code:
Foam::viscosityModels::Newtonian::Newtonian
(
    const word& name,
    const dictionary& viscosityProperties,
    const volVectorField& U,
    const surfaceScalarField& phi
)
:
    viscosityModel(name, viscosityProperties, U, phi),
    nu0_("nu", dimViscosity, viscosityProperties_),
    nu_
    (
        IOobject
        (
            name,
            U_.time().timeName(),
            U_.db(),
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        U_.mesh(),
        nu0_
    )
{}


// * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //

bool Foam::viscosityModels::Newtonian::read
(
    const dictionary& viscosityProperties
)
{
    viscosityModel::read(viscosityProperties);

    viscosityProperties_.lookup("nu") >> nu0_;
    nu_ = nu0_;

    return true;
}
My doubts are:

i) Does the operator >> in
Code:
viscosityProperties_.lookup("nu") >> nu0_
assigns the found value to mur0_ ?

ii) If nu_ is a private volScalarField and nu0_ is a dimensionedScalar, why the line mur_ = mur0_ works?


Thanks in advance!
msaravia is offline   Reply With Quote

Reply


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
Use of k-epsilon and k-omega Models Jade M Main CFD Forum 40 January 27, 2023 07:18
Viscosity model - error: object is not allocated - C++ beginner avila.vc OpenFOAM Programming & Development 5 February 14, 2022 02:00
Using a new implemented viscosity model with simpleFoam TemC OpenFOAM Running, Solving & CFD 6 March 8, 2017 03:07
Wrong multiphase flow at rotating interface Sanyo CFX 14 February 7, 2017 17:19
modelling solids viscosity in eulerian multiphase model derkaiser FLUENT 1 December 5, 2011 03:42


All times are GMT -4. The time now is 22:46.