|
[Sponsors] |
February 15, 2009, 06:59 |
Patel,
Are you using symmet
|
#81 |
New Member
Richard Samuel
Join Date: Mar 2009
Location: Canberra, ACT, Australia
Posts: 9
Rep Power: 17 |
Patel,
Are you using symmetry planes in your domain geometry ? The forces code does not know about symmetry planes in the geometry so forces will not appear to be balanced, Cd and Cl will be too small and moments in to or out of the symmetry plane will appear when none should be generated. Here is a patch I have been meaning to submit. It recognises three variables in the forces dict which switch on symmetry planes in the forces code across the coordinate axes. diff --git a/src/postProcessing/forces/forceCoeffs/forceCoeffs.C b/src/postProcessing/forces/forceCoeffs/forceCoeffs.C index 86de02e..1c0bc82 100644 --- a/src/postProcessing/forces/forceCoeffs/forceCoeffs.C +++ b/src/postProcessing/forces/forceCoeffs/forceCoeffs.C @@ -112,9 +112,20 @@ void Foam::forceCoeffs::write() vector totForce = fm.first().first() + fm.first().second(); vector totMoment = fm.second().first() + fm.second().second(); - scalar liftForce = totForce & liftDir_; - scalar dragForce = totForce & dragDir_; - scalar pitchMoment = totMoment & pitchAxis_; + vector sumTotForce = totForce; + vector sumTotMoment = totMoment; + + if (symmetryX_) sumTotForce += vector(-sumTotForce.x(), sumTotForce.y(), sumTotForce.z()); + if (symmetryY_) sumTotForce += vector(sumTotForce.x(), -sumTotForce.y(), sumTotForce.z()); + if (symmetryZ_) sumTotForce += vector(sumTotForce.x(), sumTotForce.y(), -sumTotForce.z()); + + if (symmetryX_) sumTotMoment += vector(sumTotMoment.x(), -sumTotMoment.y(), -sumTotMoment.z()); + if (symmetryY_) sumTotMoment += vector(-sumTotMoment.x(), sumTotMoment.y(), -sumTotMoment.z()); + if (symmetryZ_) sumTotMoment += vector(-sumTotMoment.x(), -sumTotMoment.y(), sumTotMoment.z()); + + scalar liftForce = sumTotForce & liftDir_; + scalar dragForce = sumTotForce & dragDir_; + scalar pitchMoment = sumTotMoment & pitchAxis_; scalar Cl = liftForce/(Aref_*pDyn); scalar Cd = dragForce/(Aref_*pDyn); diff --git a/src/postProcessing/forces/forces/forces.C b/src/postProcessing/forces/forces/forces.C index 433ef1e..e06cdff 100644 --- a/src/postProcessing/forces/forces/forces.C +++ b/src/postProcessing/forces/forces/forces.C @@ -147,6 +147,9 @@ Foam::forces::forces obr_(obr), active_(true), log_(false), + symmetryX_(false), + symmetryY_(false), + symmetryZ_(false), patchSet_(), pName_(""), Uname_(""), @@ -183,6 +186,18 @@ void Foam::forces::read(const dictionary& dict) { log_ = dict.lookupOrDefault<switch>("log", false); + symmetryX_ = dict.lookupOrDefault<switch>("symmetryX", false); + symmetryY_ = dict.lookupOrDefault<switch>("symmetryY", false); + symmetryZ_ = dict.lookupOrDefault<switch>("symmetryZ", false); + + if (symmetryX_ && symmetryY_ && symmetryZ_) + { + active_ = false; + WarningIn("void forces::read(const dictionary& dict)") + << "Three planes of symmetry is a trivial case" + << endl; + } + const fvMesh& mesh = refCast<const>(obr_); patchSet_ = diff --git a/src/postProcessing/forces/forces/forces.H b/src/postProcessing/forces/forces/forces.H index 7b03805..cd8ac0d 100644 --- a/src/postProcessing/forces/forces/forces.H +++ b/src/postProcessing/forces/forces/forces.H @@ -121,6 +121,9 @@ protected: //- Switch to send output to Info as well as to file Switch log_; + //- Switches to turn on symmetry planes + Switch symmetryX_, symmetryY_, symmetryZ_; + // Read from dictonary //- Patches to integrate forces over |
|
February 15, 2009, 07:04 |
Patel,
Are you using symmet
|
#82 |
New Member
Richard Samuel
Join Date: Mar 2009
Location: Canberra, ACT, Australia
Posts: 9
Rep Power: 17 |
Patel,
Are you using symmetry planes in your domain geometry ? The forces code does not know about symmetry planes in the geometry so forces will not appear to be balanced, Cd and Cl will be too small and moments in to or out of the symmetry plane will appear when none should be generated. Here is a patch I have been meaning to submit. It recognises three variables in the forces dict which switch on symmetry planes in the forces code across the coordinate axes. diff --git a/src/postProcessing/forces/forceCoeffs/forceCoeffs.C b/src/postProcessing/forces/forceCoeffs/forceCoeffs.C index 86de02e..1c0bc82 100644 --- a/src/postProcessing/forces/forceCoeffs/forceCoeffs.C +++ b/src/postProcessing/forces/forceCoeffs/forceCoeffs.C @@ -112,9 +112,20 @@ void Foam::forceCoeffs::write() vector totForce = fm.first().first() + fm.first().second(); vector totMoment = fm.second().first() + fm.second().second(); - scalar liftForce = totForce & liftDir_; - scalar dragForce = totForce & dragDir_; - scalar pitchMoment = totMoment & pitchAxis_; + vector sumTotForce = totForce; + vector sumTotMoment = totMoment; + + if (symmetryX_) sumTotForce += vector(-sumTotForce.x(), sumTotForce.y(), sumTotForce.z()); + if (symmetryY_) sumTotForce += vector(sumTotForce.x(), -sumTotForce.y(), sumTotForce.z()); + if (symmetryZ_) sumTotForce += vector(sumTotForce.x(), sumTotForce.y(), -sumTotForce.z()); + + if (symmetryX_) sumTotMoment += vector(sumTotMoment.x(), -sumTotMoment.y(), -sumTotMoment.z()); + if (symmetryY_) sumTotMoment += vector(-sumTotMoment.x(), sumTotMoment.y(), -sumTotMoment.z()); + if (symmetryZ_) sumTotMoment += vector(-sumTotMoment.x(), -sumTotMoment.y(), sumTotMoment.z()); + + scalar liftForce = sumTotForce & liftDir_; + scalar dragForce = sumTotForce & dragDir_; + scalar pitchMoment = sumTotMoment & pitchAxis_; scalar Cl = liftForce/(Aref_*pDyn); scalar Cd = dragForce/(Aref_*pDyn); diff --git a/src/postProcessing/forces/forces/forces.C b/src/postProcessing/forces/forces/forces.C index 433ef1e..e06cdff 100644 --- a/src/postProcessing/forces/forces/forces.C +++ b/src/postProcessing/forces/forces/forces.C @@ -147,6 +147,9 @@ Foam::forces::forces obr_(obr), active_(true), log_(false), + symmetryX_(false), + symmetryY_(false), + symmetryZ_(false), patchSet_(), pName_(""), Uname_(""), @@ -183,6 +186,18 @@ void Foam::forces::read(const dictionary& dict) { log_ = dict.lookupOrDefault<switch>("log", false); + symmetryX_ = dict.lookupOrDefault<switch>("symmetryX", false); + symmetryY_ = dict.lookupOrDefault<switch>("symmetryY", false); + symmetryZ_ = dict.lookupOrDefault<switch>("symmetryZ", false); + + if (symmetryX_ && symmetryY_ && symmetryZ_) + { + active_ = false; + WarningIn("void forces::read(const dictionary& dict)") + << "Three planes of symmetry is a trivial case" + << endl; + } + const fvMesh& mesh = refCast<const>(obr_); patchSet_ = diff --git a/src/postProcessing/forces/forces/forces.H b/src/postProcessing/forces/forces/forces.H index 7b03805..cd8ac0d 100644 --- a/src/postProcessing/forces/forces/forces.H +++ b/src/postProcessing/forces/forces/forces.H @@ -121,6 +121,9 @@ protected: //- Switch to send output to Info as well as to file Switch log_; + //- Switches to turn on symmetry planes + Switch symmetryX_, symmetryY_, symmetryZ_; + // Read from dictonary //- Patches to integrate forces over |
|
February 15, 2009, 10:14 |
Hi.. Richard
Thanks for rep
|
#83 |
Member
Join Date: Mar 2009
Posts: 41
Rep Power: 17 |
Hi.. Richard
Thanks for reply. I have not used symmetry boundary type. (As given in paper from which I adopt problem to try.) It required to give top and bottom as a free stream condition. I think I am giving some wrong BC, which is not physical !!! I also tried with same mesh and BCs in FLUENT to validate the result. Almost Cd Cl graph pattern is same as OF, but this results are not at all acceptable.(Its horrible!!!) See this velocity plot at t=21s: my Cd value plot: paper's Cd plot: If I am clear give me some suggestion. I can also give paper for ur refrence. |
|
February 15, 2009, 10:17 |
Hi.. Richard
Thanks for rep
|
#84 |
Member
Join Date: Mar 2009
Posts: 41
Rep Power: 17 |
Hi.. Richard
Thanks for reply. I have not used symmetry boundary type. (As given in paper from which I adopt problem to try.) It required to give top and bottom as a free stream condition. I think I am giving some wrong BC, which is not physical !!! I also tried with same mesh and BCs in FLUENT to validate the result. Almost Cd Cl graph pattern is same as OF, but this results are not at all acceptable.(Its horrible!!!) See this velocity plot at t=21s: my Cd value plot: paper's Cd plot: If I am clear give me some suggestion. I can also give paper for ur refrence. |
|
February 17, 2009, 04:46 |
Hi foamers
i would like to
|
#85 |
Member
antonio segalini
Join Date: Mar 2009
Posts: 75
Rep Power: 17 |
Hi foamers
i would like to measure the torque in a certain patch which belongs to a rotating 2d region. I simulate a turbulent flow (with a standard kepsilon model) around some rotating airfoils with a sliding interface method (indeed I am using turbDyMFoam). How can i measure the torque? thanks in advance |
|
February 17, 2009, 04:50 |
is it different from the nonro
|
#86 |
Member
antonio segalini
Join Date: Mar 2009
Posts: 75
Rep Power: 17 |
is it different from the nonrotating case?
|
|
February 17, 2009, 14:09 |
Hi Patel,
when you send me
|
#87 |
Member
Daniel Harlacher
Join Date: Mar 2009
Location: Davis, CA, United States
Posts: 60
Rep Power: 17 |
Hi Patel,
when you send me your case and the paper you are using I will take a look - when you search the forum you will find a lot of questions from myself on square cylinders - but never a quite satisfying answer - but I managed to get "steady" vortex shedding and not what you plotted so maybe I can find something. openfoam.messageboard at gmail.com And now the GENERAL QUESTION: Is it possible to define a second liftDir ?? I am simulating flow around a 3D sphere and need all coefficients ... Thanks - harly |
|
February 18, 2009, 00:23 |
Hi..Daniel
I am herewith gi
|
#88 |
Member
Join Date: Mar 2009
Posts: 41
Rep Power: 17 |
Hi..Daniel
I am herewith giving my case folder and paper inside it.(I have made grid:51x62 as given in paper.) If you get any insight pls. reply me .. Thanks for reply. |
|
February 18, 2009, 01:34 |
Hi..Deniel.
Sorry!! I was not
|
#89 |
Member
Join Date: Mar 2009
Posts: 41
Rep Power: 17 |
Hi..Deniel.
Sorry!! I was not able to upload files together due to file size restriction. For your problem I am not clear about the word "second liftDir".Can you give insight? Here is a link for paper which I followed: http://www.esnips.com/doc/d62fcd4c-af89-430c-8400-5d325df3c11c/A-numerical-study -of-vortex-shedding-from-rectangles Thanks |
|
February 18, 2009, 01:44 |
Sorry!!I failed again so uploa
|
#90 |
Member
Join Date: Mar 2009
Posts: 41
Rep Power: 17 |
Sorry!!I failed again so upload all think on following link.
http://www.esnips.com/web/patelmehulkumarlsStuff |
|
February 18, 2009, 10:44 |
Hi all.
Im newby with OpenF
|
#91 |
New Member
Johannes Mauss
Join Date: Mar 2009
Posts: 1
Rep Power: 0 |
Hi all.
Im newby with OpenFoam and experience some difficulties. I hope one of you can help me. Im running simulation (single and parallel) with simpleFoam. Everything is fine until I try to use this force util. The directory "forces" and the file containing the forces for each iteration is created but when finalizing the run (it does not matter if it is a single or parallel run) OpenFoam crashes with the error message: --------------------------------------------------- End Finalising parallel run *** glibc detected *** simpleFoam: corrupted double-linked list: 0x00000000033e1e30 *** *** glibc detected *** simpleFoam: free(): invalid pointer: 0x00000000036cff10 *** ======= Backtrace: ========= /lib64/libc.so.6[0x2ba07ca6521d] /lib64/libc.so.6[0x2ba07ca66c55] /lib64/libc.so.6(cfree+0x76)[0x2ba07ca66f76] /opt/OpenFOAM/ThirdParty/gcc-4.3.1/platforms/linux64/lib64/libstdc++.so.6(_ZNSsD 2Ev+0x3d)[0x2ba07c32573d] /lib64/libc.so.6(__cxa_finalize+0x85)[0x2ba07ca2a6f5] ======= Backtrace: ========= /opt/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libincompressibleRASModels.so[0x2 ba07a3a3506] ======= Memory map: ======== 00400000-0045a000 r-xp 00000000 08:03 1553025 /opt/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/simpleFoam 00659000-0065b000 r--p 00059000 08:03 1553025 /opt/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/simpleFoam 0065b000-0065c000 rw-p 0005b000 08:03 1553025 /opt/OpenFOAM/OpenFOAM-1.5/applications/bin/linux64GccDPOpt/simpleFoam 0065c000-0376d000 rw-p 0065c000 00:00 0 [heap] 2ba07a132000-2ba07a14e000 r-xp 00000000 08:03 2480754 /lib64/ld-2.6.1.so 2ba07a14e000-2ba07a150000 rw-p 2ba07a14e000 00:00 0 2ba07a34d000-2ba07a34f000 rw-p 0001b000 08:03 2480754 /lib64/ld-2.6.1.so 2ba07a34f000-2ba07a541000 r-xp 00000000 08:03 1077801 /opt/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libincompressibleRASModels.so 2ba07a541000-2ba07a740000 ---p 001f2000 08:03 1077801 /opt/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libin/lib64/libc.so.6[0x2b5dc251b 21d] compressibleRASModels.so 2ba07a740000-2ba07a745000 r--p 001f1000 08:03 1077801 /opt/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libincompressibleRASModels.so 2ba07a745000-2ba07a748000 rw-p 001f6000 08:03 1077801 /opt/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libincompressibleRASModels.so 2ba07a748000-2ba07a7ab000 r-xp 00000000 08:03 1077799 /opt/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libincompressibleTransportModels. so . . . . . . . . . and so on. I thougt it might be a problem of the simpleFoam solver and had a try with turbFoam but the same problem ocuured. Any ideas? Thanks in advance for any help. Johannes |
|
February 19, 2009, 09:14 |
Pls..guide me...look after my
|
#92 |
Member
Join Date: Mar 2009
Posts: 41
Rep Power: 17 |
Pls..guide me...look after my case file and suggest me where I am wrong.
I am trying with some what finer mesh..but still not much improvement.. Thanks |
|
February 23, 2009, 14:22 |
To answer Leonardo Honfi Camil
|
#93 |
Senior Member
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21 |
To answer Leonardo Honfi Camilo's quastion of how to calculate forces of multiple patches in a case.
you need to define in the controlDict patches (front middle rear); so it's separated by a simple blank, not by comma. Furthermore see snappyHexMesh example in thread http://www.cfd-online.com/OpenFOAM_D...s/1/11251.html |
|
February 27, 2009, 16:09 |
Hi foamers
i would like to
|
#94 |
Member
antonio segalini
Join Date: Mar 2009
Posts: 75
Rep Power: 17 |
Hi foamers
i would like to measure the torque in a certain patch which belongs to a rotating 2d region. I simulate a turbulent flow (with a standard kepsilon model) around some rotating airfoils with a sliding interface method (indeed I am using turbDyMFoam). How can i measure the torque?. It is different from the non rotating case? i tried with the force and forcecoeffs function as described above but the moment, which should be oriented principally along the z direction (it is a 2d case) is instead fully 3d(i.e.Mx is of the same order of magnitude of My and Mz), so completely unphysical! thanks in advance for any advice |
|
February 27, 2009, 18:41 |
Hi FOAMers,
I am wondering
|
#95 |
Senior Member
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20 |
Hi FOAMers,
I am wondering if you can use some kind of regex to match your patch names? I have models with lots of patches and I tried: patches (surface*) to match all patches starting with surface. SimpleFOAM does not conplain about it but results look strange. Regards. |
|
February 28, 2009, 05:39 |
Hi, Foamers
There is a bug
|
#96 |
New Member
Sopheak Seng
Join Date: Mar 2009
Posts: 5
Rep Power: 17 |
Hi, Foamers
There is a bug in the way "forces" handle multiple patches. I'm using OF 1.5. If you have two patches e.g. B6 and B666 and you define patches (B6); then "forces" will include both patches in the calculation, simply because B666 contains the substring B6. If you name the two patches differently, e.g. B6 and A666, then "forces" will behave as it should. This is a serious bug. Can someone please confirm this behavior? I don't know how to fix it but i have made some ugly changes in the source code to overcome this problem. Sopheak |
|
February 28, 2009, 19:42 |
Hi Antonio,
I know this i
|
#97 |
Member
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17 |
Hi Antonio,
I know this is kind of off topic, but I'm wondering if you can shad some light on the boundary setup for the rotating airfoil to me? I could not seems to find any tutorials or example that deals with a rotating airfoil. Thanks John |
|
March 2, 2009, 05:20 |
actually that was slightly tri
|
#98 |
Member
antonio segalini
Join Date: Mar 2009
Posts: 75
Rep Power: 17 |
actually that was slightly tricky, but i managed to do the simulation because someone explained me the procedure in the post:
SlidingInterface problem i had to install openfoam-1.5-dev as explained in the post in the installation section in the post: Installation of OpenFOAM-1.5-dev hope this helps |
|
March 2, 2009, 19:25 |
Hallo,PO
I have included your
|
#99 |
Member
Hai Yu
Join Date: Mar 2009
Location: Harbin
Posts: 67
Rep Power: 17 |
Hallo,PO
I have included your paragraph in foamLog, but I can get the result of only one line in file: #Time FpX FpY FpZ FvX FvY FvZ MpX MpY MpZ MvX MvY MvZ And no data followed at all, while, in forces.Dat, everything seems OK. I don't know what is the reason. well, thx in advance. |
|
March 6, 2009, 01:16 |
Hi Antonio,
Humm...could
|
#100 |
Member
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17 |
Hi Antonio,
Humm...could you post the links to the posts you mentioned? I can't seems to find those threads using Search in the forum. Thanks John |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CoupledFvScalarMatrix in OF15 | fisher | OpenFOAM Running, Solving & CFD | 9 | May 27, 2020 10:40 |
Fan type BC in OF15 | hsieh | OpenFOAM Running, Solving & CFD | 31 | July 30, 2015 13:22 |
Bug in patchIntegrateC OF15 | anger | OpenFOAM Bugs | 8 | May 29, 2009 05:36 |
OpenFOAMdev migration to OF15 | fisher | OpenFOAM Installation | 1 | November 25, 2008 15:39 |
Bug or a feature of OF15 | rafal | OpenFOAM Bugs | 5 | July 25, 2008 06:25 |