|
[Sponsors] | |||||
hot to write mDotAlphal() field during compressibleInterFoam simulations |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
nicola andreini
Join Date: Jan 2020
Location: Florence
Posts: 5
Rep Power: 7 ![]() |
Good morning,
I am doing simulations using compressibleInterFoam, how can I write in simulation foalders the mDotAlphal() field associated with condensation and evaporation ? I am using the SchnerrSauer model. Foam::Pair<Foam::tmp<Foam::volScalarField>> Foam::twoPhaseChangeModels::SchnerrSauer::mDotAlphal() const { const volScalarField& p = mixture_.U().db().lookupObject<volScalarField>("p" ); const volScalarField pCoeff(this->pCoeff(p)); const volScalarField limitedAlpha1 ( min(max(mixture_.alpha1(), scalar(0)), scalar(1)) ); return Pair<tmp<volScalarField>> ( Cc_*limitedAlpha1*pCoeff*max(p - pSat(), p0_), Cv_*(1.0 + alphaNuc() - limitedAlpha1)*pCoeff*min(p - pSat(), p0_) ); } |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,349
Rep Power: 32 ![]() ![]() |
Hello Nicola,
I don't know if it will work on your specific case, but have a look to the writeObjects function object. It allows to write variables which are registered to the database but not written to disk by default.
Regards, Yann |
|
|
|
|
|
|
|
|
#3 | |
|
New Member
nicola andreini
Join Date: Jan 2020
Location: Florence
Posts: 5
Rep Power: 7 ![]() |
Quote:
|
||
|
|
|
||
|
|
|
#4 |
|
Member
Lorenzo
Join Date: Apr 2020
Location: Italy
Posts: 58
Rep Power: 7 ![]() |
Hi Nicola,
A simple way to do it could be creating a variable in createFileds.H and the assign the value of mixture->mDotAlphal(); somewhere after mixture->correct; Beware that mDotAlphal() is a Pair, so you may use two different volScalarField objects to write each component on. You can set the IOobject options to NO_READ and AUTO_WRITE, so the variable will be written in each folder and you won't need to set a value in the 0 folder. Regards, Lorenzo |
|
|
|
|
|
![]() |
| Tags |
| cavitation model, compressibleinterfoam, evaporation condensation, kunz, schnerr-sauer |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Write probability as a field scalar, such as P(Ux>0) in transient simulations | chen112p | OpenFOAM Post-Processing | 0 | February 11, 2023 16:22 |
| mesh file for flow over a circular cylinder | Ardalan | Main CFD Forum | 7 | December 15, 2020 14:06 |
| How can write a field in openFOAM | sven82 | OpenFOAM Programming & Development | 27 | December 11, 2019 12:57 |
| Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
| Phase locked average in run time | panara | OpenFOAM | 2 | February 20, 2008 15:37 |