|
[Sponsors] |
December 29, 2013, 16:24 |
|
#21 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Thamali: Unfortunately, I can't make figure out where the problem is in the file you had attached, just by looking at the source code As for the latest error, seems to either it's a very strange problem. It suggests that it's missing an indication of a library that has got the object-class "Foam::fv::laplacianScheme", which should already be present in "libOpenFOAM" or "libfiniteVolume". If possible, can you share the whole source code package of your modified solver? And knowing which OpenFOAM version or variant you are using, as well as knowing how you installed it and in which Linux Distribution and version, would all come in handing as well, so that I can reproduce the same error. Because from what I can deduce, the latest error can be related to any of the details I asked above, namely: OpenFOAM version, how it was installed, which Linux Distribution and version, and access to the source code. Best regards, Bruno
__________________
|
|
December 30, 2013, 01:40 |
|
#22 |
Member
Thamali
Join Date: Jul 2013
Posts: 67
Rep Power: 12 |
Thank you very much for the wishes and Wish you all a very happy new year.....!!
wyldckat,
If anyone interested pls send me a message. I am eager for your reply wyldckat. Thanks again. |
|
January 5, 2014, 11:47 |
|
#23 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Thamali,
I've finally managed to have a look into this. Here are the steps I've taken to diagnose and sort-of solve the problem:
Best regards, Bruno
__________________
|
|
January 7, 2014, 00:35 |
Thanking
|
#24 |
Member
Thamali
Join Date: Jul 2013
Posts: 67
Rep Power: 12 |
Dear Bruno,
I am very much grateful to you.
With Regards, Thamali |
|
August 16, 2016, 05:50 |
|
#25 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15 |
Hi
Yes this method works. But I have a question: If I have volScalarField T and then I want to assign T[celli] = a*b; // a and b are dimensionedScalars so then do I always use .value() method? I lose in this way dimensions checking or I am wrong?
__________________
best regards pblasiak |
|
September 1, 2016, 03:03 |
|
#26 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24 |
yep. value() returns only value of variable not its dimension
__________________
My Personal Website (http://nimasamkhaniani.ir/) Telegram channel (https://t.me/cfd_foam) |
|
August 29, 2017, 03:44 |
similar problem in conversion
|
#27 |
New Member
|
Hello Everyone
I am trying to solve laplace equation without using laplacian function. So I am stuck in multiplying the area vector to the grad of scalar T. I am including the line of the code below which is showing problem T[cellid]=T[cellid]-runTime.deltaT()*1.00*(gradT.value()*mesh.Sf()[faceid].value()); here T is the volScalarField, gradT is the volVectorField This shows the error that they don't have any member named "value" I have tried other ways too T[cellid]=T[cellid]-runTime.deltaT()*1.00*(gradT*mesh.Sf()[faceid]); This shows the following error note: mismatched types ‘const Foam::dimensioned<Type>’ and ‘double’ T[cellid]=T[cellid]-runTime.deltaTValue()*1.00*(gradT*mesh.Sf()[faceid]); This shows the same error as above. T[cellid]=T[cellid]-runTime.deltaTValue()*1.00*(gradT.component(0)*mes h.Sf()[faceid].x()+gradT.component(1)*mesh.Sf()[faceid].y()+gradT.component(2)*mesh.Sf()[faceid].z()); This shows the following error error: cannot convert ‘Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> >’ to ‘double’ in assignment Any help is deeply appreciated. |
|
August 29, 2017, 11:27 |
|
#28 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15 |
Hi,
gradT is a vector so you can only access its component no value. Try this: Accessing a vector in a volVectorField by cell label
__________________
best regards pblasiak |
|
August 6, 2020, 07:28 |
|
#29 |
New Member
Azad
Join Date: Nov 2019
Posts: 6
Rep Power: 6 |
Hi All,
I am trying to generate a random number r between zero to one at the interface where phi lies between 0.01 to 0.99 as follows volScalarField r; forAll( r, cellID) { //r[cellID] = DO SOMETHING if (phi[cellID] > 0.01) { r[cellI] =random number; } if (phi[cellI] <0.99) { r[cellId] =random number; } else { r[cellId] =0; } } for this I am getting error error: cannot convert 'long int() throw ()' to 'double' in assignment r[cellID]=random number; could you please suggest me how to resolve? Thanks |
|
September 20, 2020, 06:00 |
no suitable user-defined conversion
|
#30 |
New Member
sujata
Join Date: Dec 2019
Posts: 10
Rep Power: 6 |
Hi foamers,
I am trying to put a condition that if after a certain height in a twophaseflow the properties of the fluid will be interchanged and the drag will be calculated using that changed property. My code is mentioned below and I am getting the following error: error: no suitable user-defined conversion from "Foam::tmp<Foam::GeometricField<Foam::scalar={Foam ::doubleScalar={double}}, Foam::fvPatchField, Foam::volMesh>>" to "const Foam::volVectorField" exists const volVectorField y_dist2=U.mesh().C().component(1); ^ dragModels/Tsuchiya2/Tsuchiya2.C(98): error: no suitable user-defined conversion from "Foam::tmp<Foam::volVectorField>" to "const Foam::volScalarField" exists const volScalarField y_dist = y_dist2/l_unit; *................................................. ......................* //Code starts here #include "Tsuchiya2.H" #include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { namespace dragModels { defineTypeNameAndDebug(Tsuchiya2, 0); addToRunTimeSelectionTable(dragModel, Tsuchiya2, dictionary); } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::dragModels::Tsuchiya2::Tsuchiya2 ( const dictionary& dict, const phasePair& pair, const bool registerObject ) : dragModel(dict, pair, registerObject), residualRe_("residualRe", dimless, dict), residualEo_("residualEo", dimless, dict) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::dragModels::Tsuchiya2::~Tsuchiya2() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp<Foam::volScalarField> Foam::dragModels::Tsuchiya2::CdRe() const { volScalarField Re(max(pair_.Re(), residualRe_)); //volScalarField Re(pair_.Re()); volScalarField Eo(max(pair_.Eo(), residualEo_)); Info<< "Re =" <<Re[0] << endl; Info<< "Eo =" <<Eo[0] << endl; volScalarField temp { max ( 24.0*(1.0 + 0.15*pow(Re, 0.687))/Re, 8.0*Eo/(3.0*(Eo + 4.0)) ) }; Info<< "Cd=" <<temp[0] <<endl; return temp*Re; dimensionedScalar l_unit ( "l_unit", dimensionSet (0, 1, 0, 0, 0, 0, 0), scalar(1.0) ); const volVectorField U= this->db().objectRegistry::lookupObject<volVectorField> ("U.water"); const volVectorField y_dist2=U.mesh().C().component(1); const volScalarField y_dist = y_dist2/l_unit; dimensionedScalar h_i ( "h_i", dimensionSet (0, 0, 0, 0, 0, 0, 0), scalar (1.1) ); const volScalarField f_highUG ( pos(y_dist-h_i)* ( 1e-06 ) + neg(y_dist-h_i)*1.0 ); |
|
September 21, 2020, 06:36 |
|
#31 |
Senior Member
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 15 |
U.mesh().C().component(1) is returning tmp<volScalarField > not volScalarField
|
|
September 21, 2020, 06:43 |
|
#32 |
New Member
sujata
Join Date: Dec 2019
Posts: 10
Rep Power: 6 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
convert virtual volume to a real one | djalil | FLUENT | 0 | January 22, 2009 15:07 |
Convert Real edges to Virtual in Gambit | Freeman | FLUENT | 6 | October 24, 2005 15:14 |
Convert from StarCD 3.10 to StarCD 3.15 | Jing | Siemens | 1 | April 17, 2002 09:22 |