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

Another option to "SWAK4FOAM"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 16, 2015, 04:03
Default Another option to "SWAK4FOAM"
  #1
New Member
 
Stefan
Join Date: Oct 2015
Location: Bavaria, Germany
Posts: 6
Rep Power: 10
Stefan_thi is on a distinguished road
Hello dear Foamers,

i´d like to simulate an air vane motor to improve it.
The criteria of convergence should be the pressure drop between a plane at the inlet and a plane at the outlet of the vane motor.
Google search offered me the "swak4foam" as possibility to solve my problem.
Unfortunately the software admistrator of my university does not want to install additional software.

So my final question: Is there another way to transpose "my idea"?


Thank you very much


PS: I hope my english is as well as you understand my needs ;-)
Stefan_thi is offline   Reply With Quote

Old   October 16, 2015, 04:19
Default
  #2
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
Hi,

There are several possibilities:

1. Compile swak4Foam in your home folder. I.e. it will be just local installation and you do not need administrator for this.

2. Use codedFunctionObject for check for convergence criterion and finish simulation. See description in $FOAM_SRC/postProcessing/functionObjects/utilities/codedFunctionObject/codedFunctionObject.H.

Surely there are more (like, modify solver to check for your specific convergence criterion).

After you resolve problems with compilation of swak4Foam (it will be another story) or figure out exact syntax for coded function object, you need to define "pressure drop between a plane at the inlet and a plane at the outlet" more strictly.

Last edited by alexeym; October 16, 2015 at 04:20. Reason: second thought
alexeym is offline   Reply With Quote

Old   October 16, 2015, 04:36
Default
  #3
New Member
 
Stefan
Join Date: Oct 2015
Location: Bavaria, Germany
Posts: 6
Rep Power: 10
Stefan_thi is on a distinguished road
Quote:
Originally Posted by alexeym View Post

After you resolve problems with compilation of swak4Foam (it will be another story) or figure out exact syntax for coded function object, you need to define "pressure drop between a plane at the inlet and a plane at the outlet" more strictly.
Thanks for your reply.

I´d like to define a plane/plain (french: région) before and after the vane motor. OpenFOAM should calculate the total pressure in this plane/plain by integration.
I get the pressure drop by substracting the pressore of the outlet from the pressure at the inlet.
Stefan_thi is offline   Reply With Quote

Old   October 16, 2015, 05:13
Default
  #4
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
Hi,

C'est un plan (en, fr, de) si nous parlons de mathématiques

In fact new definition is not exactly more precise than the previous one. Since in your simulation you do not have planes before and after motor, but you have mesh, you need to talk in terms of mesh.

1. Does your mesh move? I.e. you just need to define mapping between mesh cells and planes just once of update it every step.

2. What are integration variables in your integral? In the plane you have pressure values and areas of the plane elements. I can imagine calculation of mean pressure (\frac{\sum_i p_iA_i}{\sum_i A_i}), yet what is "total pressure"?

By "more strictly" in my previous message I did not mean wording but mathematical strictness. Since your convergence criterion implementation will base on math, not vice versa.
alexeym is offline   Reply With Quote

Old   October 16, 2015, 05:59
Default
  #5
New Member
 
Stefan
Join Date: Oct 2015
Location: Bavaria, Germany
Posts: 6
Rep Power: 10
Stefan_thi is on a distinguished road
One more try to explain the plane. (little poem)


In this picture you see the inlet and outlet of the vane motor.
Is there a possibility to determine the pressure at the inlet and at the outlet? So that i can change the geometry in CAD and make the vane motor more efficient?

1. The mesh is not moving YET. This will be the next step after finding a solution for my first problem.

2. The integration was only an example.


Stefan
Stefan_thi is offline   Reply With Quote

Old   October 16, 2015, 08:05
Default
  #6
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
Yes, it is possible to determine pressure at the inlet and at the outlet. Though it is you, who decides how to do it (i.e. for example in functionObject you have access to mesh and boundaries, so you have access to pressure values in the cells/faces, for the case of uniform pressure distribution everything is obvious, in case of non-uniform spatial distribution, you have to decide, what to do with this non-uniform distribution).
alexeym is offline   Reply With Quote

Old   October 18, 2015, 14:12
Default
  #7
New Member
 
Stefan
Join Date: Oct 2015
Location: Bavaria, Germany
Posts: 6
Rep Power: 10
Stefan_thi is on a distinguished road
Many thanks for your reply, alexeym

So i could define the needed cells/faces to determine the pressure in it (with functionObjects)?

Unfortunately i don´t know, if there´s a uniform or non-uniform pressure distribution.

Another question: how to use the functionOptions?
Stefan_thi is offline   Reply With Quote

Old   October 19, 2015, 02:31
Default
  #8
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
Hi,

Quote:
Originally Posted by Stefan_thi View Post
So i could define the needed cells/faces to determine the pressure in it (with functionObjects)?
Yes, you can. Since your inlet and outlet look like boundaries, you can iterate over them, get pressure (or any other flow variable) and do whatever you like with these values.

Quote:
Another question: how to use the functionOptions?
https://www.google.fr/search?q=openf...nction+objects

Or use search engine of your preference.
alexeym is offline   Reply With Quote

Old   October 25, 2015, 08:08
Default
  #9
New Member
 
Stefan
Join Date: Oct 2015
Location: Bavaria, Germany
Posts: 6
Rep Power: 10
Stefan_thi is on a distinguished road
Hallo,

i have another problem using the functionObjects. I would like to use faceSource to determine the pressure at the inlet.

But the simultion stops because of an Fatal Error:

[5] #1 Foam::IOerror::abort()[0]
[0]
[0] --> FOAM FATAL IO ERROR:
[0] Invalid plane type: patch
[0]
[0] file: /home/ESPL_001/ft2624/Documents/rechenfallniko/processor0/../system/controlDict::functions:lan0_average::sampledSurf aceDict from line 32 to line 41.
[0]
[0] From function plane:lane(const dictionary&)
[0] in file meshes/primitiveShapes/plane/plane.C at line 233.


But patch should be a valid plane type

type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");

enabled true;
outputControl timeStep; //outputTime timeStep
outputInterval 1;

// Output to log&file (true) or to file only
log true;

// Output field values as well
valueOutput false; //true;

// Type of source: patch/faceZone/sampledSurface
source patch; // sampledSurface
SourceName inlet;

Which plane type is defined to the inlet?
The plane type of the inlet is defined to "patch" in the blockMeshDict, right?

frontAndBack
{
type patch;
faces
(
(4 5 6 7)
(0 3 2 1)
(7 6 10 11)
(8 9 2 3)
);
}
inlet
{
type patch;
faces
(
(0 4 7 3)
);
}
outlet
{
type patch;
faces
(
(3 7 11 8)
);
}


Stefan
Stefan_thi is offline   Reply With Quote

Old   October 25, 2015, 12:15
Default
  #10
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
Hi,

Could you post whole controlDict? In the message it is said that the error is in

Code:
system/controlDict::functions::plan0_average::sampledSurfaceDict
dictionary, yet you did not post it.
alexeym is offline   Reply With Quote

Old   October 25, 2015, 13:26
Default
  #11
New Member
 
Stefan
Join Date: Oct 2015
Location: Bavaria, Germany
Posts: 6
Rep Power: 10
Stefan_thi is on a distinguished road
Yes, of course.

Here the hole controlDict.

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application simpleFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 1000;

deltaT 1;

writeControl timeStep;

writeInterval 200;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression compressed;

timeFormat general;

timePrecision 6;

runTimeModifiable true;

functions
{
// #include "readFields"
// #include "streamLines"
// #include "cuttingPlane"
#include "forceCoeffs"
#include "inlet_average"
}


// ************************************************** *********************** //


Please notice: The function plan0_average is now called inlet_average


Here the hole script of inlet_average:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/

inlet_average
{
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");

enabled true;
outputControl timeStep; //outputTime timeStep
outputInterval 1;

// Output to log&file (true) or to file only
log true;

// Output field values as well
valueOutput false; //true;

// Type of source: patch/faceZone/sampledSurface
source sampledSurface; // sampledSurface
SourceName inlet;

source sampledSurface;

sampledSurfaceDict
{
type cuttingPlane;
planeType pointAndNormal; //pointAndNormal
planeName inlet; //planeName
pointAndNormalDict
{
basePoint (0.02 0 0);
normalVector (1 0 0);
}
source cells; // sample cells or boundaryFaces
interpolate true;
}

// Operation: areaAverage/sum/weightedAverage ...
operation areaAverage;

fields (

U

p

);
}


// ************************************************** *********************** //
Stefan_thi is offline   Reply With Quote

Old   October 26, 2015, 05:57
Default
  #12
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
Guess there is no error with this dictionary? If you like to have sampledSurface as a patch, it is called sampledPatch. According to constructor you should provide list of patches and triangulate option. So dictionary should look like:

Code:
sampledSurfaceDict
{
    type sampledPatch;
    patches ( inlet );
    triangulate no;  // this is default in fact do you can drop it
}
You can find names of sampledSurface types in $FOAM_SRC/sampling/sampledSurface.
alexeym is offline   Reply With Quote

Reply


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
Setting the height of the stream in the free channel kevinmccartin CFX 12 October 13, 2022 21:43
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 07:30
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Water subcooled boiling Attesz CFX 7 January 5, 2013 03:32


All times are GMT -4. The time now is 16:33.