CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

hot to write mDotAlphal() field during compressibleInterFoam simulations

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 5, 2023, 04:28
Default hot to write mDotAlphal() field during compressibleInterFoam simulations
  #1
New Member
 
nicola andreini
Join Date: Jan 2020
Location: Florence
Posts: 4
Rep Power: 6
nicola_andreini is on a distinguished road
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_)
);
}
nicola_andreini is offline   Reply With Quote

Old   November 5, 2023, 05:25
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,086
Rep Power: 26
Yann will become famous soon enough
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
Yann is offline   Reply With Quote

Old   November 5, 2023, 14:13
Default
  #3
New Member
 
nicola andreini
Join Date: Jan 2020
Location: Florence
Posts: 4
Rep Power: 6
nicola_andreini is on a distinguished road
Quote:
Originally Posted by Yann View Post
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
Thank you very much, unfortunately I have tried but it is not possible to use writeObject for that type of objects.
nicola_andreini is offline   Reply With Quote

Old   November 6, 2023, 02:38
Default
  #4
Member
 
Lorenzo
Join Date: Apr 2020
Location: Italy
Posts: 38
Rep Power: 6
Lorenzo210 is on a distinguished road
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
Lorenzo210 is offline   Reply With Quote

Reply

Tags
cavitation model, compressibleinterfoam, evaporation condensation, kunz, schnerr-sauer

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 15:22
mesh file for flow over a circular cylinder Ardalan Main CFD Forum 7 December 15, 2020 13:06
How can write a field in openFOAM sven82 OpenFOAM Programming & Development 27 December 11, 2019 11:57
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 14:37


All times are GMT -4. The time now is 20:28.