# Solving equation to find an unknown function?

**URL:** https://discourse.paraview.org/t/solving-equation-to-find-an-unknown-function/3579
**Category:** ParaView Support
**Tags:** python
**Created:** [February 17, 2020, 6:53am UTC](https://discourse.paraview.org/t/solving-equation-to-find-an-unknown-function/3579 "2020-02-17T06:53:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![vidyadhar](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/dfb087/32.png) [@vidyadhar](https://discourse.paraview.org/u/vidyadhar)
#### Post date: [February 17, 2020, 6:53am UTC](https://discourse.paraview.org/t/solving-equation-to-find-an-unknown-function/3579/1 "2020-02-17T06:53:45Z")

</div>

Hello,  
I have simulated heat and fluid flow problem in Fluent and imported into Paraview.  
I have the data for velocity, temperature fields.  
Now I want to obtain an unknown function by solving the below equation:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/8/82bc13721a71247bf460b513c30ec3e142e2eec9.png)  
where the terms on the right hand side (density, specific heat, velocity vector, temperature, thermal conductivity) are known from data. The left hand side contains curl of an unknown function “Theta”. I want to find this “Theta” variation which gives me heat function distribution.  
Is it possible? If so, I request the procedure to be done.

Thanks & Regards,  
Vidyadhar

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 17, 2020, 7:03am UTC](https://discourse.paraview.org/t/solving-equation-to-find-an-unknown-function/3579/2 "2020-02-17T07:03:47Z")

</div>

This is not something that is present in ParaView, nor in VTK I think.

You may be able to implement in a Programmable Filter.

---

<div class="post-metadata">

### Author: ![vidyadhar](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/dfb087/32.png) [@vidyadhar](https://discourse.paraview.org/u/vidyadhar)
#### Post date: [February 17, 2020, 7:08am UTC](https://discourse.paraview.org/t/solving-equation-to-find-an-unknown-function/3579/3 "2020-02-17T07:08:17Z")

</div>

Hello Mathieu,

Programmable filters like Python Calculator that is available in Paraview or some thing else?

Thanks,  
Vidyadhar

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 17, 2020, 7:10am UTC](https://discourse.paraview.org/t/solving-equation-to-find-an-unknown-function/3579/4 "2020-02-17T07:10:40Z")

</div>

Python Calculator and Programmable Filter are different things.

I do not think you can solve this in a python calculator.  
Programmable Filter are similar but more complex :  
[https://www.paraview.org/Wiki/Python\_Programmable\_Filter](https://www.paraview.org/Wiki/Python_Programmable_Filter)

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [February 17, 2020, 1:48pm UTC](https://discourse.paraview.org/t/solving-equation-to-find-an-unknown-function/3579/5 "2020-02-17T13:48:47Z")

</div>

If I understand your equation correctly, you first need the gradient of the temperature field. You can estimate that using either the `Gradient` or `Graident of Unstructured DataSet` filters.

The rest of the right side of the equation can be computed with a simple expression in the `Calculator` filter. That will give you the curl of theta.

I don’t think there is any way to compute theta from its curl. It is not in general possible to take the inverse of a curl (c.f. [https://www.quora.com/What-is-the-inverse-operation-of-curl-and-divergence](https://www.quora.com/What-is-the-inverse-operation-of-curl-and-divergence)).

---

<div class="post-metadata">

### Author: ![Vikram](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/e47774/32.png) [@Vikram](https://discourse.paraview.org/u/Vikram)
#### Post date: [February 17, 2020, 5:51pm UTC](https://discourse.paraview.org/t/solving-equation-to-find-an-unknown-function/3579/6 "2020-02-17T17:51:29Z")

</div>

Hello Vidyadhar,  
To build further on Kenneth’s point, the equation you propose to solve is not well posed. In other words, more than one function can satisfy it, starting with theta + any constant.

You can try and regularize the problem, by seeking the theta with the minimum H1 norm that satisfies the equation. That equation should be well posed, but you are probably better off solving that regularized equation in an open source PDE library rather than writing your own solver.

---

<div class="post-metadata">

### Author: ![vidyadhar](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/dfb087/32.png) [@vidyadhar](https://discourse.paraview.org/u/vidyadhar)
#### Post date: [February 18, 2020, 6:42am UTC](https://discourse.paraview.org/t/solving-equation-to-find-an-unknown-function/3579/7 "2020-02-18T06:42:55Z")

</div>

Hello Kenneth and Vikram,  
Thanks for the suggestions.  
As suggested in ANSYS student community, I came across an article (Post#4 in [https://studentcommunity.ansys.com/thread/solving-equation-involving-simulation-data-in-fluent/](https://studentcommunity.ansys.com/thread/solving-equation-involving-simulation-data-in-fluent/)) where they obtained heatlines by writing a Matlab script. May be I have to link Fluent data with Matlab and try if I can write a script!!?  
But, I am not sure as of now.  
Anyway thank you for the suggestions.

Regards,  
Vidyadhar
