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 |
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. |
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 |
Thanking
Dear Bruno,
I am very much grateful to you.
With Regards, Thamali |
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? |
yep. value() returns only value of variable not its dimension
|
similar problem in conversion
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. |
Hi,
gradT is a vector so you can only access its component no value. Try this: https://www.cfd-online.com/Forums/op...ell-label.html |
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 |
no suitable user-defined conversion
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; :confused: *................................................. ......................* //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 ); |
U.mesh().C().component(1) is returning tmp<volScalarField > not volScalarField
|
Quote:
|
All times are GMT -4. The time now is 12:50. |