|
[Sponsors] |
pressuredirectedinletoutletvelocity FOAM FATAL IO ERROR |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 16, 2023, 19:24 |
pressuredirectedinletoutletvelocity FOAM FATAL IO ERROR
|
#1 |
New Member
Join Date: Oct 2014
Posts: 23
Rep Power: 12 |
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 |
|
March 17, 2023, 04:17 |
|
#2 |
Senior Member
Join Date: Dec 2021
Posts: 251
Rep Power: 6 |
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! |
|
March 17, 2023, 20:56 |
|
#3 |
New Member
Join Date: Oct 2014
Posts: 23
Rep Power: 12 |
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?
|
|
March 18, 2023, 05:11 |
|
#4 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
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(); } So just set to (0 0 0) as Alczem suggests and carry on. |
|
March 19, 2023, 05:50 |
|
#5 |
Senior Member
Join Date: Dec 2021
Posts: 251
Rep Power: 6 |
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 |
|
March 28, 2023, 11:32 |
|
#6 | |
Senior Member
Sakun
Join Date: Nov 2019
Location: United Kingdom
Posts: 152
Rep Power: 7 |
Hi,
Sorry for the intrusion. I am using "pressureDirectedInletOutletVelocity" as well and i would like to clear about "inletDirection". Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] ParaView command in Foam-extend-4.1 | mitu_94 | ParaView | 0 | March 4, 2021 14:46 |
Mesquite - Adaptive mesh refinement / coarsening? | philippose | OpenFOAM Running, Solving & CFD | 94 | January 27, 2016 10:40 |
Compiling dynamicTopoFvMesh for OpenFOAM 2.1.x | Saxwax | OpenFOAM Installation | 25 | November 29, 2013 06:34 |
checking the system setup and Qt version | vivek070176 | OpenFOAM Installation | 22 | June 1, 2010 13:34 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 11:23 |