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

Psat

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 15, 2012, 10:16
Default Psat
  #1
New Member
 
Nabil MEAH
Join Date: Apr 2012
Posts: 8
Rep Power: 5
bluemind is on a distinguished road
Hello,

I'm currently trying to implement the saturation pressure into the solver twoLiquidMixingFoam, so far what I have written is :

{

forAll(psat,celli){
if (ELSATl[celli] > 200.)
{
psat[celli]=cfit*exp(c1 + c2/(Tl[celli] ) +c3*log(Tl[celli]/one ) +c4*pow(Tl[celli],c5));
}
else
{
psat[celli]=0.*pfit;
}


}

}

But when I compile i get the following error message :

error: cannot convert ‘Foam::dimensioned<double>’ to ‘double’ in assignment

I've chosen the unit of the constant c1..c5 and one, such that they give a dimensionless term inside the exponential and the log function. But cfit has a dimension of pressure. Somehow when I withdraw the 'celli' term from psat I don't have any problem, but since I need to apply the temperature condition for all control volume, I feel like I have to keep (celli) this term.

Does anybody know how to solve the problem ?
bluemind is offline   Reply With Quote

Old   June 16, 2012, 08:56
Default
  #2
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
1) define Psat as volScalarField
2) if you did! , then pfit is dimensionedScalar but
pSat[celli] is Scalar so! use pfit.value() or same for cfit you can use cfit.value()

P.S:
T has dimension
T[celli] has no dimension
.value() return only value not dimension


now you should handle it
nimasam is offline   Reply With Quote

Old   June 18, 2012, 04:53
Default
  #3
New Member
 
Nabil MEAH
Join Date: Apr 2012
Posts: 8
Rep Power: 5
bluemind is on a distinguished road
Thank you nimasam for your answer,

I've tried what you said and the message error message is the same, so I added .value() to the constant c2 and c4 since they are not dimensionless :

{

forAll(psat,celli){
if (ELSATl[celli] > 200.)
{
psat[celli]=cfit.value()*exp(c1 + c2.value()/(Tl[celli] ) +c3*log(Tl[celli] ) +c4.value()*pow(Tl[celli],c5));
}
else
{
psat[celli]=0.*pfit.value();
}


}

}

The error message obtained is error: call of overloaded ‘log(double&)’ is ambiguous.

Do you have an idea of what the problem could be ?
bluemind is offline   Reply With Quote

Old   June 18, 2012, 05:26
Default
  #4
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
use
Foam::log instead of log
nimasam is offline   Reply With Quote

Old   June 18, 2012, 06:23
Default
  #5
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
you need to put .value() on all c's. c1, c3 and c5 as well
niklas is offline   Reply With Quote

Old   June 18, 2012, 07:33
Default
  #6
New Member
 
Nabil MEAH
Join Date: Apr 2012
Posts: 8
Rep Power: 5
bluemind is on a distinguished road
Thanks you nimasan and niklas,

I have taken your advice and it works, this is what I wrote :

{

forAll(psat,celli){
if (ELSATl[celli] > 200.)
{
psat[celli]=cfit.value()*Foam::exp(c1.value() + c2.value()/(Tl[celli] ) +c3.value()*Foam::log(Tl[celli] ) +c4.value()*Foam:ow(Tl[celli],c5.value()));
}
else
{
psat[celli]=0.*pfit.value();
}


}

}
bluemind 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
Multiphase flow and Phase change due to heat transferevaporation haghajani OpenFOAM Running, Solving & CFD 86 April 9, 2013 02:49


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