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

Tensor Implementation into a Constructor

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2015, 08:40
Default Tensor Implementation into a Constructor
  #1
Member
 
Paolo Capobianchi
Join Date: Sep 2014
Posts: 35
Rep Power: 11
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


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
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries NickG OpenFOAM Installation 3 December 30, 2019 00:21
Class Time constructor maybee OpenFOAM Programming & Development 3 November 25, 2013 16:05
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 15:11.