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

How to output the turbulent model's coefficient

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 9, 2020, 07:03
Smile How to output the turbulent model's coefficient
  #1
New Member
 
王子阳
Join Date: Aug 2019
Posts: 11
Rep Power: 2
wangziyang is on a distinguished road
i recently use the dynamic Smagorisky model to simulate the cavitation, i want to output the turbulent models coefficent "cD" to a file, what code should i make ?
the the dynamic Smagorisky model.C program of cD is as follows
[/{
// The SGS viscosity is bounded so that nuEff cannot become negative.
// Values are limited here, and not in nuEff, for consistency in stored
// data and in submodels using nuSgs().
// No warning message is printed when this limitation is applied.
nuSgs_ = max(cD(D)*sqr(delta())*sqrt(magSqr(D)), -nu());
nuSgs_.correctBoundaryConditions();
}

volScalarField dynamicSmagorinsky::cD
(
const volSymmTensorField& D
) const
{
tmp<volSymmTensorField> LL =
dev(filter_(sqr(U())) - (sqr(filter_(U()))));//sqr returns the outer product of U, the deviatoric part is explicitly expressed, while the isotropic part is in the pressure term

const volSymmTensorField MM
(
sqr(delta())*(filter_(mag(D)*(D)) - 4*mag(filter_(D))*filter_(D))
);

// Locally averaging MMMM on cell faces
volScalarField MMMM = fvc::average(magSqr(MM));

MMMM.max(VSMALL);

// Performing local avera[/CODE]ge on cell faces on return
return 0.5*fvc::average(LL && MM)/MMMM; // cD expression
}]
wangziyang is offline   Reply With Quote

Old   February 9, 2020, 12:53
Default
  #2
HPE
Senior Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 298
Rep Power: 3
HPE is on a distinguished road
Since `cD` seems to be registered to the mesh, I think adding:

cD.write();

somewhere in your code? Then `cD` could be written out like `U`?

Or if you execute in a single processor:

Info<< cD << endl; // I wouldn't use this though.
__________________
Kind regards,
HPE

The OpenFOAM community is the biggest contributor to OpenFOAM; not person A or B. Let's report bugs or issue feature requests in GitLab-OpenFOAM.

Please `design` your questions well. Such effort always pays off well for inquirers and `helpmate`s:
How to create a Minimal, Reproducible Example,
How to give enough info to get help.
HPE is offline   Reply With Quote

Reply

Tags
output coefficient

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
Convergent-Divergent nozzle Turbulent Models Problems rafiktharwat FLUENT 0 April 11, 2015 12:24
Difficulty In Setting Boundary Conditions Moinul Haque CFX 4 November 25, 2014 18:30
particle tracking sakurabogoda CFX 7 December 5, 2013 00:12
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
error message cuteapathy CFX 14 March 20, 2012 07:45


All times are GMT -4. The time now is 10:04.