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

Add an inverse field into laplacianFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 8, 2014, 21:16
Default Add an inverse field into laplacianFoam
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 615
Rep Power: 7
sharonyue is on a distinguished road
Hi guys,

This solver is just for validation. I add this into laplacianFoam:

createField:
Code:
volScalarField T
    (
        IOobject
        (
            "T",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );

    volScalarField TTT
    (
        IOobject
        (
            "TTT",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        scalar(1)/T,
        T.boundaryField().types()
    );

    volScalarField TT
    (
        IOobject
        (
            "TT",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        scalar(1)/TTT,
        T.boundaryField().types()
    );
solver:
Code:
solve
            (
                fvm::ddt(TT) - fvm::laplacian(DT, TT)
            );
I mean, I think TT is the same with T. So I expect that I get the same result of TT with T. But this two is not the same. See the picture:

Actually Im wondering if I can solve this equation(Regard this 1/exp(t) as a volScalarField), and get the field of T

\frac{{\partial \left( {{\rho _d}\frac{1}{{\exp \left( T \right)}}} \right)}}{{\partial t}} + \nabla  \cdot \left( {{\rho _d}{u_d}\frac{1}{{\exp \left( T \right)}}} \right) = .......
Attached Images
File Type: jpg 1.jpg (28.4 KB, 14 views)
File Type: jpg 2.jpg (27.6 KB, 12 views)
sharonyue is offline   Reply With Quote

Old   April 13, 2014, 21:23
Default
  #2
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 615
Rep Power: 7
sharonyue is on a distinguished road
Any ideas?
sharonyue is offline   Reply With Quote

Old   April 14, 2014, 23:26
Default
  #3
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 615
Rep Power: 7
sharonyue is on a distinguished road
Solved,

After this equation is solved. I have to rewrite this TT to write. Otherwise the solver will not wirte this TT. Then TT is the real T.
sharonyue is offline   Reply With Quote

Old   April 15, 2014, 00:36
Default
  #4
New Member
 
Francis Lee
Join Date: Jul 2013
Location: Jiangsu, China
Posts: 18
Rep Power: 3
epi_c is on a distinguished road
Quote:
Originally Posted by sharonyue View Post
Solved,

After this equation is solved. I have to rewrite this TT to write. Otherwise the solver will not wirte this TT. Then TT is the real T.
I can't get what you said.
epi_c is offline   Reply With Quote

Old   April 15, 2014, 03:24
Default
  #5
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 615
Rep Power: 7
sharonyue is on a distinguished road
Sorry, check it out:
Code:
    Info<< "Reading field T\n" << endl;

    volScalarField T
    (
        IOobject
        (
            "T",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );

    volScalarField TI
    (
        IOobject
        (
            "TI",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        scalar(1)/T,
        T.boundaryField().types()
    );
Code:
while (simple.correctNonOrthogonal())
        {
            solve
            (
                fvm::ddt(TI) - fvm::laplacian(DT, TI)
            );
        }      

T = scalar(1)/TI;

 runTime.write()
sharonyue 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
Adding Temperature field to IcoFoam yapalparvi OpenFOAM Running, Solving & CFD 13 January 18, 2014 09:25
problems after decomposing for running alessio.nz OpenFOAM 5 April 20, 2011 08:44
Convergence of CFX field in FSI analysis nasdak CFX 2 June 29, 2009 01:17
inverse poisson solver yamini FLUENT 0 March 19, 2006 12:26
Flow field measurement in turbomachinery! Wanlai Lin Main CFD Forum 3 September 3, 1999 12:06


All times are GMT -4. The time now is 05:21.