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

varying cp with temperature .

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

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2011, 07:44
Default
  #21
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
It means that you are trying to solve for two variables within one equation.
akidess is offline   Reply With Quote

Old   February 22, 2011, 07:49
Default
  #22
Senior Member
 
Balkrishna Patankar
Join Date: Mar 2009
Location: Pune
Posts: 123
Rep Power: 17
balkrishna is on a distinguished road
Thanks. That is clear . However a formulation like below ,
Code:
fvScalarMatrix hEqn
    (
        fvm::ddt(rho, h)
      + fvm::div(phi, h)
      - fvm::laplacian(turbulence->alphaEff(), h)
     ==
        DpDt
    );
assumes constant k . How does one program without the constant k assumption ?
balkrishna is offline   Reply With Quote

Old   July 18, 2013, 05:12
Default
  #23
Member
 
Rohith
Join Date: Oct 2012
Location: Germany
Posts: 57
Rep Power: 13
RaghavendraRohith is on a distinguished road
Hi BalKrishna

Have you found the solution for this problem. How can some body solve 2 variables here.

Regards
Rohith
RaghavendraRohith is offline   Reply With Quote

Old   June 16, 2015, 10:10
Default
  #24
New Member
 
Sandip Wadekar
Join Date: Oct 2014
Posts: 17
Rep Power: 11
wadekar is on a distinguished road
Dear sir,
I am getting the error after using Foam::tanh(...)

The error is: call of overloaded ‘tanh(const int&)’ is ambiguous
c[ignCell] =1-Foam::tanh(ignSite.cells()[icelli]);

The code is:

forAll(ign.sites(), i)
{
const ignitionSite& ignSite = ign.sites()[i];

if (ignSite.igniting())
{
forAll(ignSite.cells(), icelli)
{
label ignCell = ignSite.cells()[icelli];

c[ignCell] =1-Foam::tanh(ignSite.cells()[icelli]);
}
}
}
wadekar is offline   Reply With Quote

Old   June 16, 2015, 10:18
Default
  #25
New Member
 
Sandip Wadekar
Join Date: Oct 2014
Posts: 17
Rep Power: 11
wadekar is on a distinguished road
Dear sir,
I am getting the error after using Foam::tanh(...)

The error is: call of overloaded ‘tanh(const int&)’ is ambiguous
c[ignCell] =1-Foam::tanh(ignSite.cells()[icelli]);

The code is:

forAll(ign.sites(), i)
{
const ignitionSite& ignSite = ign.sites()[i];

if (ignSite.igniting())
{
forAll(ignSite.cells(), icelli)
{
label ignCell = ignSite.cells()[icelli];

c[ignCell] =1-Foam::tanh(ignSite.cells()[icelli]);
}
}
}
wadekar is offline   Reply With Quote

Old   June 16, 2015, 10:41
Default
  #26
Member
 
Rohith
Join Date: Oct 2012
Location: Germany
Posts: 57
Rep Power: 13
RaghavendraRohith is on a distinguished road
Hi Sandip,

I hope tanh in openfoam takes only a value i.e if you define a dimensionedScalar then please define its value. See that there exists no Fields. I See Ignsites is a constant, i am not sure. If you can define it so.

Best Regards,
Rohith
RaghavendraRohith is offline   Reply With Quote

Old   June 16, 2015, 11:09
Default
  #27
New Member
 
Sandip Wadekar
Join Date: Oct 2014
Posts: 17
Rep Power: 11
wadekar is on a distinguished road
Thanks Raghavendra

I have tried with the interger value 5,
but still i am getting the same error:

call of overloaded ‘tanh(int)’ is ambiguous
c[ignCell] =Foam::tanh(5);
wadekar is offline   Reply With Quote

Old   June 18, 2015, 03:32
Default
  #28
New Member
 
Sandip Wadekar
Join Date: Oct 2014
Posts: 17
Rep Power: 11
wadekar is on a distinguished road
Hello friends,
I am compile the below mention code and i am getting the error

error: ‘distance’ was not declared in this scope
c = Foam::tanh[distance];

Code:
 
pointField meshPoints(mesh.points());
       label i(0);
       
       forAll( meshPoints, kk)
       {   
        vector curPoint = meshPoints[kk];
        vector distance = curPoint - vector(0, 0, 0);
     
        i++;
    scalar dis = mag(distance);    
        Info<< "distance = " << dis << endl;
  
      }
      Info << i << "  Points are changed" << endl;
       
    volScalarField  c = Foam::tanh[distance];
wadekar is offline   Reply With Quote

Old   June 30, 2016, 17:32
Default
  #29
New Member
 
elham usefi
Join Date: Apr 2016
Location: tabriz,iran
Posts: 13
Rep Power: 10
elham usefi is on a distinguished road
Quote:
Originally Posted by balkrishna View Post
When i rewrite the enthalpy equation as :
Code:
fvScalarMatrix hEqn
          (
           fvm::ddt(rho, h)
           + fvm::div(phi, h)
           ==
            fvm::laplacian(k,T)
           + DpDt + heatSource
           );
//In the above , k is thermal conductivity , T is temperature , h is enthalpy .
I get the following error :
Code:
incompatible fields for operation 
    [h] == [T]

    From function checkMethod(const fvMatrix<Type>&, const fvMatrix<Type>&)
    in file /home/ifmg/OpenFOAM/OpenFOAM-1.7.0/src/finiteVolume/lnInclude/fvMatrix.C at line 1181.
How to overcome it ?

Hi i knw this post is old but i need help on this problem
in my case Cp varies in different locations, so I need to write energy equation with enthalpy. I wrote it like this:
Code:
   fvScalarMatrix EEqn
    (
        fvm::div(phi, E)
      - fvm::laplacian(k_n/cp, E)
     ==
        fvOptions(rho,E)
    );

    EEqn.relax();

    fvOptions.constrain(EEqn);

    EEqn.solve();

    fvOptions.correct(E);
    T=E/cp;
    rhok = (1.0 - beta*(T - TRef));
but I got unrealistic solution that diverges!
can u help me?
elham usefi is offline   Reply With Quote

Old   July 1, 2016, 01:09
Default
  #30
Member
 
Rohith
Join Date: Oct 2012
Location: Germany
Posts: 57
Rep Power: 13
RaghavendraRohith is on a distinguished road
Hi,

The only error i see is that you have defined enthalpy as E=cp*T But it is
deltaE = cp*deltaT.

Hope it helps

Regards,
Rohith
RaghavendraRohith is offline   Reply With Quote

Old   July 3, 2016, 18:12
Default
  #31
New Member
 
elham usefi
Join Date: Apr 2016
Location: tabriz,iran
Posts: 13
Rep Power: 10
elham usefi is on a distinguished road
Quote:
Originally Posted by RaghavendraRohith View Post
Hi,

The only error i see is that you have defined enthalpy as E=cp*T But it is
deltaE = cp*deltaT.

Hope it helps

Regards,
Rohith
HI!
thank u for ur response but I didnt get it! if we replace E with cp*T in
Code:
    (
        fvm::div(phi, E)
      - fvm::laplacian(k_n/cp, E)
     ==
        fvOptions(rho,E)
    );
the result would be like:
Code:
    (
        fvm::div(phiCp, T)
      - fvm::laplacian(k_n, T)
     ==
        fvOptions(rhoCp,T)
    );
so isnt EEqn correct?

actually first I tried TEqn like this:
Code:
    (
        fvm::div(phiCp, T)
      - fvm::laplacian(k_n, T)
     ==
        fvOptions(rhoCp,T)
    );
but I didnt get correct results!
but when I assume that cp is constant! like this:
Code:
    (
        cp*fvm::div(phi, T)
      - fvm::laplacian(k_n, T)
     ==
        fvOptions(rhoCp,T)
    );
I get good results! although the variation of cp is not very significant!
so I tried EEqn
elham usefi is offline   Reply With Quote

Reply

Tags
density, property, specific heat, temperature

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with zeroGradient wall BC for temperature - Total temperature loss cboss OpenFOAM 12 October 1, 2018 06:36
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
monitoring point of total temperature rogbrito FLUENT 0 June 21, 2009 17:31
udf for varying inlet temperature aravind FLUENT 0 October 27, 2008 10:08
chemical reaction - decompostition La S. Hyuck CFX 1 May 23, 2001 00:07


All times are GMT -4. The time now is 00:31.