CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   OscillatingFixedValue in OpenFOAM 141dev (https://www.cfd-online.com/Forums/openfoam-bugs/62294-oscillatingfixedvalue-openfoam-141dev.html)

mathieu September 9, 2008 17:42

Hi, It looks like the oscil
 
Hi,

It looks like the oscillatingFixedValue boundary condition does not work properly when it is used in the motionU file to apply a movement. See the case in attachment (moveDynamicMesh <root> <case>).



Regards,

Mathieu

elorriaux September 10, 2008 02:05

Hi, I can't get the attachm
 
Hi,

I can't get the attachment.

Anyway, i'm using oscillatingFixedValue in motionU, and it works.

Can you detail your problem ?

Etienne.

mathieu September 10, 2008 09:09

Hi, Here is a smaller case
 
Hi,

Here is a smaller case that should upload. Use fluentMeshToFoam to generate the mesh (cylindre.msh).

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif cylindre.tgz

It looks like that the motion of the boundary is the half of what it is supposed to be, but the rest of the mesh moves like it should. See the picture :

http://www.cfd-online.com/OpenFOAM_D...s/126/9130.jpg

Mathieu

elorriaux September 10, 2008 14:39

Hi Mathieu, take a look at
 
Hi Mathieu,

take a look at this file src/fvMotionSolver/lnInclude/oscillatingDisplacementPointPatchVectorField.C

Your boundary motion is computed in this code part.

Note that motionU is a velocity and not a displacement, and the velocity imposed is '1.0 + amplitude * sin (2 * pi * frequency * t). You'll have to rebuild your library if you don't want the '1.0'.

elorriaux September 10, 2008 14:44

Humm sorry, i gave you the wro
 
Humm sorry, i gave you the wrong path.

Check src/OpenFOAM/fields/PointPatchFields/derived/oscillatingFixedValue/OscillatingFi xedValuePointPatchField.C

Etienne.

mathieu September 10, 2008 15:39

Hi Etienne, Thank you for y
 
Hi Etienne,

Thank you for your reply. Did my case work correctly on your OpenFOAM installation ?

Mathieu

elorriaux September 11, 2008 06:53

Hello Matthieu, i'm getting
 
Hello Matthieu,

i'm getting the same issue with my installation.

In fact, i think your timestep is too long. Try with smaller deltaT (ie 0.05 or 0.1). Here is an attempt with deltat=0.05 :

http://etienne.lorriaux.free.fr/OF_stuff/cylindre.avi

Etienne.

mathieu September 11, 2008 09:22

Hi Etienne, I also tried a
 
Hi Etienne,

I also tried a smaller timestep (in fact, I put a big time step in my case to clearly show the problem) and as one can see on your video, there is still a "distortion" of the mesh near the boundary which becomes an important issue for meshes with fine discretization on boundary layers. On the opposite, if you try the uniformFixedValue BC (with a constant non-zero velocity) instead of oscillatingFixedValue you'll see that it works perfectly.

By the way, I don't think the timestep size is important for dynamic mesh purposes since the Laplace equation is steady state (however it might affect the computation time within each timestep). Thanks again !

Mathieu

elorriaux September 11, 2008 09:46

I don't think the problem come
 
I don't think the problem comes from oscillatingFixedValue condition. The mesh solver seems to have difficulties when there are variations of velocity. It seems to work properly with constant velocity.

Etienne.

mathieu September 11, 2008 11:24

Hi people, hi Etienne, It l
 
Hi people, hi Etienne,

It looks like I am very lucky...

I removed lines 313 and 314 in src/OpenFOAM/fields/PointPatchFields/derived/oscillatingFixedValue/OscillatingFi xedValuePointPatchField.C :

// FixedValuePointPatchField
// <patchfield,>::initEvaluate();

Then, I recompile the tetDecompositionFiniteElement librairy :

cd ~/OpenFOAM/OpenFOAM-1.4.1-dev/src/tetDecompositionFiniteElement
./Allwmake

After those modifications, my case works perfectly with the oscillationgFixedValue BC in the motionU file.

However, I am not an expert with the code and it would be nice if an OpenFOAM expert could take a look at this issue.

Kind regards,

Mathieu

peter73 November 12, 2008 16:12

I used openfoam 1.5. The file
 
I used openfoam 1.5. The file OscillatingFi xedValuePointPatchField.C is not in the directory mentioned here but it was located at src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/oscillatingF ixedValueFvPatchField.C

Implement the oscillating boundary in the files pointMotionU and cellMotionU as follows. But I get the error message like

Selecting dynamicFvMesh dynamicMotionSolverFvMesh
Selecting motion solver: velocityLaplacian


Not Implemented
Trying to construct an genericFvPatchField on patch movingWall of field cellMotionU#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/home/yslian/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/yslian/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenFOAM.so"
#2 Foam::genericFvPatchField<foam::vector<double> >::genericFvPatchField(Foam::fvPatch const&, Foam::DimensionedField<foam::vector<double>, Foam::volMesh> const&) in "/home/yslian/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libfiniteVolume.so"

It seems the boundary condition is not implemented in the new version. I appreciate any suggestions.

Thanks,
Peter


boundaryField
{
movingWall
{
type oscillatingFixedValue;
refValue uniform (0 0 0);
amplitude uniform (0 2 0);
frequency 50;
curTimeIndex 0.0;
}

henry November 12, 2008 17:07

What BC have you specified for
 
What BC have you specified for the movingWall in the file pointMotionU?

H

peter73 November 12, 2008 18:06

The bc posted there is just on
 
The bc posted there is just one example. Basically, I want to oscillate one object around certain point, meanwhile, the object will move up and down.


h(t)=c*cos(omega*t)

alfa(t)=alfa_0+alfa_1*cos(omega*t+beta)

The problem is the the oscillatingFixedValue does not work with OF1.5.

henry November 13, 2008 03:36

oscillatingFixedValue is not a
 
oscillatingFixedValue is not a valid BC for pointMotionU which is a pointField not a volField. Look at the avalable BCs for pointMotionU in
OpenFOAM-1.5/src/fvMotionSolver/pointPatchFields/derived
and if none of these suit your needs you can easily roll your own based on these examples.

H

peter73 November 13, 2008 07:49

Henry, Thanks. I noticed t
 
Henry,

Thanks. I noticed that last night and I copied the oscillatingFixedValue from the
src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/

After comparing
(timeVaryingUniformFixedValue Fv PatchField.C)
( Point )
I noticed the difference between these two is one use Fv and another use Point in the .C and .H file. So I change that the oscillating**.C.

When I compile the file, I get the error message that

fields/pointPatchFields/derived/oscillatingFixedValue/oscillatingFixedValuePoint PatchField.C:159: error: expected initializer before ā<ā token
fields/pointPatchFields/derived/oscillatingFixedValue/oscillatingFixedValuePoint PatchField.C:39: error: redefinition of āFoam::scalar Foam::oscillatingFixedValuePointPatchField<type>:: currentScale() constā
fields/pointPatchFields/derived/oscillatingFixedValue/oscillatingFixedValuePoint PatchField.C:39: error: āFoam::scalar Foam::oscillatingFixedValuePointPatchField<type>:: currentScale() constā previously declared here

I just start to learn C++ and so I search the internet for help but still cannot find a solution yet.

peter73 November 13, 2008 17:25

I reduced the error to only on
 
I reduced the error to only one: refined variables. If someone wants to take a look and fixed this bug, please send me email so I will send the files to you.

y0lian05@louisville.edu

Peter

patriem January 31, 2009 10:08

Hello Foamers, i have a que
 
Hello Foamers,

i have a question concerning the formula for oscillatingfixedvalue in 1.4.1-dev.

At the top posting, you said that the velocity imposed is '1.0 + amplitude * sin (2 * pi * frequency * t).

I“m not a C++ crack, but in my files it seems to be
U = amplitude * cos(2*pi*frequency*t)



I just don“t understand follwing:
If you have a simple oscillating motion, it can be described as

x=amplitude*sin(2*pi*frequency*t)

then the velocity is

v=dx/dt=amplitude*2*frequency*t*cos(2*f*t)

Where is the 2*frequency*t in OscillatingFi xedValuePointPatchField.C? Can anyone explain me the differencies between the last and the first formula?

Thank you!

hjasak January 31, 2009 12:01

Yes, that would be my fault.
 
Yes, that would be my fault. I've been playing with various forms, depending on whether you want the mean value in the oscillation to be zero or not and whether you prefer to start from zero (sin) or from extreme (cos).

I have no strong opinions on what this should be and soon we will have an intepreted formula here instead. Do you hav a preference? It would be easy to simply change your local version of the code (no consequences).

Apologies,

Hrv

patriem January 31, 2009 13:08

Still thinking about the frequ
 
Still thinking about the frequency.
Is that the number of oscillations per one second or the number of oscillations per given intervall (between starttime and stoptime)?

Thank you very much for answering.

I“m just getting familiar with the topic movingmesh, dynamicmesh and oscillation b.c. I also read your dissertations about the fem moving mesh solvers etc.
I want to calculate a test case and present OF to my institute (part of the University Stuttgart)
In like the oscillatingFixedValue b.c. and maybe i want to couple it with a topological layer add/removal.
But i“m just working in, so a little help is useful even if some questions may be stupid;)

patriem February 3, 2009 15:12

Hallo Foamers! At the momen
 
Hallo Foamers!

At the moment i use laplacefacedecomposition and a motonU file with oscillatingFixedValue b.c. to define mesh-motion. Version 1.4.1-dev. But i am not sure about the appropriate files:

src/finiteVolume/fields/fvPatchFields/derived/oscillatingFixedValue/
Is the internal-meshpoint motion dscribed here?

src/OpenFOAM/fields/PointPatchFields/derived/oscillatingFixedValue/OscillatingFi xedValuePointPatchField.C
Is the movement/velocity of the oscillating b. c. described here?


Thank you very much for answers, the movement of my mesh seems to be too small...


All times are GMT -4. The time now is 08:48.