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

Coded boundary condition for dynamic mesh

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 15, 2018, 09:33
Default Coded boundary condition for dynamic mesh
  #1
New Member
 
Delchini Marc-Olivier
Join Date: Dec 2016
Posts: 7
Rep Power: 10
delcmo is on a distinguished road
Hello,

I am trying to model a synthetic jet that is produced by a membrane vibrating in a cavity. The membrane is treated as a boundary condition that is a function of space and time as follows: sin(freq*time)*sin(pi*x) where freq is the frequency, time is time, and x is the spatial coordinates.

I started from the example located in '/opt/openfoam4/tutorials/incompressible/pimpleDyMFoam/movingCone'

One option I tried is to use the coded boundary condition class. I successfully implemented a parabolic inlet velocity boundary condition for velocity and temperature fields as a training exercise. I then tried the same approach for pointMotionUx but this variable is defined at vertices and not cell centers.

I was able to figure out functions to access time and vertices (I think) using Doxygen. The current version of the boundary implementation is the following:

Code:
            const polyMesh& mesh = this->internalField().mesh()();
            const Time& tt = mesh.time();
            const pointPatch& p = this->patch();

            operator==( sin(constant::mathematical::pi*10*t)*sin(10*p.localPoints() );
when openfoam compiles before running, I get the below error message:

/home/openfoam/run/piston/0/pointMotionUx.boundaryField.inlet: In member function 'virtual void Foam::testFixedValuePointPatchScalarField::updateC oeffs()':
/home/openfoam/run/piston/0/pointMotionUx.boundaryField.inlet:71:85: error: no matching function for call to 'sin(Foam::tmp<Foam::Field<Foam::Vector<double> > >)'

Any help would be appreciated.

Thanks,

Marco
delcmo is offline   Reply With Quote

Old   March 17, 2018, 03:41
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

The error is quite clear: there is no sin function with vector argument, since p.localPoints() is a list of points, which are vectors. Use component method of Field class (https://cpp.openfoam.org/v5/classFoa...5fd130cb44a20e) to extract X (or whatever) component of point coordinate. Also, since you have tmp<Field<...>>, you need to use () operator to get to underlying Field object.
alexeym 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
Wind turbine simulation Saturn CFX 60 July 17, 2024 06:45
3D Windturbine simulation in SU2 k.vimalakanthan SU2 15 October 12, 2023 06:53
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


All times are GMT -4. The time now is 06:31.