CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   simulation of horizontal axis wind turbine using openfoam (https://www.cfd-online.com/Forums/openfoam-solving/218339-simulation-horizontal-axis-wind-turbine-using-openfoam.html)

mostafa kamal June 17, 2019 13:02

simulation of horizontal axis wind turbine using openfoam
 
2 Attachment(s)
hello everyone,iam trying to simulate flow on a horizontal axis wind turbine using openfoam
so there are many questions i need your help for :
1- after my search about a solver that solves( incompressible + transient + turbulent + supports moving rotating mesh+SRF) , i found a solver named SRFpimplefoam so is this the suitable solver for my case?

2- the second thing i need to tell you that i made the geometry and the mesh of 1 blade using ansys and i made the meshing on 1 blade with periodic boundary condition and after that i exported the mesh and the openfoam read the mesh file successfully using (FluentMeshToFoam command) with no problems ,after that i searched for any tutorial relating to this i found the rotor2D tutorial but when i ran the SRFpimplefoam it gives error i think because it is a different case

so my basic question: with this mesh file how can i modify the rotor2D tutorial to be a horizontal axis wind turbine?

thanks in advance

Krao June 19, 2019 06:08

Hi,

You can try using MRF simpleFoam, it is the best way I have found out for simulating the rotating geometries.

Go through the following link, and also for setting up AMI go with propeller tutorial in incompressible pimple folder
https://de.slideshare.net/fumiyanoza...using-openfoam

There are abundant materials available here in this forum for MRF simpleFoam and I hope you can make great progress with it. Go through the following link where you can see a case similar to yours. https://www.cfd-online.com/Forums/op...-pressure.html

Regards,
Krao

mostafa kamal July 1, 2019 03:49

hi, Krao
actually iam using SRFSimpleFoam and iam trying to modify the tutorial of mixer to be my case ,to be honest i faced some problems such that
1- when converting the mesh from ansys to openfoam it converted correctly but the periodic faces haven't been recognized it was patch type in the boundary file so i used createPatchDict to transform to cyclic and it has been transformed then i run check mesh ,but there was 1 check mesh failed (due to skew faces) i don't know is it ok here to run or not ?
2- but when i run the simulation but it crashed because of the residual of time step error increases (divergence problem)

i tried to modify the solver and non orthogonal correctors but same error appeared

so is the problem that making the mesh (having a periodic boundries) with external mesher then converting it to foam is it ok or i should use blockmesh and snappyhexmesh so openfoam can understand better?

Krao July 1, 2019 05:02

Hi Mostafa,

The divergence maybe due to the skewness in the mesh.

I usually use cfMesh for meshing and I don't have much experience to convert mesh from one software to another. But there are many people who use ansys or other commercial software for meshing. So, I think it should not be a problem. I also define the cyclic patches using createPatchDict, so there should not be any problem. Did you try running checkMesh after converting the mesh from fluentToFoam? Or try defining the periodic boundaries as normal patches in ansys and then try to rename it using createPatchDict

Krao

Krao July 1, 2019 07:02

Hi,

I read your new post here https://www.cfd-online.com/Forums/op...-tutorial.html, where you have given more information. I went through the tutorials and found out that Mixer tutorial uses 'cyclic' condition. For using cyclic you should be having exactly the same mesh on each side of the patch pairs. The properties listed in OpenFOAM manual for 'cyclic' are as follows

-Coupling condition between a pair of patches
-Faces on each coupled patch must have the same topology, i.e. they must have collocated points such a one-to-one mapping exists between the faces on each side.
-The coupling is treated implicitly using the cell values adjacent to each pair of cyclic patches
-The face values are determined using linear interpolation between the cell values


If you go through the boundary files of mixer tutorial it has got exactly the same number of faces on each side,

cyclic_half0
{
type cyclic;
inGroups 1(cyclic);
nFaces 1600;
startFace 101720;
matchTolerance 0.0001;
transform rotational;
neighbourPatch cyclic_half1;
rotationAxis (0 0 1);
rotationCentre (0 0 0);
}
cyclic_half1
{
type cyclic;
inGroups 1(cyclic);
nFaces 1600;
startFace 103320;
matchTolerance 0.0001;
transform rotational;
neighbourPatch cyclic_half0;
rotationAxis (0 0 1);
rotationCentre (0 0 0);
}

Check once again in boundary file whether the patches on each side of cyclic have the same number of faces and also check for the meshing errors. Some times due to sharp corners and non-adequate mesh refinements, the mesher would fail to replicate the geometry

Krao

mostafa kamal July 1, 2019 07:06

4 Attachment(s)
look at these pictures

Krao July 1, 2019 07:12

Can you please attach your boundary file? Its in constant/polymesh

mostafa kamal July 1, 2019 08:23

1 Attachment(s)
thanks krao
i checked the number of faces on each boundry and it was the same number on each cyclic faces
first the boundry file contains the 2 boundreies (wall) that must be peroidic so i changed them to patch then i used createPatchDict to convert these to cyclic but when i run createPatch -overwrite
this error appeared actually iam stuck in this problem for weeks till now
this is the error that appeared
thank you for your responce

mostafa kamal July 1, 2019 08:26

look at these
(boundry file)
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

6
(
outerWall
{
type wall;
inGroups 1(wall);
nFaces 300;
startFace 2069245;
}
inlet
{
type patch;
nFaces 57;
startFace 2069545;
}
outlet
{
type patch;
nFaces 63;
startFace 2069602;
}
periodic_0
{
type patch;
nFaces 1339;
startFace 2069665;
}
periodic_1
{
type patch;
nFaces 1339;
startFace 2071004;
}
innerWall
{
type wall;
inGroups 1(wall);
nFaces 20452;
startFace 2072343;
}
)

// ************************************************** *********************** //
and this is the createPatchDict
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object createPatchDict;
}

// This application/dictionary controls:
// - optional: create new patches from boundary faces (either given as
// a set of patches or as a faceSet)
// - always: order faces on coupled patches such that they are opposite. This
// is done for all coupled faces, not just for any patches created.
// - optional: synchronise points on coupled patches.

// 1. Create cyclic:
// - specify where the faces should come from
// - specify the type of cyclic. If a rotational specify the rotationAxis
// and centre to make matching easier
// - always create both halves in one invocation with correct 'neighbourPatch'
// setting.
// - optionally pointSync true to guarantee points to line up.

// 2. Correct incorrect cyclic:
// This will usually fail upon loading:
// "face 0 area does not match neighbour 2 by 0.0100005%"
// " -- possible face ordering problem."
// - in polyMesh/boundary file:
// - loosen matchTolerance of all cyclics to get case to load
// - or change patch type from 'cyclic' to 'patch'
// and regenerate cyclic as above

// Do a synchronisation of coupled points after creation of any patches.
// Note: this does not work with points that are on multiple coupled patches
// with transformations (i.e. cyclics).
pointSync false;

// Patches to create.
patches
(
{
// Name of new patch
name cyclic_half0;

// Dictionary to construct new patch from
patchInfo
{
type cyclic;
neighbourPatch cyclic_half1;

// Optional: explicitly set transformation tensor.
// Used when matching and synchronising points.
transform rotational;
rotationAxis (0 0 1);
rotationCentre (0 0 0);
// transform translational;
// separationVector (1 0 0);

// Optional non-default tolerance to be able to define cyclics
// on bad meshes
matchTolerance 1E-2;
}

// How to construct: either from 'patches' or 'set'
constructFrom patches;

// If constructFrom = patches : names of patches. Wildcards allowed.
patches (periodic_0);

// If constructFrom = set : name of faceSet
set f0;
}
{
// Name of new patch
name cyclic_half1;

// Dictionary to construct new patch from
patchInfo
{
type cyclic;
neighbourPatch cyclic_half0;

// Optional: explicitly set transformation tensor.
// Used when matching and synchronising points.
transform rotational;
rotationAxis ( 0 0 1 );
rotationCentre ( 0 0 0 );
}

// How to construct: either from 'patches' or 'set'
constructFrom patches;

// If constructFrom = patches : names of patches. Wildcards allowed.
patches (periodic_1);

// If constructFrom = set : name of faceSet
set f0;
}
);

Krao July 1, 2019 09:00

Go through this link once https://www.cfd-online.com/Forums/op...port-icem.html

Try running renumberMesh -overwrite, before createpatchdict. Comment out this line 'set f0;'. Since the new patches are not created by face set. Apart from this I don't see any problem

A sample of mine is attached for your reference

pointSync false;

// Patches to create.
patches
(
{
//- Master side patch
name AMI1;
patchInfo
{
type cyclicAMI;
matchTolerance 0.1;
neighbourPatch AMI2;
transform noOrdering;
}
constructFrom patches;
patches (cylinderInner);
}

{
//- Slave side patch
name AMI2;
patchInfo
{
type cyclicAMI;
matchTolerance 0.1;
neighbourPatch AMI1;
transform noOrdering;
}
constructFrom patches;
patches (cylinderOuter);
}
}

If nothing works out try cyclicAMI instead cyclic as cyclic requires exact face matching at each and every point

mostafa kamal July 1, 2019 09:30

3 Attachment(s)
thank you i tried what you said but unfortunatly when i run createPatchDict it gave me this error in 1.png it is a lot of sentences trying to order faces

then after it finished it tells me
''face 0 area does not match neighbour by 183.163% -- possible face ordering problem'' as attached in 1.png

actually this error is still appearing in my trials through cyclic

when i used cyclicAMI instead of cyclic it gives me this 3.png a divergence problem

i still don't know if the problem is preparing the configuration of my problem in the case file or the problem is the mesh itself that i must use blockmesh and snappyhexmesh

thanks krao

Krao July 1, 2019 10:06

I think it should be with meshing. Go through this link https://www.cfd-online.com/Forums/op...condition.html fully and read the last comment carefully. I hope you solve the problem, all the best.


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