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

Boundary Condition for rotating mesh w/ polynomial inlet profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 13, 2023, 15:17
Default Boundary Condition for rotating mesh w/ polynomial inlet profile
  #1
New Member
 
Patrick
Join Date: Jan 2023
Posts: 2
Rep Power: 0
PatrickCFD is on a distinguished road
OF7 (no groovyBC)

What I have:
1.png
- Curved mesh that rotates around a fixed point outside of the mesh (via dynamicMesh)
- Inlet boundary condition is a polynomial profile, which means that the inlet flow varies across one axis (in the picture the red vertices depict the highest velocities). I have integrated the profile like this:
inlet
{
type fixedProfile;
profile polynomial
(
((-1.9 0 -1.0) (1 0 1))
);
direction (1 0 0);
origin 0;
}

The numbers in the double brackets determine the angle and the velocity of the inlet flow.

The Problem:
2.png
I have a transient simulation and the angle of the flow stays the same while the angle of the inlet changes during the rotation of the mesh.

What I would like to have:
I would like for the inlet flow to always be perpendicular to the inlet surface during rotation. I couldn`t find a suitable boundary condition that covers a mesh/inlet rotation plus a polynomial profile. I guess a fixedProfile type is the only one that allows polynomial profiles to be created?!

Thanks in advance.
PatrickCFD is offline   Reply With Quote

Old   January 24, 2023, 07:31
Default
  #2
New Member
 
Patrick
Join Date: Jan 2023
Posts: 2
Rep Power: 0
PatrickCFD is on a distinguished road
I tried going down the "codedFixedValue" route. I use the following code:

code
#{
const fvPatch& boundaryPatch = patch();
const vectorField& Cf = boundaryPatch.Cf();
const vectorField& n = boundaryPatch.nf();
vectorField& field = *this;


const scalar vmin = 25.597;
const scalar vmax = 35;
const scalar dmin = 24.5;
const scalar h = 9;

forAll(Cf, faceI)
{
const scalar x = Cf[faceI].x();
const scalar z = Cf[faceI].z()-33.5;
const scalar distance = pow(x*x+z*z,0.5);
const scalar faceVel = vmin + (distance - dmin) * (vmax - vmin)/h;

field[faceI] = faceVel*n;
}
#}

Apart from the last line of code everything seems to work, at least run through. But the last line (57) messes up the whole thing.


The displayed errors are:

processor0/0/U/boundaryField/inlet:57:17: no match for »operator=« (operand types are »Foam::Vector<double>« and »Foam::tmp<Foam::Field<Foam::Vector<double> > >«)
- processor0/0/U/boundaryField/inlet:57:17: candidates are:
In file included from /opt/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/vector.H:39:0,
from /opt/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/point.H:35,
from /opt/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/pointField.H:35,
from /opt/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/edge.H:40,
from /opt/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/edgeList.H:32,
from /opt/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/PrimitivePatch.H:56,
from /opt/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/primitivePatch.H:35,
from /opt/OpenFOAM/OpenFOAM-8/src/OpenFOAM/lnInclude/polyPatch.H:43,
from /opt/OpenFOAM/OpenFOAM-8/src/finiteVolume/lnInclude/fvPatch.H:39,
from /opt/OpenFOAM/OpenFOAM-8/src/finiteVolume/lnInclude/fvPatchField.H:47,
from /opt/OpenFOAM/OpenFOAM-8/src/finiteVolume/lnInclude/fixedValueFvPatchField.H:54,
from /opt/OpenFOAM/OpenFOAM-8/src/finiteVolume/lnInclude/fixedValueFvPatchFields.H:29,
from fixedValueFvPatchFieldTemplate.H:37,
from fixedValueFvPatchFieldTemplate.C:25:

I guess OpenFOAM wants me to use a vector or anything. But by choosing a vector I determine a direction which I don't want since I rotate the whole mesh (including the inlet). Maybe someone can make something of this. I'm thankful for the tiniest of responses.
PatrickCFD is offline   Reply With Quote

Reply

Tags
boundary condition, codedfixedvalue, field[facei], polynomial profiles, rotating mesh


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
Using UDF to define velocity gradient boundary condition (not velocity inlet profile) uconcorde Fluent UDF and Scheme Programming 3 December 11, 2023 13:56
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 06:38
Inlet boundary condition with existed velocity profile wanjia SU2 9 May 10, 2017 06:33
inlet velocity boundary condition murali CFX 5 August 3, 2012 09:56
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05


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