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

error: no match for ‘operator>’

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 28, 2011, 12:32
Default error: no match for ‘operator>’
  #1
Member
 
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 5
hawkeye321 is an unknown quantity at this point
Hi Guys
I want to add a if condition in the following form to my code

if (hStar > TLSTar)
{
gl = 1;
}

but when I compile it the following error is being produced
"error: no match for ‘operator>’ in ‘hStar > TLStar’"
hStar is a VolScalarField and TLStar is dimensioned scalar field.

I would appreciate if you help me fix it!
hawkeye321 is offline   Reply With Quote

Old   September 28, 2011, 15:53
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Shiraz, Iran
Posts: 739
Blog Entries: 1
Rep Power: 14
Amir is on a distinguished road
Quote:
Originally Posted by mahdiiowa View Post
Hi Guys
I want to add a if condition in the following form to my code

if (hStar > TLSTar)
{
gl = 1;
}

but when I compile it the following error is being produced
"error: no match for ‘operator>’ in ‘hStar > TLStar’"
hStar is a VolScalarField and TLStar is dimensioned scalar field.

I would appreciate if you help me fix it!
They should be the same type!
try this:
(hStar.value()) > (TLSTar.value())
__________________
Amir
Amir is offline   Reply With Quote

Old   September 28, 2011, 16:19
Default
  #3
Member
 
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 5
hawkeye321 is an unknown quantity at this point
Hi AMIR
Thanks for your comment. I tried
(hStar.value()) > (TLSTar.value())
but it gives another error

error: ‘struct Foam::volScalarField’ has no member named ‘Value’
hawkeye321 is offline   Reply With Quote

Old   September 28, 2011, 16:22
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
Quote:
Originally Posted by mahdiiowa View Post
Hi Guys
I want to add a if condition in the following form to my code

if (hStar > TLSTar)
{
gl = 1;
}

but when I compile it the following error is being produced
"error: no match for ‘operator>’ in ‘hStar > TLStar’"
hStar is a VolScalarField and TLStar is dimensioned scalar field.

I would appreciate if you help me fix it!
forAll( hStar, celli){
if (hStar[celli] > TLSTar.value())
{
gl[celli] = 1.0;
}
}

gl is volScalarField ?
nimasam is online now   Reply With Quote

Old   September 28, 2011, 16:24
Default
  #5
Member
 
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 5
hawkeye321 is an unknown quantity at this point
Thanks NIMA, Yep gl is volScalarField!
I will try that right away!
hawkeye321 is offline   Reply With Quote

Old   September 28, 2011, 16:45
Default
  #6
Member
 
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 5
hawkeye321 is an unknown quantity at this point
Nima and Amir Thanks!
The problem has been fixed and the code sounds good now!!
hawkeye321 is offline   Reply With Quote

Old   October 25, 2011, 06:46
Thumbs up
  #7
New Member
 
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 21
Rep Power: 7
semaviso is on a distinguished road
thanx guys, this helped. i had the same error.
semaviso is offline   Reply With Quote

Old   October 25, 2011, 08:10
Default error: no match for 'operator=='
  #8
New Member
 
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 21
Rep Power: 7
semaviso is on a distinguished road
Hi guys

I am trying solve the following:

forAll(mAbsorbed, celli)
{
if(mAbsorbed[celli] <= rhoSs.value())
{
solve(fvm::ddt(1.0-epsVoid,rhoS) == mAbsorbed[celli]);
}
}
else
{
Info<< "\nrhoS - MHydride density = " << max(rhoS).value();
Info<< " has reached saturation density of " << rhoSs.value();
Info<< " kg/m^3.\n"<< endl;
}

so that if the value of mAbsorbed (a volScalrField) exceeds or equals the value of rhoSs a dimensionedScalar the program should a statement as above.
but I get the following error:

error: no match for 'operator==' in 'Foam::fvm::ddt(const Foam::dimensionedScalar&, Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) [with Type = double](((Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&)(& rhoS))) == mAbsorbed.Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::<anonymous>.Foam:imensionedField <double, Foam::volMesh>::<anonymous>.Foam::Field<double>::< anonymous>.Foam::List<double>::<anonymous>.Foam::U List<T>:perator[] [with T = double](celli)'

...

please help me fix this error.

thank u.
semaviso is offline   Reply With Quote

Old   October 25, 2011, 09:42
Default
  #9
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
you are going to import a strange format in openFOAM structure, it cant resolve ur data type, you are going to solve different variable from dimensionedScalar, UList and volScalarField its impossible in this way!
nimasam is online now   Reply With Quote

Old   October 25, 2011, 10:00
Default
  #10
New Member
 
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 21
Rep Power: 7
semaviso is on a distinguished road
hi nimasam

Thanks, I tried it and I get:

error: 'deltatime' was not declared in this scope.

and i tried deltaTime and i get same error.

how do i declare deltatime?
semaviso is offline   Reply With Quote

Old   October 25, 2011, 10:06
Default
  #11
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
hi dear Sibusiso
could you explain what you are going to solve? send ur equation here.
what are these variables ?
nimasam is online now   Reply With Quote

Old   October 25, 2011, 10:37
Default
  #12
New Member
 
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 21
Rep Power: 7
semaviso is on a distinguished road
http://ywang.eng.uci.edu/Publication...age%20beds.pdf

from the article above. i am trying to solve these equations: equation 1, 2, 9, 10 and 11.

where:
rhoS is the solid density in equation 9
mAbsorbed is the hydrogen reaction rate (source term) from equation 10
rhoSs is the saturated solid density constant from equation 10 too.

hope this is clear enough, i really need help.
semaviso is offline   Reply With Quote

Old   October 25, 2011, 12:10
Default
  #13
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
dear Sibusiso
let me ask more clear what variable should be solved among these variables?
rhoS , mAbsorbed or rhoSs
nimasam is online now   Reply With Quote

Old   October 25, 2011, 18:34
Default
  #14
New Member
 
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 21
Rep Power: 7
semaviso is on a distinguished road
hello nima

rhoS is the variable to be solved in my first post.


forAll(mAbsorbed, celli)
{
if(mAbsorbed[celli] <= rhoSs.value())
{
solve(fvm::ddt(1.0-epsVoid,rhoS) == mAbsorbed[celli]);
}
}
else
{
Info<< "\nrhoS - MHydride density = " << max(rhoS).value();
Info<< " has reached saturation density of " << rhoSs.value();
Info<< " kg/m^3.\n"<< endl;
}


thank you.
semaviso is offline   Reply With Quote

Old   October 26, 2011, 03:26
Default
  #15
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
dear sibusiso
why dont you combine equations 9 and 10, then finally your equation will be
A*ddt(rhoS) - B* rhoS + B*rhoSS =0
which is a linear ode and have definte solution as a function of :
rhos = f (rhoSS, time)
then implement rhos equation in your code!
nimasam is online now   Reply With Quote

Old   October 26, 2011, 04:58
Default
  #16
New Member
 
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 21
Rep Power: 7
semaviso is on a distinguished road
Dear Nima

equation 9 calculates the reaction rate (Sm) which I also need to for equation 1 and 6 and need to track how fast does the source term (mAdsorbed) changes.

mAbsorbed = max(Sm) - min(Sm);

so i think i need equation 10.

just realised that I had made a mistake in the following code (bolded) instead of the source term there should be the density of the solid rhoS. sorry about that.


forAll(mAbsorbed, celli)
{
if(mAbsorbed[celli] <= rhoSs.value())
{
solve(fvm::ddt(1.0-epsVoid,rhoS) == mAbsorbed[celli]);
}
else
{
Info<< "\nrhoS - MHydride density = " << max(rhoS).value();
Info<< " has reached saturation density of " << rhoSs.value();
Info<< " kg/m^3.\n"<< endl;
}
}

I fixed it as follows:

forAll(mAbsorbed, celli)
{
if(rhoS[celli] <= rhoSs.value())
{
solve(fvm::ddt(1.0-epsVoid,rhoS) == mAbsorbed);
}
else
{
Info<< "\nrhoS - MHydride density = " << max(rhoS).value();
Info<< " has reached saturation density of " << rhoSs.value();
Info<< " kg/m^3.\n"<< endl;
}

}
and it compiles and runs but it does not get out I have to manually terminate it, please check attached txt file.
Attached Files
File Type: txt consolOutput forrhoS less than rhoSs.txt (748 Bytes, 1 views)
semaviso is offline   Reply With Quote

Old   October 26, 2011, 05:20
Default
  #17
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
its some how obvious it iterates over ur grids so! it solves your equations on the numbers of your grids! as i said before this combination does not work for you you should solve rhoS manually! and implement rhoS function!
nimasam is online now   Reply With Quote

Old   October 26, 2011, 05:24
Default
  #18
New Member
 
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 21
Rep Power: 7
semaviso is on a distinguished road
thank you Nima

let me try it
semaviso 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
area does not match neighbour by ... % -- possible face ordering problem St.Pacholak OpenFOAM 9 November 22, 2011 11:02
Match Control and Periodic BC ANSYS 12.1 combustion FLUENT 0 August 17, 2011 16:28
[ICEM] Forcing surface and curve to match sherifkadry ANSYS Meshing & Geometry 0 August 27, 2010 00:28
gmsh2ToFoam sarajags_89 OpenFOAM 0 November 24, 2009 23:50
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15


All times are GMT -4. The time now is 09:23.