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

Any possibility to calculate grad*grad implicitly?

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By xuegy
  • 1 Post By Tobi
  • 1 Post By Tobi
  • 1 Post By xuegy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 16, 2017, 13:23
Default Any possibility to calculate grad*grad implicitly?
  #1
Member
 
Join Date: Jun 2016
Posts: 99
Rep Power: 9
xuegy is on a distinguished road
Hello all,

I have a mass transport equation with term
CodeCogsEqn.png
where c is unknown concentration to be solved and T is known temperature from previous equation.
I transformed the above term into
CodeCogsEqn (2).png
And since term grad(T) is dominating, I want to solve grad(C) implicitly. However there's only fvc::grad(C) to use.

So is there any possibility to solve this term implicitly?

Thanks.
Kummi likes this.
xuegy is offline   Reply With Quote

Old   May 16, 2017, 18:22
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
No, the gradient can only be calculated with the last stored values. I never heard that people calculate the gradient implicitly. Now I am wondering, if it would be possible in general. Well. In FOAM it is not possible. See page 35: http://foam.sourceforge.net/docs/Gui...mmersGuide.pdf
Kummi likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 16, 2017, 19:43
Default
  #3
Member
 
Join Date: Jun 2016
Posts: 99
Rep Power: 9
xuegy is on a distinguished road
Actually I don't need an implicit gradient. All I need is an implicit inner product of two gradients, which is a scalar.
Or, can I discretize the original term directly?
xuegy is offline   Reply With Quote

Old   May 17, 2017, 02:19
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi, the First Term is a laplacian which can be treated implicitly.

Sent from my HTC One mini using CFD Online Forum mobile app
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 17, 2017, 09:08
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

I was talking to my colleague Chris about that and I am sorry to get the message wrong.
You are solving for c which I was not aware yesterday. So what you could try is:

a) Solve TEqn.

b) Build you gradT = fvc::grad(T) field

c) Solve your equation and treat your divergence term implicitly like:

\nabla \bullet (c \nabla T) = \nabla \bullet (\nabla T c) = \mathrm{div}(\nabla T c)

which would be:
Code:
fvm::div(gradT, c)
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 17, 2017, 09:27
Default
  #6
Member
 
Join Date: Jun 2016
Posts: 99
Rep Power: 9
xuegy is on a distinguished road
No, this won't work.
It says:
Code:
cannot convert ‘gradT’ (type ‘Foam::volVectorField {aka Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>}’) to type ‘const surfaceScalarField& {aka const Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&}’
That's why I split the divergence term.
xuegy is offline   Reply With Quote

Old   May 17, 2017, 09:46
Default
  #7
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Ah, of course. I am sorry again. So you have to interpolate the gradient to the surface first. Thus you have to do the following:

a) create a new surfaceScalarField

b) Interpolate the gradT to the surfaces

c) use this field in the divergence term

Like:

Code:
volScalarField gradT = fvc::grad(T);

surfaceScalarField gradTf = fvc::interpolate(gradT) & mesh.Sf();

fvm::div(gradTf, c)
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 17, 2017, 10:45
Default
  #8
Member
 
Join Date: Jun 2016
Posts: 99
Rep Power: 9
xuegy is on a distinguished road
Yeah I can compile it. I can't wait to see the result of a testing case.

So is it something like a heat flux without thermal conductivity?
xuegy is offline   Reply With Quote

Old   May 18, 2017, 07:40
Default
  #9
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Yes, the physical meaning of the divergence is the flux which is going in and out of an volume element. I have no idea how you got to that term because it would mean that the concentration (of some species?), is transported by the temperature gradient (like a temperature flux). Thus, the concentration is moving to the highest temperature (if I have the sign correct - or vice versa). However, normally only the velocity can transport a quantity by fluxes. But maybe there is some physical meaning behind your term that I don't know. In the general conservation equations, I never saw a term like that.

But nice to hear, that it is working.
openfoam_aero likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 18, 2017, 08:25
Default
  #10
Member
 
Join Date: Jun 2016
Posts: 99
Rep Power: 9
xuegy is on a distinguished road
It's called thermophoresis. Particles can be driven by temperature gradient.
openfoam_aero likes this.
xuegy 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
Calculate CF Odusseas Tecplot 3 August 28, 2020 14:16
calculate friction factor & nusselt number soheil1991 FLUENT 3 March 11, 2017 09:30
How to calculate Torque for francis turbine manish CFX 4 March 15, 2007 02:57
The terms that should be treated implicitly in LES ben Main CFD Forum 3 January 28, 2005 03:32
How to calculate density of solid phase zhou Main CFD Forum 0 December 17, 1999 19:06


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