|
[Sponsors] |
May 19, 2021, 09:43 |
Changing velocity with time
|
#1 |
New Member
Richard Kelly
Join Date: Feb 2021
Posts: 10
Rep Power: 5 |
Hi All,
I have a case setup with a moving boat in water. I am trying to create a case to see how the boat will interact with other objects in the water. Right now I can set the velocity of the boat, but am not able to change the velocity at each timestep. I am using the dymanicMeshDict to achieve this. Below is my dict: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object dynamicMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs (fvMotionSolvers); motionSolver solidBody; cellZone rotatingZone; solidBodyMotionFunction linearMotion; velocity (.5 0 0); // ************************************************************************* // How do I go about changing the velocity in each time step? Will I need to get under the hood to do this? So far I have just been modifying the case dictionary files. |
|
May 19, 2021, 11:01 |
|
#2 |
New Member
Richard Kelly
Join Date: Feb 2021
Posts: 10
Rep Power: 5 |
Found this example in tutorials/multiphase/interfoam/ras/floatingobject.
I guess code stream is being used to calculate some values.. wondering if I can do something to calculate the velocity... Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object dynamicMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dynamicFvMesh dynamicMotionSolverFvMesh; motionSolverLibs (sixDoFRigidBodyMotion); motionSolver sixDoFRigidBodyMotion; sixDoFRigidBodyMotionCoeffs { patches (floatingObject); innerDistance 0.05; outerDistance 0.35; centreOfMass (0.5 0.45 0.35); // Cuboid dimensions Lx 0.3; Ly 0.2; Lz 0.5; // Density of the solid rhoSolid 500; // Cuboid mass mass #eval{ $rhoSolid*$Lx*$Ly*$Lz }; // Cuboid moment of inertia about the centre of mass momentOfInertia #codeStream { codeInclude #{ #include "diagTensor.H" #}; code #{ scalar sqrLx = sqr($Lx); scalar sqrLy = sqr($Ly); scalar sqrLz = sqr($Lz); os << $mass *diagTensor(sqrLy + sqrLz, sqrLx + sqrLz, sqrLx + sqrLy)/12.0; #}; }; report on; accelerationRelaxation 0.7; //accelerationDamping 0; solver { type Newmark; } constraints { // fixedPoint // { // sixDoFRigidBodyMotionConstraint point; // centreOfRotation (0.5 0.45 0.1); // } fixedLine { sixDoFRigidBodyMotionConstraint line; centreOfRotation (0.5 0.45 0.1); direction (0 1 0); } fixedAxis { sixDoFRigidBodyMotionConstraint axis; axis (0 1 0); } } } // ************************************************************************* // |
|
May 19, 2021, 12:38 |
|
#3 |
Senior Member
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 7 |
have a look at the tutorial from tobias, can not be better explained and he does a velocity that changes over time if i remember correctly (or a pressure)
https://www.youtube.com/watch?v=cvWaXBnEz1U&t=8s |
|
May 19, 2021, 12:41 |
|
#4 |
New Member
Richard Kelly
Join Date: Feb 2021
Posts: 10
Rep Power: 5 |
Thank you for the response! It is very much appreciated. I will watch the vid and post if I have any further questions or solutions.
|
|
May 19, 2021, 12:54 |
|
#5 | |
New Member
Richard Kelly
Join Date: Feb 2021
Posts: 10
Rep Power: 5 |
Quote:
Hey otaolafr, interesting vid, though not exactly what I am looking for... I am looking to change the velocity of the moving mesh, not the velocity of the fluid at a boundary. |
||
May 19, 2021, 13:37 |
|
#6 |
Senior Member
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 7 |
sorry I miss read! eventhought it might help you for the programing look at part 13 I think... that is about that
|
|
May 19, 2021, 13:42 |
|
#7 | |
New Member
Richard Kelly
Join Date: Feb 2021
Posts: 10
Rep Power: 5 |
Quote:
Thanks, Will continue vids you suggested. Also came across this: https://www.youtube.com/watch?v=3pfCP769C_U The author also has a paper which I will review to see if they give any information on how they are handling the moving meshes. There is a lot going on in the vid! |
||
May 20, 2021, 13:40 |
|
#8 |
Senior Member
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 151
Rep Power: 10 |
Have you tried tabluated6DoFMotionCoeffs? Something like this link dynamicFvMesh - tabulated motion of a solid body + mesh morphing
I haven't tested it myself, but think it can be a solution for you.
__________________
Charles L. |
|
May 20, 2021, 14:12 |
|
#9 | |
New Member
Richard Kelly
Join Date: Feb 2021
Posts: 10
Rep Power: 5 |
Quote:
Thanks Marpole, I agree this might be better to use tabluated6DoFMotionCoeffs. I am going to play around with that solidBodyMotion solver. I will need to be able to input changes to the vessel at runtime. Still do not know if I can handle this with codestream or if I will have to change the source code. Will play around with that and perhaps upload my case if I can any headway. |
||
Tags |
dynamicmeshdict, programming |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple floating objects | CKH | OpenFOAM Running, Solving & CFD | 14 | February 20, 2019 10:08 |
High Courant Number @ icoFoam | Artex85 | OpenFOAM Running, Solving & CFD | 11 | February 16, 2017 14:40 |
Stuck in a Rut- interDyMFoam! | xoitx | OpenFOAM Running, Solving & CFD | 14 | March 25, 2016 08:09 |
SixDoFRigidBodyMotion under OF2.3 ( self oscillating cylinder) | Scabbard | OpenFOAM Running, Solving & CFD | 1 | July 22, 2014 05:50 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |