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

Tensor Implementation into a Constructor

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 2, 2015, 08:40
Default Tensor Implementation into a Constructor
  #1
New Member
 
Paolo Capobianchi
Join Date: Sep 2014
Posts: 11
Rep Power: 2
pablitobass is on a distinguished road
Hello everyone,

I would like to ask some advices about the implementation of a new tensor into the constructor of an existing code.

I have already created the tensor as an IOobject. The tensor sigma_ into this code:


Code:
tau_
    (
        IOobject
        (
            "tau" + name,
            U.time().timeName(),
            U.mesh(),
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        U.mesh()
    ),  
    sigma_
    (
        IOobject
        (
            "sigma" + name,
            U.time().timeName(),
            U.mesh(),
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        U.mesh()
    ),
    I_
    (
        dimensionedSymmTensor
        (
            "I",
            dimensionSet(0, 0, 0, 0, 0, 0, 0),
            symmTensor
            (
                1, 0, 0,
                   1, 0,
                      1
            )
        )
    ),
    rho_(dict.lookup("rho")),
    etaS_(dict.lookup("etaS")),
    etaP_(dict.lookup("etaP")),
    lambda_(dict.lookup("lambda"))
{
   sigma_ = lambda_ * tau_ / etaP_ + I_;
}
In this way I am obliged to create a "0" folder file for sigma. I did it, but since the boundary condition for this tensor are unknown, the results I got so far are wrong. In practice I would like just to define the tensor and calculate its value from the equation that is shown at the end of the previous piece of code, that is
Code:
sigma_ = lambda_ * tau_ / etaP_ + I_;
Does anyone have an idea on how to do this?
p.s I have tried to use the options: IOobject::NO_READ, and IOobject::READ_IF_PRESENT, but I could not sort the problem out.

Thank you very much.

Cheers,
Paolo
pablitobass is offline   Reply With Quote

Reply

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
Class Time constructor maybee OpenFOAM Programming & Development 3 November 25, 2013 17:05
compile error in dynamicMesh and thermophysicalModels libraries NickG OpenFOAM Installation 2 August 30, 2013 07:42
MPI error with IBM XL compiler in the mesh constructor nick.not.used OpenFOAM Programming & Development 0 June 17, 2013 13:01
Inheriting kOmega: why can't I change the constructor? AlmostSurelyRob OpenFOAM 4 October 27, 2011 04:34
How does one initialise an OFstream in the constructor? bigphil OpenFOAM Programming & Development 2 August 18, 2011 08:48


All times are GMT -4. The time now is 02:17.