Discussion Closed This 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 Oct 21, 2023, 3:34 a.m. EDT
Dave Greve Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 6 months ago Oct 16, 2023, 3:45 p.m. EDT
Updated: 6 months ago Oct 16, 2023, 3:40 p.m. EDT

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: 6 months ago Oct 17, 2023, 4:01 a.m. EDT

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: 6 months ago Oct 21, 2023, 3:34 a.m. EDT

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).

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 the Support Center for a more comprehensive response from the Technical Support team.