CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM

Coded boundary condition for dynamic mesh

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

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

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:

            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.


delcmo is offline   Reply With Quote

Old   March 17, 2018, 02:41
Senior Member
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym

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 ( 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


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
3D Windturbine simulation in SU2 k.vimalakanthan SU2 15 October 12, 2023 05:53
Wind turbine simulation Saturn CFX 58 July 3, 2020 01:13
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 07:30
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 15:55

All times are GMT -4. The time now is 19:49.