|
[Sponsors] |
fvOptions: how does it work or how to use the "fvOptions" ? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 27, 2015, 06:39 |
fvOptions: how does it work or how to use the "fvOptions" ?
|
#1 |
New Member
Xia Shaopeng
Join Date: Sep 2015
Posts: 2
Rep Power: 0 |
i saw the "fvOptions(U)" in simpleFoam/UEqn.H. i know the "fvOptions" is about the source term but how does it work or how to use the "fvOptions" ?
regards |
|
October 27, 2015, 09:54 |
|
#2 |
Senior Member
|
Hi,
1. This is how it works (since your question is about fvOptions(U), I show only this functionality): fvOptions is an object of Foam::fv::optionList class. It has operator (): Code:
//- Return source for equation template<class Type> tmp<fvMatrix<Type> > operator() ( GeometricField<Type, fvPatchField, volMesh>& fld ); Code:
template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator() ( GeometricField<Type, fvPatchField, volMesh>& fld ) { return this->operator()(fld, fld.name()); } template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fv::optionList::operator() ( GeometricField<Type, fvPatchField, volMesh>& fld, const word& fieldName ) { checkApplied(); const dimensionSet ds = fld.dimensions()/dimTime*dimVolume; tmp<fvMatrix<Type> > tmtx(new fvMatrix<Type>(fld, ds)); fvMatrix<Type>& mtx = tmtx(); forAll(*this, i) { option& source = this->operator[](i); label fieldI = source.applyToField(fieldName); if (fieldI != -1) { source.setApplied(fieldI); if (source.isActive()) { if (debug) { Info<< "Applying source " << source.name() << " to field " << fieldName << endl; } source.addSup(mtx, fieldI); } } } return tmtx; } 2. How to use. Code:
$ cd $FOAM_TUTORIALS $ find . -name 'fvOptions' ... ./incompressible/simpleFoam/mixerVessel2D/system/fvOptions ./incompressible/simpleFoam/turbineSiting/system/fvOptions |
|
Tags |
fvoptions, opfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding fvOptions to turbulence model | slottedLemon | OpenFOAM Programming & Development | 13 | May 28, 2020 13:27 |
Companies that lease software & hardware for cloud-based work? | Catthan | ANSYS | 0 | June 18, 2014 11:53 |
Do all CFD analysts have to do some hands-on work except PhDs? | e13drd | Main CFD Forum | 2 | March 17, 2014 15:56 |
Why do the Plant library cases don't work? | Alumna | Phoenics | 6 | June 22, 2004 13:08 |
why my In-Form doesn't work? | green | Phoenics | 2 | May 27, 2004 22:03 |