|
[Sponsors] |
August 28, 2008, 03:52 |
Hi. I have a volVectorField U
|
#1 |
New Member
Dragan Vidovic
Join Date: Mar 2009
Posts: 17
Rep Power: 17 |
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?
|
|
August 28, 2008, 04:31 |
volTensorField hrv = U*U/stabi
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
volTensorField hrv = U*U/stabilise(mag(U), SMALL);
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
August 28, 2008, 05:29 |
Thanks Hrvoje. But it does not
|
#3 |
New Member
Dragan Vidovic
Join Date: Mar 2009
Posts: 17
Rep Power: 17 |
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 |
|
September 1, 2008, 04:47 |
Hi Dragan,
have you found a
|
#4 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Hi Dragan,
have you found a solution for this problem? I'm dealing with the same errors. Regards Kathrin |
|
September 1, 2008, 05:44 |
Hi Kathrin
Yes, this is wha
|
#5 |
New Member
Dragan Vidovic
Join Date: Mar 2009
Posts: 17
Rep Power: 17 |
Hi Kathrin
Yes, this is what I did: (U*U)/(mag(U)+SMALL*UUnits) And UUnits is this: dimensionedScalar UUnits // Velocity units ( "kUnits", dimensionSet(0,1,-1,0,0), 1.0 ); 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. Good luck Dragan |
|
September 1, 2008, 06:35 |
Hi Dragan,
thank you! It
|
#6 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Hi Dragan,
thank you! It works now! Best regards Kathrin |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
About flow division | sunnysun | OpenFOAM Running, Solving & CFD | 5 | March 2, 2009 13:34 |
Rather obscure division by zero in triangleFuncsintersectAxesBundle | gschaider | OpenFOAM Bugs | 2 | August 13, 2008 08:08 |
Division by zero in Xoodles | hannes | OpenFOAM Bugs | 3 | August 4, 2008 12:04 |
ScalarField division | maka | OpenFOAM Pre-Processing | 2 | August 27, 2007 06:10 |