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

Variation of gravity with time

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 18, 2022, 01:14
Default
  #41
New Member
 
Tamil Nadu
Join Date: Nov 2022
Posts: 2
Rep Power: 0
RamJedi is on a distinguished road
Thanks Jon for the response

But my first attempt was to try the code as it was posted in the forum. That itself didn't work. subsequently I tried out many options none of them worked.
g=gunits*Foam::sin(runTime.value()*pi*2.0 *freq)*vector(0,0,1);
g=gunits*vector(0,0,1);
g=vector(0,0,1);
All of them give a type mismatch.

My understanding from the error message is that g is of the type gravity whereas the expression on the RH is of the type dimensioned vector. So it isn't able to assign.

In fact the full error message is as below
interFoam2.C:113:3: error: no match for âoperator=â (operand types are âconst Fo am::meshObjects::gravityâ and âFoam::dimensioned<Foam::Vector<double> >â)
g=gunits*Foam::sin(runTime.value()*pi*2.0*freq)*ve ctor(0,0,1);
^
interFoam2.C:113:3: note: candidate is:
In file included from /scratch/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclud e/fvCFD.H:24:0,
from interFoam2.C:38:
/scratch/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude/gravityMeshObject.H: 53:7: note: Foam::meshObjects::gravity& Foam::meshObjects::gravity:perator=(co nst Foam::meshObjects::gravity&) <deleted>
class gravity
^
/scratch/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude/gravityMeshObject.H: 53:7: note: no known conversion for argument 1 from âFoam::dimensioned<Foam::V ector<double> >â to âconst Foam::meshObjects::gravity&â



On a different note do you have any idea on what Foam::sin() returns? I expected that it would return a double. So I had put it inside the vector definition.
RamJedi is offline   Reply With Quote

Reply

Tags
gravity, time, variation


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
Time step size and max iterations per time step pUl| FLUENT 31 October 23, 2020 23:50
Simulation of sloshing by time varying gravity Manoj Kumar FLUENT 3 June 13, 2011 04:34
PostChannel maka OpenFOAM Post-Processing 5 July 22, 2009 10:15
Problems with simulating TurbFOAM barath.ezhilan OpenFOAM 13 July 16, 2009 06:55
variation of gravity with time rajani FLUENT 0 February 16, 2005 03:45


All times are GMT -4. The time now is 21:25.