|
[Sponsors] |
February 6, 2023, 05:11 |
Use v2 field values in dispersion model
|
#1 |
New Member
Charles Guaquiere
Join Date: Sep 2022
Posts: 14
Rep Power: 3 |
Hello everyone,
I'm working on a turbulent particulate flow in a horizontal 2D channel, I use v2f model for turbulence and I would like to use v2 field values (returned by v2f model) in my dispersion model. For now I use correlations from DNS to calculate velocity fluctuations on fluid but I want to be more general with v2 values. I tried to add v2 values in file "momentumTransportModel.H" like this (same way as for k, epsilon, ...): Code:
virtual tmp<volScalarField> v2() const = 0; Code:
template<class CloudType> Foam::tmp<Foam::volScalarField> Foam::DispersionRASModel<CloudType>::v2Model() const { const objectRegistry& obr = this->owner().mesh(); const word turbName = IOobject::groupName ( momentumTransportModel::typeName, this->owner().U().group() ); if (obr.foundObject<momentumTransportModel>(turbName)) { const momentumTransportModel& model = obr.lookupObject<momentumTransportModel>(turbName); return model.v2(); } else { FatalErrorInFunction << "Turbulence model not found in mesh database" << nl << "Database objects include: " << obr.sortedToc() << abort(FatalError); return tmp<volScalarField>(nullptr); } } Code:
const scalar v2_ = this->v2Ptr_->primitiveField()[celli]; So can someone help me to find an other solution to access to my v2 field values and use them in my dispersion code ?? Or tell me if I made a mistake in my code. Thanks in advance for your help !! Best regards |
|
February 6, 2023, 09:26 |
|
#2 |
New Member
Charles Guaquiere
Join Date: Sep 2022
Posts: 14
Rep Power: 3 |
Problem solved
|
|
February 10, 2023, 06:31 |
|
#3 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14 |
Can you consider adding your solution, instead of just saying that you solved it? It will help others in the future if they have the same problem, and therefore helps increase the utility of the site? Thanks in advance.
|
|
February 10, 2023, 08:20 |
|
#4 |
New Member
Charles Guaquiere
Join Date: Sep 2022
Posts: 14
Rep Power: 3 |
Yes of course, Sorry.
To solve my problem and add v2 field values, I just added following lines in my turbulent dispersion file: Code:
const objectRegistry& obr = this->owner().mesh(); const volScalarField& v2_ = obr.lookupObject<volScalarField>("v2"); const scalar v2 = v2_[celli]; |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Foam::error::PrintStack | almir | OpenFOAM Running, Solving & CFD | 91 | December 21, 2022 04:50 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 06:20 |
Error in Two phase (condensation) modeling | adilsyyed | CFX | 15 | June 24, 2015 19:42 |
''unknown radialModelType type Gidaspow'' PROBLEM WITH THE BED TUTORIAL | AndoniBM | OpenFOAM Running, Solving & CFD | 2 | March 25, 2015 18:44 |
Overflow Error in Multiphase Modelling with Two Continuous Fluids | ashtonJ | CFX | 6 | August 11, 2014 14:32 |