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 Community New Posts Updated Threads Search

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: 29
Rep Power: 7
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
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
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.
HPE is offline   Reply With Quote

Reply

Tags
output coefficient


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 04:47.