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

Add an inverse field into laplacianFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread 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: Beijing, China
Posts: 838
Rep Power: 17
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, 17 views)
File Type: jpg 2.jpg (27.6 KB, 15 views)
sharonyue is offline   Reply With Quote

Old   April 13, 2014, 21:23
Default
  #2
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
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: Beijing, China
Posts: 838
Rep Power: 17
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
 
Jianzhi Li
Join Date: Jul 2013
Location: Shanghai, China
Posts: 27
Rep Power: 12
epi_c is on a distinguished road
Send a message via Skype™ to epi_c
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: Beijing, China
Posts: 838
Rep Power: 17
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


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
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 04:49
Adding Temperature field to IcoFoam yapalparvi OpenFOAM Programming & Development 14 November 19, 2015 04:57
Convergence of CFX field in FSI analysis nasdak CFX 2 June 29, 2009 01:17
inverse poisson solver yamini FLUENT 0 March 19, 2006 11: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 00:32.