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

How to modify const volScalarField& T = thermo.T();

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Zhiheng Wang
  • 2 Post By anishtain4

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 7, 2016, 05:01
Default How to modify const volScalarField& T = thermo.T();
  #1
Member
 
Zhiheng Wang
Join Date: Mar 2016
Posts: 72
Rep Power: 10
Zhiheng Wang is on a distinguished road
Hi,
In my boundary condition Temperature T changes with gradient.
how can I modify if T is defined as "const volScalarField& T = thermo.T();"
in creatField.H.
I want to correct T at boundary with some function.
please provide the solution.
Zhiheng Wang is offline   Reply With Quote

Old   August 7, 2016, 18:55
Default
  #2
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
Are you trying to do this along with a standard solver? Or you are developing your own solver?
Sorry but your problem is not clear.

If you want to update the boundary condition based on its gradient, there are many boundary conditions available that you may choose depending on your problem such as fixedGradient and mixed
anishtain4 is offline   Reply With Quote

Old   August 8, 2016, 03:07
Default
  #3
Member
 
Zhiheng Wang
Join Date: Mar 2016
Posts: 72
Rep Power: 10
Zhiheng Wang is on a distinguished road
Quote:
Originally Posted by anishtain4 View Post
Are you trying to do this along with a standard solver? Or you are developing your own solver?
Sorry but your problem is not clear.

If you want to update the boundary condition based on its gradient, there are many boundary conditions available that you may choose depending on your problem such as fixedGradient and mixed
I want to developed my own solver where convective-diffusive velocity depends on

dT/dy = rho*Uy*LatentHeat/kappa;

I know how to take sngrad in account to calculate dT/dy but my boundary temperature is not changing due to const volScalarField , it gives error
Kummi likes this.
Zhiheng Wang is offline   Reply With Quote

Old   August 8, 2016, 10:42
Default
  #4
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
You can use
Quote:
volScalarField& myT = const_cast<volScalarField&>(T);
to cast away the constness of the pointer. But I wouldn't suggest this.
If your only going to change the boundary condition then why are you developing a solver? And if you are developing a whole new solution that involves solver and boundary just develop them separate. I'm still not clear if the formula you mentioned is going to be used only on boundary or the whole domain, but I guess it can either be done with already existing conditions or developed separately from the solver.
randolph and Kummi like this.
anishtain4 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
Second Derivative Zero - Boundary Condition fu-ki-pa OpenFOAM 11 March 27, 2021 04:28
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
Wall bounded values and streamlines Ruli OpenFOAM Post-Processing 5 February 2, 2014 16:45
[snappyHexMesh] Error in SnappyHexMesh gooya_kabir OpenFOAM Meshing & Mesh Conversion 2 October 23, 2013 04:41
LiftDrag coefficient in LES fabian_korn OpenFOAM Post-Processing 1 September 22, 2008 02:34


All times are GMT -4. The time now is 05:24.