|
[Sponsors] |
March 15, 2018, 09:33 |
Coded boundary condition for dynamic mesh
|
#1 |
New Member
Delchini Marc-Olivier
Join Date: Dec 2016
Posts: 7
Rep Power: 10 |
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() ); /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 |
|
March 17, 2018, 03:41 |
|
#2 |
Senior Member
|
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. |
|
|
|
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 |