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

pressuredirectedinletoutletvelocity FOAM FATAL IO ERROR

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Alczem
  • 1 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 16, 2023, 18:24
Default pressuredirectedinletoutletvelocity FOAM FATAL IO ERROR
  #1
New Member
 
Join Date: Oct 2014
Posts: 23
Rep Power: 11
s.amirzadeh is on a distinguished road
Hi there,

I am trying to give to my inlet boundary condition a direction so I am using pressureDirectedInletOutletVelocity boundary condition. below is my Bc:

inlet
{
type pressureDirectedInletOutletVelocity;
phi phi;
rho rho;
inletDirection uniform (1 0 0);
value uniform 0;
}


I get error below when I use decomposePar or simpleFoam commands:

--> FOAM FATAL IO ERROR:
Expected a '(' while reading VectorSpace<Form, Cmpt, Ncmpts>, found on line 28 the label 0

file: /home/saeidlab/OFOAMtest(1)/airFoil2D/0/U/boundaryField/inlet/value at line 28.

From function Foam::Istream& Foam::Istream::readBegin(const char*)
in file db/IOstreams/IOstreams/Istream.C at line 92.

FOAM exiting

I do not know why it is looking for a '(', since valuse must be a scalar. even if I define it as a vector it gives the error that says value must be scalar.
Can anyone help me with this issue?

I am using openfoam10 for my simulation.

Thanks in advance
s.amirzadeh is offline   Reply With Quote

Old   March 17, 2023, 03:17
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 207
Rep Power: 5
Alczem is on a distinguished road
Hey


For a vector such as U, you need to give 3 components to the value entry. So just change:


value uniform 0;


to


value uniform (0 0 0);


Cheers!
Sakun likes this.
Alczem is offline   Reply With Quote

Old   March 17, 2023, 19:56
Default
  #3
New Member
 
Join Date: Oct 2014
Posts: 23
Rep Power: 11
s.amirzadeh is on a distinguished road
Thank you very much, But how does that work if we define direction and velocity both in vector form? shouldn't it be a scalar representing the velocity magnitude and a vector representing direction?
s.amirzadeh is offline   Reply With Quote

Old   March 18, 2023, 04:11
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14
Tobermory will become famous soon enough
Reading the BC description, I think that the "value" value is not needed, but must still be included in the boundary definition (probably because this is a derived class).

To confirm this take a look at the updateCoeffs function:

Code:
 
void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::updateCoeffs()
 {
     if (updated())
     {
         return;
     }
 
     const surfaceScalarField& phi =
         db().lookupObject<surfaceScalarField>(phiName_);
 
     const fvsPatchField<scalar>& phip =
         patch().patchField<surfaceScalarField, scalar>(phi);
 
     tmp<vectorField> n = patch().nf();
     tmp<scalarField> ndmagS = (n & inletDir_)*patch().magSf();
 
     if (phi.dimensions() == dimVelocity*dimArea)
     {
         refValue() = inletDir_*phip/ndmagS;
     }
     else if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
     {
         const fvPatchField<scalar>& rhop =
             patch().lookupPatchField<volScalarField, scalar>(rhoName_);
 
         refValue() = inletDir_*phip/(rhop*ndmagS);
     }
     else
     {
         FatalErrorInFunction
             << "dimensions of phi are not correct"
             << "\n    on patch " << this->patch().name()
             << " of field " << this->internalField().name()
             << " in file " << this->internalField().objectPath()
             << exit(FatalError);
     }
 
     valueFraction() = 1.0 - pos0(phip);
 
     mixedFvPatchVectorField::updateCoeffs();
 }
... and note that the value is not used anywhere in updating the boundary values; instead it is calculated from the flux and direction.

So just set to (0 0 0) as Alczem suggests and carry on.
Alczem likes this.
Tobermory is offline   Reply With Quote

Old   March 19, 2023, 04:50
Default
  #5
Senior Member
 
Join Date: Dec 2021
Posts: 207
Rep Power: 5
Alczem is on a distinguished road
I think the value key is, for a lot of conditions, either a placeholder or just an initial value, and then the solver computes the adequate value. So the magnitude should be taken into account if you decide to use it as an initial guess for your velocity at the boundary (for instance, value uniform (0 2 0) will tell the solver to assume a 2 m/s velocity in the Y direction for the first iteration).


I hope its clear
Alczem is offline   Reply With Quote

Old   March 28, 2023, 10:32
Default
  #6
Member
 
Sakun
Join Date: Nov 2019
Location: United Kingdom
Posts: 93
Rep Power: 6
Sakun is on a distinguished road
Hi,

Sorry for the intrusion.

I am using "pressureDirectedInletOutletVelocity" as well and i would like to clear about "inletDirection".
Quote:
/*--------------------------------*- C++ -*----------------------------------* \
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
INLET
{
type pressureDirectedInletOutletVelocity;
phi phi;
rho rho;
inletDirection uniform (0.63162 -0.77527 0);
value uniform (0 0 0);

}

OUTLET
{

type pressureInletOutletVelocity;
phi phi;
tangentialVelocity uniform (0 0 0);
value uniform (0 0 0);

}

CASCADE
{
type noSlip;
}

"(TOP|BOTTOM)"
{
type cyclicAMI;
}

frontAndBackPlanes
{
type empty;
}


}


// ************************************************** *********************** //
My simulation has an inlet angle of 50.83 degrees(turbomachinery). So does it means i can define an angle in degrees in the "inletDirection" ? or do i have define as velocity component ? in this case x dir; 0.63162 y dir; -0.77527 z dir; 0
Sakun 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
[OpenFOAM] ParaView command in Foam-extend-4.1 mitu_94 ParaView 0 March 4, 2021 13:46
Mesquite - Adaptive mesh refinement / coarsening? philippose OpenFOAM Running, Solving & CFD 94 January 27, 2016 09:40
Compiling dynamicTopoFvMesh for OpenFOAM 2.1.x Saxwax OpenFOAM Installation 25 November 29, 2013 05:34
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23


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