Hi. I have a volVectorField U
Hi. I have a volVectorField U and I'd like to make a volTensorField D=(U*U)/mag(U) whenever mag(U)!=0 and zero otherwise. Is there any way to accomplish this simple task?
volTensorField hrv = U*U/stabi
volTensorField hrv = U*U/stabilise(mag(U), SMALL);
Thanks Hrvoje. But it does not
Thanks Hrvoje. But it does not work, and it gives a complicated error message, which, I guess, says that mag(U) gives a GeometricField, and stabilise expects an UList:
Making dependency list for source file thermohaline.C
SOURCE=thermohaline.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/dvidovic/OpenFOAM/OpenFOAM-1.5/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/dvidovic/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude -I/home/dvidovic/OpenFOAM/OpenFOAM-1.5/src/OSspecific/Unix/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/thermohaline.o
In file included from thermohaline.C:45:
createFields.H: In function 'int main(int, char**)':
createFields.H:130: error: call of overloaded 'stabilise(Foam::tmp<foam::geometricfield<double,> >, const Foam::scalar&)' is ambiguous
/home/dvidovic/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/scalarField.H:72: note: candidates are: Foam::tmp<foam::field<double> > Foam::stabilise(const Foam::UList<double>&, Foam::scalar)
/home/dvidovic/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/GeometricScalarField .C:87: note: Foam::tmp<foam::geometricfield<double,> > Foam::stabilise(const Foam::tmp<foam::geometricfield<double,> >&, const Foam::dimensioned<double>&) [with PatchField = Foam::fvPatchField, GeoMesh = Foam::volMesh]
make: *** [Make/linux64GccDPOpt/thermohaline.o] Error 1
Hi Dragan, have you found a
have you found a solution for this problem? I'm dealing with the same errors.
Hi Kathrin Yes, this is wha
Yes, this is what I did:
And UUnits is this:
dimensionedScalar UUnits // Velocity units
I don't know how small is SMALL, I hope it's small enough. I'd prefer to modify mag(U) only when it is smaller than SMALL, but I don't think this is worth any more trouble. Of course, if you want to compute this often, then put SMALL in the dimensionedScalar.
Hi Dragan, thank you! It
thank you! It works now!
|All times are GMT -4. The time now is 17:49.|