|
[Sponsors] |
multiphaseEulerFoam: method mag(...) withing method solveAlphase() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 21, 2013, 11:13 |
multiphaseEulerFoam: method mag(...) withing method solveAlphase()
|
#1 |
Senior Member
Join Date: Jan 2012
Posts: 166
Rep Power: 14 |
hi,
within method solveAlphas in file multiphaseSystem.C of the multiphaseEulerFoam solver is found: Code:
//SNIPPET 1 (mag(phi_) + mag(phase1.phi() - phase2.phi()))/mesh_.magSf() Code:
//SNIPPET 2 template<class Type, template<class> class PatchField, class GeoMesh> 323*tmp<GeometricField<scalar, PatchField, GeoMesh> > mag 324*( 325* const GeometricField<Type, PatchField, GeoMesh>& gf //const surfaceScalarField& phi_ 326*) 327*{ 328* tmp<GeometricField<scalar, PatchField, GeoMesh> > tMag 329* ( 330* new GeometricField<scalar, PatchField, GeoMesh> 331* ( 332* IOobject 333* ( 334* "mag(" + gf.name() + ')', 335* gf.instance(), 336* gf.db(), 337* IOobject::NO_READ, 338* IOobject::NO_WRITE 339* ), 340* gf.mesh(), 341* gf.dimensions() 342* ) 343* ); 344* 345* mag(tMag(), gf); 346* 347* return tMag; //tmp<GeometricField<scalar, PatchField, GeoMesh> > tMag 348*} Code:
//SNIPPET 3 template<class Type, template<class> class PatchField, class GeoMesh> 312 void mag 313 ( 314 GeometricField<scalar, PatchField, GeoMesh>& gsf, 315 const GeometricField<Type, PatchField, GeoMesh>& gf 316 ) 317 { 318 mag(gsf.internalField(), gf.internalField()); //QUESTION 1 319 mag(gsf.boundaryField(), gf.boundaryField()); //QUESTION 2 320 } Code:
//SNIPPET 4 Foam::GeometricField<Type, PatchField, GeoMesh>::internalField() //QUESTION 1 674 { 675 this->setUpToDate(); 676 storeOldTimes(); 677 return *this; 678 } Code:
//SNIPPET 5 Foam::GeometricField<Type, PatchField, GeoMesh>::boundaryField() //QUESTION 2 686 { 687 this->setUpToDate(); 688 storeOldTimes(); 689 return boundaryField_; //GeometricBoundaryField boundaryField_ 690 } QUESTION 1: If "internalfield()" returns the updated object it is called on and afterwards mag(...) is called in line 318 of SNIPPET 3 wouldn't this cause an endless loop since the SAME method mag(...) like at the beginning of SNIPPET 3 would be called again and again? QUESTION 2: method mag(...) in line 319 of SNIPPET 3 should be Code:
void mag(FieldField<Field, scalar>& sf, const FieldField<Field, Type>& f) //sf: GeometricBoundaryField boundaryField_ of GeometricField of tmp<GeometricField<scalar, PatchField, GeoMesh> > tMag 189*{ //f: GeometricBoundaryField boundaryField_ of const surfaceScalarField& phi_ 190* forAll(sf, i) 191* { 192* mag(sf[i], f[i]); 193* } 194*} Last edited by maybee; December 22, 2013 at 07:10. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
multiphaseEulerFoam: method iter() and calculation of phase fractions | maybee | OpenFOAM Programming & Development | 1 | July 22, 2020 09:20 |
On the alpha Eqn of VOF method when using Immersed boundary method in OpenFOAM | keepfit | OpenFOAM | 4 | January 31, 2014 15:32 |
multiphaseEulerFoam: Method forAllIter(...) within solve() | maybee | OpenFOAM Programming & Development | 4 | January 7, 2014 05:35 |
[Gmsh] discretizer - gmshToFoam | Andyjoe | OpenFOAM Meshing & Mesh Conversion | 13 | March 14, 2012 05:35 |
Code for most powerfull FDV Method | D.S.Nasan | Main CFD Forum | 6 | September 4, 2008 03:08 |