Discussion ClosedThis discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one,click here.

How to copy solved temperature of one object to another object of identical meshing

Please login with a confirmed email address before reporting spam

Hi, I am new to COMSOL. After getting the solution of a study, I need to copy the temperature of one object to another object of idetical shape so that I can initialize a new study from there. In this way, I want iteratively perform a study. At present I can export the solution temperature to a file, then create an interpolation function from that file and initialize the next study. However, in the process of exporting to a file and reloading, a lot of NaNs are created due to the narrow structures of the object. However, my objects have same mesh structure (created using copy functionality of the mesh). Hence is it possible to copy the temperature of one object to another with identical meshing. If so, how? Please help


3 Replies Last Post 2023年10月21日 GMT+2 09:34
Dave Greve Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 10 months ago 2023年10月16日 GMT+2 21:45
Updated: 10 months ago 2023年10月16日 GMT+2 21:40

I can't be certain without seeing your (reduced) file (hint, hint!). However, usually if you want to use the results of a previous study in a new study with the same geometry- you can refer to the previous results. No need for a stored file and interpolation.

I can't be certain without seeing your (reduced) file (hint, hint!). However, usually if you want to use the results of a previous study in a new study with the same geometry- you can refer to the previous results. No need for a stored file and interpolation.

Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 10 months ago 2023年10月17日 GMT+2 10:01

Hi Avishek

There are manys ways to copy data from one part of your model to another. You can even copy data between models in a different number of dimensions as I've done in the attached model.

Since this example model has a 2D part and a 3D part the geometries are made in different Components. If you wish to copy data from one place in a geomtry to another place in the same geometry you can simply do this in a single component (and using a single study if you like).

The method you use to define the "copying" is called nonlocal couplings and are found under Definitions->Nonlocal coupling. Notice that I've put copying in quotations marks since you described that you first want to solve one study and then another. It is very possible to solve a coupled problem using a single study and then the "copying" goes in both directions automatically.

In the attached model I've created a Linear Extrusion coupling in Component 1 with the operator name: linext1 and a suitable selection of vertices to define the orientation. in Component 2 I've created a temperature boundary condition with the expression: comp1.linext1(comp1.T). Study 2 has been set up to only solve for the 3D heat transfer and to keep the solution for the 2D problem.

Note that there are many types of couplings. You should read abot them in the Reference Manual.

-------------------
Lars Gregersen
Comsol Denmark
Hi Avishek There are manys ways to copy data from one part of your model to another. You can even copy data between models in a different number of dimensions as I've done in the attached model. Since this example model has a 2D part and a 3D part the geometries are made in different Components. If you wish to copy data from one place in a geomtry to another place in the same geometry you can simply do this in a single component (and using a single study if you like). The method you use to define the "copying" is called nonlocal couplings and are found under Definitions->Nonlocal coupling. Notice that I've put copying in quotations marks since you described that you first want to solve one study and then another. It is very possible to solve a coupled problem using a single study and then the "copying" goes in both directions automatically. In the attached model I've created a Linear Extrusion coupling in Component 1 with the operator name: linext1 and a suitable selection of vertices to define the orientation. in Component 2 I've created a temperature boundary condition with the expression: comp1.linext1(comp1.T). Study 2 has been set up to only solve for the 3D heat transfer and to keep the solution for the 2D problem. Note that there are many types of couplings. You should read abot them in the Reference Manual.


Please login with a confirmed email address before reporting spam

Posted: 10 months ago 2023年10月21日 GMT+2 09:34

Many many thanks for so much detailed guidance. I am following your guidance to use linear extrusion. Here I have another doubt in the statementcomp1.linext1(comp1.T)

I have solved the temperature T using a stationary study and a time dependent study. I want to use the result of time dependent study at t=6s. In the above statemt how can I specify t=6s and how can I specify that I want the result from the time dependent study (not the stationary study).

Many many thanks for so much detailed guidance. I am following your guidance to use linear extrusion. Here I have another doubt in the statement **comp1.linext1(comp1.T)** I have solved the temperature T using a stationary study and a time dependent study. I want to use the result of time dependent study at t=6s. In the above statemt how can I specify t=6s and how can I specify that I want the result from the time dependent study (not the stationary study).

Note that while COMSOL employees may participate in the discussion forum, COMSOL®software users who are on-subscription should submit their questions via theSupport Centerfor a more comprehensive response from the Technical Support team.

Baidu
map