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

New output variable for source term in fvoptions - without changing the solver

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 6 Post By vincent.clary

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2018, 12:21
Default New output variable for source term in fvoptions - without changing the solver
  #1
New Member
 
Vincent Clary
Join Date: Feb 2018
Posts: 2
Rep Power: 0
vincent.clary is on a distinguished road
Hello everybody,
We are running simulations imposing force source terms in order to model roughly tidal turbines with Actuator Disk method or equivalent.
We added the code in fvoptions, calling an external .h file Vectorcodedsource.h (that we created) because the code was too long to be implemented directly in fvoptions.
Everything is running well but we now would like to create an output variable for this force source term (that is a vector). Is there a way to program this directly in fvoptions? Or another method without modifying the solver?

Thank you a lot for your help. Here are the fvoptions file and .h files.
fvOptions.txt

myLongCode.H
vincent.clary is offline   Reply With Quote

Old   February 24, 2018, 07:45
Default
  #2
Member
 
Anurag
Join Date: Aug 2014
Location: Germany
Posts: 57
Rep Power: 12
anuragm is on a distinguished road
Quote:
Originally Posted by vincent.clary View Post
Hello everybody,
Everything is running well but we now would like to create an output variable for this force source term (that is a vector). Is there a way to program this directly in fvoptions? Or another method without modifying the solver?
You can try working with function objects in your controlDict. Here is a good documentation on how to implement and use this feature.

http://www.tfd.chalmers.se/~hani/kur...CFD_Report.pdf

You can create these objects either at runtime or after the simulation has completed using -postProcess flag
anuragm is offline   Reply With Quote

Old   June 26, 2018, 06:21
Default
  #3
New Member
 
Vincent Clary
Join Date: Feb 2018
Posts: 2
Rep Power: 0
vincent.clary is on a distinguished road
Hello,
Thank you for your answer, I'm replying quite late!
Finally we solved the problem by creating a new field in fvOptions:
Code:
//creates object to be able to have the Termsource output in paraview
volVectorField Termsource
     (
     IOobject
     (
         "Termsource",
mesh_.time().timeName(),
                 mesh_,
                 IOobject::NO_READ,
                 IOobject::AUTO_WRITE
     ),
         mesh_,
         dimensionedVector
         (
                 "Uvec",
                 dimVelocity,
                 vector::zero
         )
     );
Then we implement Termsource in the code.

And to have the output only at selected output times:
Code:
if(mesh_.time().outputTime())
{
    Termsource.write();
}
Sun, SHUBHAM9595, ruloz and 3 others like this.
vincent.clary is offline   Reply With Quote

Reply


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
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 16:45
Variable value with time - from SOLVER FILE Tuks CFX 4 July 11, 2005 06:49
compressible two phase flow in CFX4.4 youngan CFX 0 July 2, 2003 00:32
Replace periodic by inlet-outlet pair lego CFX 3 November 5, 2002 21:09


All times are GMT -4. The time now is 01:47.