CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

How to use "translation" in solidBodyMotionFunction in OpenFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2016, 06:23
Default How to use "translation" in solidBodyMotionFunction in OpenFOAM
  #1
New Member
 
Rupesh
Join Date: Jan 2016
Posts: 11
Rep Power: 10
rupesh_w is on a distinguished road
Hello,

I am trying to modify the existing case of movingCylinders (in PimpleDyMFoam) in OpenFOAM (version: foam_extend 3.1). Current case has two cylinders oscillating between the walls. I want to modify the case by giving the linear translation motion to the cylinders. Can somebody help me here?
I have found that the cylinder motion is defined in the DynamicMeshDict file in "Constant" folder. This file looks like following :

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// dynamicFvMesh staticFvMesh;
dynamicFvMesh multiTopoBodyFvMesh;

multiTopoBodyFvMeshCoeffs
{
bodies
(
frontCyl
{
movingCells cyl1;
layerFaces
(
topLayerCyl2
botLayerCyl2
);

solidBodyMotionFunction linearOscillation;
linearOscillationCoeffs
{
amplitude (0 -0.028 0);
period 3;
}

minThickness 0.0015;
maxThickness 0.004;

invertMask true;
}
}

Also i figured out that we can change to linear motion of cylinder by changing keyword "linearOscillation" to "translation" but i am unaware of other changes that are needed to do so.
Can somebody help in in this?
Thanks in advance.
rupesh_w is offline   Reply With Quote

Old   June 29, 2016, 04:37
Default
  #2
New Member
 
Julian
Join Date: Jun 2016
Posts: 4
Rep Power: 10
JulianG is on a distinguished road
Hello rupesh,

I am currently facing the same problem and not getting any further.

I replaced the linearOscillation keyword with translation and set the translationCoeffs velocity (1.6e-4 0 0) and rampTime 0.
I have allready tried other values for velocity and rampTime, but I am always getting a very high volume continuity error and then in the next iteration it crashes with the error message "floating point exception" or "negative cell volume".

Did you solve the problem?
I would be very grateful for any help, because I'm pretty new to the whole CFD world.

Many thanks in advance, greets Julian
JulianG is offline   Reply With Quote

Old   August 12, 2016, 14:51
Default
  #3
New Member
 
Rupesh
Join Date: Jan 2016
Posts: 11
Rep Power: 10
rupesh_w is on a distinguished road
Hello Julian,

I have stopped that work and now working on something else. But As you said that you are getting the error of "floating point exception" and "Negative cell volume" , This might be due to your mesh motion happening too fast which results in Bad mesh elements.

So, use smaller value of "deltaT" (time step) in your "controlDict" file to get rid of these errors.
You may need to do few trials to reach optimum value of "deltaT"

Regards,
Rupesh
rupesh_w is offline   Reply With Quote

Old   August 15, 2016, 03:24
Default
  #4
New Member
 
Julian
Join Date: Jun 2016
Posts: 4
Rep Power: 10
JulianG is on a distinguished road
Hello rupesh, thanks for your reply.

I have allready tried to use smaller values of "deltaT" and smaller values for the velocity of the mesh motion. But it even says "negative cell volume" when i set the velocity to zero. So I think there must be a difference between translation and oscillation in the setup but i can't figure out what it is. The mesh is still the same as in the tutorial.

Here is my "dynamicMeshDict" file and the error message i get. Sorry for the long post, but I don't know how to spoiler or insert files.

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.2 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh multiTopoBodyFvMesh;

multiTopoBodyFvMeshCoeffs
{
bodies
(
frontCyl
{
movingCells cyl1;
layerFaces
(
topLayerCyl1
botLayerCyl1
);

solidBodyMotionFunction translation;
translationCoeffs
{
velocity (0 0 0);
rampTime 0;
}

minThickness 0.0015;
maxThickness 0.004;

invertMask true;
}


);
}

// ************************************************** *********************** //




This is the error log file:


/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.2 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | For copyright notice see file Copyright |
\*---------------------------------------------------------------------------*/
Build : 3.2-334ba0562a2c
Exec : moveDynamicMesh
Date : Aug 15 2016
Time : 08:51:31
Host : julian-notebook
PID : 4252
CtrlDict : "/home/julian/foam/julian-3.2/run/tutorials/mesh/moveDynamicMesh/movingCylindersTrans/system/controlDict"
Case : /home/julian/foam/julian-3.2/run/tutorials/mesh/moveDynamicMesh/movingCylindersTrans
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create dynamic mesh for time = 0

Selecting dynamicFvMesh multiTopoBodyFvMesh
Initializing the GGI interpolator between master/shadow patches: frontIn/frontOut
Initializing the GGI interpolator between master/shadow patches: middleIn/middleOut
Initializing the GGI interpolator between master/shadow patches: backIn/backOut
Selecting solid-body motion function translation
Moving body frontCyl:
moving cells: cyl1
layer faces :
2
(
topLayerCyl1
botLayerCyl1
)

invert mask : false

Time = 0
Adding zones and modifiers to the mesh. 1 bodies found
Copying existing point zones
Adding point, face and cell zones
Creating layering topology modifier topLayerCyl1 on object frontCyl
Creating layering topology modifier botLayerCyl1 on object frontCyl
Adding topology modifiers. nModifiers = 2
Initializing the GGI interpolator between master/shadow patches: frontIn/frontOut
Initializing the GGI interpolator between master/shadow patches: middleIn/middleOut
Initializing the GGI interpolator between master/shadow patches: backIn/backOut
Time = 0.001
Clear VTK directory
solidBodyMotionFunctions::translation::transformat ion(): Time = 0.001 velocity: ((0 0 0) (1000 (0 0 0)))
Executing mesh motion

From function void GGIInterpolation<MasterPatch, SlavePatch>::calcAddressing()
in file /home/julian/foam/foam-extend-3.2/src/foam/lnInclude/GGIInterpolationWeights.C at line 269
The master projected polygon was CW instead of CCW. This is strange...

From function void GGIInterpolation<MasterPatch, SlavePatch>::calcAddressing()
in file /home/julian/foam/foam-extend-3.2/src/foam/lnInclude/GGIInterpolationWeights.C at line 269
The master projected polygon was CW instead of CCW. This is strange...
Motion conservation error in cell 0: 0.333333333 V: 1.160770975 V0: 1.157295615e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 1: 0.333333333 V: 1.240824139 V0: 1.237109099e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 2: 0.333333333 V: 1.320877308 V0: 1.316922588e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 3: 0.333333333 V: 1.400930476 V0: 1.396736076e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 4: 0.333333333 V: 1.480983639 V0: 1.47654956e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 5: 0.333333333 V: 1.561036796 V0: 1.556363036e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 6: 0.333333333 V: 1.641089987 V0: 1.636176547e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 7: 0.333333333 V: 1.160771037 V0: 1.157295677e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 8: 0.333333333 V: 1.240824208 V0: 1.237109167e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 9: 0.333333333 V: 1.320877382 V0: 1.316922662e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 10: 0.333333333 V: 1.400930546 V0: 1.396736146e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 11: 0.333333333 V: 1.48098372 V0: 1.47654964e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 12: 0.333333333 V: 1.561036893 V0: 1.556363133e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 13: 0.333333333 V: 1.641090062 V0: 1.636176622e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 14: 0.333333333 V: 1.160771086 V0: 1.157295726e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 15: 0.333333333 V: 1.240824263 V0: 1.237109223e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 16: 0.333333333 V: 1.32087743 V0: 1.31692271e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 17: 0.333333333 V: 1.400930604 V0: 1.396736204e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 18: 0.333333333 V: 1.48098379 V0: 1.47654971e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 19: 0.333333333 V: 1.561036952 V0: 1.556363192e-09 volume change: 0.999999999 div flux: -0.666666666
Motion conservation error in cell 20: 0.333333333 V: 1.641090126 V0: 1.636176686e-09 volume change: 0.999999999 div flux: -0.666666666
...
...
...
...
Motion conservation error in cell 585: -7.501102733e-05 V: -26.74273465 V0: 1.2e-08 volume change: 1 div flux: -1.000075011
Motion conservation error in cell 586: -7.501102733e-05 V: -26.74273465 V0: 1.2e-08 volume change: 1 div flux: -1.000075011
Motion conservation error in cell 587: -7.501102733e-05 V: -26.74273465 V0: 1.2e-08 volume change: 1 div flux: -1.000075011
Motion conservation error in cell 588: -7.501102733e-05 V: -26.74273465 V0: 1.2e-08 volume change: 1 div flux: -1.000075011
Motion conservation error in cell 589: -7.501102733e-05 V: -26.74273465 V0: 1.2e-08 volume change: 1 div flux: -1.000075011
Number of motion errors: 500 out of nCells = 2160
volume continuity errors : volume = 756.141658, old volume = 2.337426215e-05, max error = 0.333333333, sum local = 0.0005691687857, global = 0.0005691687857
Mesh Courant Number mean: 4.094744412 max: 29.51351602
Point usage OK.
Upper triangular ordering OK.
Topological cell zip-up check OK.
Face vertices OK.
Face-face connectivity OK.
Mesh topology OK.
Boundary openness (-3.063230791e-19 4.053157812e-19 5.735378022e-17) Threshold = 1e-06 OK.
***High aspect ratio cells found, Max aspect ratio: 2.070549633e+11, number of cells 20 Threshold = 1000
Minumum face area = 7.142855774e-07. Maximum face area = 40.08651292. Face area magnitudes OK.
***Zero or negative cell volume detected. Minimum negative volume: -26.74273465, Number of negative volume cells: 20
Mesh non-orthogonality Max: 180 average: 16.32433879 Threshold = 70
***Number of non-orthogonality errors: 58.
***Error in face pyramids: 120 faces are incorrectly oriented.
Max skewness = 0.9303656419 OK.
Failed 4 mesh geometry checks.
Failed 1 mesh checks.
ExecutionTime = 0.09 s ClockTime = 0 s

Time = 0.002
solidBodyMotionFunctions::translation::transformat ion(): Time = 0.002 velocity: ((0 0 0) (1000 (0 0 0)))


--> FOAM FATAL ERROR:
negative cell volume. Error in mesh motion before topological change.

From function bool layerAdditionRemoval::changeTopology() const
in file polyMeshModifiers/layerAdditionRemoval/layerAdditionRemoval.C at line 295.

FOAM aborting

Aborted


Thanks for your help!
JulianG is offline   Reply With Quote

Old   August 16, 2016, 00:38
Default
  #5
New Member
 
Rupesh
Join Date: Jan 2016
Posts: 11
Rep Power: 10
rupesh_w is on a distinguished road
Hello JulianG,

As you said you are using the same case of "movingCylinder" , So you need to understand the type of coupling interface used in this case which is "GGI" , which works in a bit different way. Here the patch "cyl1" moves on specific path between "frontIn" and "frontOut" (layer of cells). This means block of cells around "cyl1" (Master cells) gets mapped over the cells in its path of motion (Slave cells).

Hence if you want to change "movingCylinder" case have linear motion then, It would not be possible to do because that mesh is built in a way to represent the oscillation. read some document about "GGI" (General Grid Interface)

Moreover, If i understand your requirement of problem correctly you may want to see the test case of "movingCone" available in pimpleDymFoam tutorial case.

I hope it dose not confuse you. If yes then hit me back.

Regards,
Rupesh
rupesh_w is offline   Reply With Quote

Old   August 16, 2016, 04:27
Default
  #6
New Member
 
Julian
Join Date: Jun 2016
Posts: 4
Rep Power: 10
JulianG is on a distinguished road
Hello Rupesh, thank you very much for your support!

I have allready read some documents about GGI and I also tried out AMI coupling but it didn't work either.

I don't see the reason why a linear motion should be handled in another way then an oscillating motion. As long as the moving cells of "cyl1" don't leave the area, so that there are still a few layers above/under the cells of "cyl1" it should be fine. Could you help me out there, so that i understand the difference?


The "movingCone" tutorial of OpenFoam-3.0.1 doesn't fit my case because the cells in front of and behind of the moving cells are just compressed and stretched( with "dynamicMotionSolverFvMesh"). I need topo changes with layer addition/removal because i want to simulate a case where two conveyances pass eachother in a long shaft (around 120 m for simulation).


I have also tried out the "movingConeTopo" in icoDyMFoam from foam extend 3.2.
This is the same mesh like in the other "movingCone" tutorials,but the mesh motion is created with "movingBodyTopoFvMesh" which is one of the classes I could use for my case (as far as I know yet).
But still I get the same error, when I change the "linearOscillating" motion to "translation".

--> FOAM FATAL ERROR:
negative cell volume. Error in mesh motion before topological change.

From function bool layerAdditionRemoval::changeTopology() const
in file polyMeshModifiers/layerAdditionRemoval/layerAdditionRemoval.C at line 295.

FOAM aborting

Aborted


Because there are no mapped mesh parts, just the moving cell block and the regions on the left and the right of the moving cells which have layer added or reduced I think that the problem with the "translation" motion is going back to the layer addition/removal.

Do you have any idea of how I could solve this problem? Since this is my first real simulation and I was not in touch with a lot of programming yet im not very fimiliar with the codes that are behind the motion types.

Many many thanks in advance! I'm very grateful that you allready invested some time in my problem!

Best regards,
Julian
JulianG is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 11:58
OpenFOAM Foundation releases OpenFOAMŪ 3.0.0 CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 1 November 7, 2015 15:16
OpenFOAM Foundation Releases OpenFOAM v2.3.0 opencfd OpenFOAM Announcements from OpenFOAM Foundation 3 December 23, 2014 03:43
Suggestion for a new sub-forum at OpenFOAM's Forum wyldckat Site Help, Feedback & Discussions 20 October 28, 2014 09:04
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07


All times are GMT -4. The time now is 10:23.