|
[Sponsors] |
|
October 5, 2014, 21:28 |
|
#1 |
Senior Member
|
Hello
I need varying BC for interstitialInletVelocity which can be found in DPMFoam/Goldschemidt. Using table for fixed value: Code:
bottom { type uniformFixedValue; uniformValue table ( (0 (0 0 1)) (0.001 (0 0 2)) (0.002 (0 0 3)) (0.003 (0 0 4)) ); } The default is: Code:
bottom { type interstitialInletVelocity; inletVelocity uniform (0 0 1); value uniform (0 0 1); phi phi.air; alpha alpha.air; } Code:
bottomSB { type interstitialInletVelocity; inletVelocity uniformFixedValue; uniformValue table ( (0 (0 0 1)) (0.001 (0 0 2)) (0.002 (0 0 3)) (0.003 (0 0 4)) ); value table ( (0 (0 0 1)) (0.001 (0 0 2)) (0.002 (0 0 3)) (0.003 (0 0 4)) ); phi phi.air; alpha alpha.air; } Code:
--> FOAM FATAL IO ERROR: expected keyword 'uniform' or 'nonuniform', found table file: /home/user/OpenFOAM/user-2.3.0/run/tutorials/lagrangian/DPMFoam/test/0/U.air.boundaryField.bottom from line 52 to line 70. From function Field<Type>::Field(const word& keyword, const dictionary&, const label) in file /home/user/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/Field.C at line 304. FOAM exiting Code:
--> FOAM FATAL IO ERROR: wrong token type - expected Scalar, found on line 64 the punctuation token '(' file: /home/user/OpenFOAM/user-2.3.0/run/tutorials/lagrangian/DPMFoam/test/0/U.air.boundaryField.bottom.value at line 64. From function operator>>(Istream&, Scalar&) in file lnInclude/Scalar.C at line 93. FOAM exiting Best, |
|
October 12, 2014, 12:47 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Maysam: Unfortunately I don't have enough time to give the whole solution, but I think I can still give information on why that didn't work and what can be done to fix the problem.
Bruno
__________________
|
|
October 18, 2014, 14:55 |
|
#4 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Hi Maysam,
Quote:
Bruno
__________________
|
|||
October 19, 2014, 01:06 |
|
#5 | |
Senior Member
|
Hi Bruno,
I know the difference between u and U, the actual and superficial velocity with relation of U=alpha*u. This is the main advantage of "interstitialInletVelocity" to "fixedValue" and "uniformFixedaValue". My question was about why there are two entries in 0/U.air Quote:
|
||
October 21, 2014, 17:26 |
|
#6 |
Senior Member
|
We want use available boundary conditions of fixedValue (BC1), uniformFixedValue (BC2) and interstitialInletVelocity (BC3) to write own myInterstitialInletVelocity (BC4).
BC4 will have advantages of BC3 (which accounts alpha to have constant mass flow rate in multiphase flows) and BC2 (which accepts table to apply time varying air velocity). The first step is compiling BC in user directory. 1- Copying BC3 from source to user directory and renaming it to my0InterstitialInletVelocity. Code:
$FOAM_SRC/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity to $WM_PROJECT_USER_DIR/src/finiteVolume/fields/fvPatchFields/derived/my0interstitialInletVelocity 3- Writing an appropriate Make/files and options and then compiling it in: Code:
$WM_PROJECT_USER_DIR/src/finiteVolume/ Code:
libs ("libmyFiniteVolume.so"); The link of GoldschemidtBC contains my0InterstitialInletVelocity BC in 0/U.air and dictionary in it is controlDict. The src link contains BC1 to BC4. but is compiled for "my0InterstitialInletVelocity". The BC4 doesn't work which will be discussed later. Code:
https://www.dropbox.com/s/b54r786b167bmxw/src.tar.gz?dl=0 https://www.dropbox.com/s/8fpj3os65a8hnp9/GoldschmidtBC.tar.gz?dl=0 The next step is doing modification in myInterstitialInletVelocity (BC4) to possible accepting table. The difference of BC2 to BC1 are: 1- BC2 has a new parameter definition: Code:
const Field<Type>& fld Code:
uniformValue_() 2- BC1 uses mapper (which I don't know what does it do): Code:
fixedValueFvPatchField<Type>::fixedValueFvPatchField ( const fixedValueFvPatchField<Type>& ptf, const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const fvPatchFieldMapper& mapper ) : fvPatchField<Type>(ptf, p, iF, mapper) { if (&iF && mapper.hasUnmapped()) { WarningIn ( "fixedValueFvPatchField<Type>::fixedValueFvPatchField\n" "(\n" " const fixedValueFvPatchField<Type>&,\n" " const fvPatch&,\n" " const DimensionedField<Type, volMesh>&,\n" " const fvPatchFieldMapper&\n" ")\n" ) << "On field " << iF.name() << " patch " << p.name() << " patchField " << this->type() << " : mapper does not map all values." << nl << " To avoid this warning fully specify the mapping in derived" << " patch fields." << endl; } } Code:
template<class Type> uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ( const uniformFixedValueFvPatchField<Type>& ptf, const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const fvPatchFieldMapper& mapper ) : fixedValueFvPatchField<Type>(p, iF), // bypass mapper uniformValue_(ptf.uniformValue_().clone().ptr()) { // Evaluate since value not mapped const scalar t = this->db().time().timeOutputValue(); fvPatchField<Type>::operator==(uniformValue_->value(t)); } 3- we see time again in next class. In this one, it is looking for value or table: Code:
template<class Type> uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField ( const fvPatch& p, const DimensionedField<Type, volMesh>& iF, const dictionary& dict ) : fixedValueFvPatchField<Type>(p, iF), uniformValue_(DataEntry<Type>::New("uniformValue", dict)) { if (dict.found("value")) { fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size())); } else { const scalar t = this->db().time().timeOutputValue(); fvPatchField<Type>::operator==(uniformValue_->value(t)); } } However, I tried many different tries and errors by adding classes to BC4 but not possible to compile it successfully. Two possibles for errors are: 1- mistakes in defining parameters 2- two "operator== ..." in updateCoeff of BC4: Code:
void Foam::myInterstitialInletVelocityFvPatchVectorField::updateCoeffs() { Info << "Banana1" <<endl; if (updated()) { return; } const scalar t = this->db().time().timeOutputValue(); // fvPatchField<vector>::operator==(uniformInletVelocity_->value(t)); // // fixedValueFvPatchField<Type>::updateCoeffs(); // const fvPatchField<scalar>& alphap = patch().lookupPatchField<volScalarField, scalar>(alphaName_); operator==(uniformInletVelocity_/alphap); fixedValueFvPatchVectorField::updateCoeffs(); } Sorry for this long post and thanks in advance for any suggestion. Last edited by maysmech; October 21, 2014 at 21:08. |
|
November 5, 2014, 16:31 |
|
#7 | |
New Member
Charlie
Join Date: May 2014
Posts: 9
Rep Power: 12 |
Quote:
This is what exactly I need for finding minimum fluidization velocity. I need a gradually increase in fluidization velocity. I used table with fixed value but the results was mistake because of inlet porosity is not considered in fixedValue. Did you find any solution? Please share it if you have found. Best regards. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Time dependant pressure boundary condition | yosuke1984 | OpenFOAM Verification & Validation | 3 | May 6, 2015 06:16 |
plot over time | fferroni | OpenFOAM Post-Processing | 7 | June 8, 2012 07:56 |
External Radiation Boundary Condition (Two sided wall), Grid Interface | CFD XUE | FLUENT | 0 | July 8, 2010 06:49 |
vorticity boundary condition | bearcharge | Main CFD Forum | 0 | May 14, 2010 11:32 |
Time Varying Boundary Conditon | ashish | CFX | 3 | February 15, 2005 06:21 |